summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinichi Watanabe <swatanabe@xevo.com>2020-09-16 15:18:18 +0900
committerShinichi Watanabe <swatanabe@xevo.com>2020-09-16 15:18:18 +0900
commit0aeb8da0119132f4b316c9d1983bbcfa9baba79f (patch)
tree6233534867bb1888d56a052537772275d2bdb698
parenta4f25398780ef4ef94e930baa54857534f2cbf0a (diff)
parentde8e5c9a71ba2c4c793bcf6fcccbb964fe25853a (diff)
downloadsdl_android-0aeb8da0119132f4b316c9d1983bbcfa9baba79f.tar.gz
Merge remote-tracking branch 'upstream/develop' into feature/issue-1361
-rw-r--r--.github/workflows/android.yml8
-rw-r--r--.gitignore14
-rw-r--r--android/build.gradle2
-rw-r--r--android/gradle/wrapper/gradle-wrapper.properties4
-rwxr-xr-xandroid/hello_sdl_android/build.gradle4
-rwxr-xr-xandroid/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java6
-rwxr-xr-xandroid/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java2
-rwxr-xr-xandroid/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java19
-rwxr-xr-xandroid/hello_sdl_android/src/main/res.zipbin71117 -> 0 bytes
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/values-v11/styles.xml11
-rwxr-xr-xandroid/hello_sdl_android/src/main/res/values-v14/styles.xml12
-rw-r--r--android/sdl_android/build.gradle17
-rw-r--r--android/sdl_android/src/androidTest/assets/json/GetVehicleData.json7
-rw-r--r--android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json5
-rw-r--r--android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json5
-rw-r--r--android/sdl_android/src/androidTest/assets/xml/MOBILE_API.xml8429
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/ManagerUtilityTests.java204
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java32
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java84
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java55
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java3
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java120
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManagerTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java4
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java13
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java14
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SubscribeButtonManagerTest.java8
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java608
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperationTest.java902
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperationTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManagerTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperationTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java8
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuManagerTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManagerTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java38
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java5
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/SdlConnection/SdlSessionTests.java8
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java21
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java62
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java21
-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/proxy/InternalProxyMessageTests.java35
-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/SdlProxyBaseTests.java298
-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.java339
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCGenericTests.java662
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCStructTests.java48
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DriverDistractionCapabilityTest.java3
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/FuelRangeTests.java24
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StabilityControlsStatusTests.java58
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CapacityUnitTests.java71
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java4
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java40
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyClosedTests.java44
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java29
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java32
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddCommandTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AddSubmenuTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertManeuverTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/AlertTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateInteractionChoiceSetTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteCommandTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteFileTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteInteractionChoiceSetTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteSubMenuTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java3
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DiagnosticMessageTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DialNumberTests.java3
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/EndAudioPassThruTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetAppServiceDataTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetDTCsTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetFileTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetSystemCapabilityTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java7
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetWayPointsTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ListFilesTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAppServiceInteractionTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformAudioPassThruTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PerformInteractionTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PublishAppServiceTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/PutFileTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReadDidTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/RegisterAppInterfaceTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ResetGlobalPropertiesTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ScrollableMessageTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SendLocationTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetAppIconTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetDisplayLayoutTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetGlobalPropertiesTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetInteriorVehicleDataTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SetMediaClockTimerTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowConstantTbtTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SliderTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SpeakTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeButtonTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java7
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeWayPointsTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SystemRequestTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnregisterAppInterfaceTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeButtonTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java7
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeWayPointsTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UpdateTurnListTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddCommandResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AddSubmenuResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertManeuverResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/AlertResponseTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ButtonPressResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ChangeRegistrationResponseTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteCommandResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteFileResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteInteractionChoiceSetResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteSubMenuResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DiagnosticMessageResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DialNumberResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/EndAudioPassThruResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetAppServiceDataResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetDTCsResponseTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetFileResponseTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetSystemCapabilityResponseTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java40
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetWayPointsResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ListFilesResponseTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAppServiceInteractionResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformAudioPassThruResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PerformInteractionResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PublishAppServiceResponseTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/PutFileResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReadDIDResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/RegisterAppInterfaceResponseTest.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ResetGlobalPropertiesResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ScrollableMessageResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SendLocationResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetAppIconResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetDisplayLayoutResponseTest.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetGlobalPropertiesResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetInteriorVehicleDataResponseTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SetMediaClockTimerResponseTest.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowConstantTbtResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowResponseTest.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SliderResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SpeakResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeButtonResponseTest.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java11
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeWaypointsResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SystemRequestResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnregisterAppInterfaceResponseTest.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeButtonResponseTest.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java13
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeWayPointsResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UpdateTurnListResponseTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/security/SdlSecurityBaseTest.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java25
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockInterfaceBroker.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java11
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java6
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java57
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/RTPH264PacketizerTest.java4
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/SdlRemoteDisplayTest.java5
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/VideoStreamingParametersTest.java17
-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.java5
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexBluetoothTransportTest.java6
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java2
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/utl/AndroidToolsTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java26
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java68
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java11
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java13
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java9
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java1
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/encoder/EncoderUtils.java12
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java4
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java4
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/ProxyBridge.java686
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java15
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java15
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoder.java1
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioDecoderCompat.java3
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java92
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/BaseAudioDecoder.java3
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/SampleBuffer.java3
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java13
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java3
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java4
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java2
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java73
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java2
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java28
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManager.java18
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java22
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/SDLLockScreenActivity.java1
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java4
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java4
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java4
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java5
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java8
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java4
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java5
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java5
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/video/HapticInterfaceManager.java56
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java202
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacket.java9
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java3
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java70
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitor.java82
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitorListener.java46
-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.java64
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyALM.java2074
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java8542
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBuilder.java224
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyConfigurationResources.java66
-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.java77
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/session/SdlSession.java (renamed from android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java)114
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java27
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java335
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/streaming/video/SdlRemoteDisplay.java20
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/trace/TraceDeviceInfo.java8
-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.java4
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java361
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTcpTransport.java12
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransportConfig.java6
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java2
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java144
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java38
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java104
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterStatusProvider.java14
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlTransport.java154
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransport.java557
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransportManager.java6
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportBroker.java125
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportManager.java35
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/USBAccessoryAttachmentActivity.java2
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransport.java915
-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.java4
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteArrayMessageSpliter.java19
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/SdlDeviceListener.java1
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java4
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/util/HttpRequestTask.java6
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/util/IntegrationValidator.java8
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/util/MediaStreamingStatus.java25
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/util/SdlAppInfo.java2
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/util/ServiceFinder.java2
-rw-r--r--android/sdl_android/src/test/java/com/smartdevicelink/managers/video/HapticInterfaceManagerTest.java2
-rw-r--r--base/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java41
-rw-r--r--base/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java96
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java55
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/ISdl.java (renamed from base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java)116
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/ManagerUtility.java52
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java2
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java120
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/file/FileManagerConfig.java4
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseEncryptionLifecycleManager.java13
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java213
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseSystemCapabilityManager.java44
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/lifecycle/OnSystemCapabilityListener.java2
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/lifecycle/PoliciesFetcher.java20
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java13
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java2
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java4
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java4
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java16
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java20
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/BaseSubscribeButtonManager.java29
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java863
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonReplaceOperation.java19
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonTransitionOperation.java10
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java638
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/TextsAndGraphicsState.java123
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java18
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperation.java49
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperation.java29
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/KeyboardAutocompleteCompletionListener.java8
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperation.java32
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperation.java62
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperation.java59
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java99
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseVoiceCommandManager.java17
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java18
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java2
-rw-r--r--base/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java19
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/BaseSdlPacket.java11
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java4
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java76
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/ISdlServiceListener.java (renamed from base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java)10
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java65
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java191
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java5
-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.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java64
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java8
-rw-r--r--base/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java64
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/IProxyListener.java51
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/RPCMessage.java16
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/RPCNotification.java50
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/RPCRequest.java68
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java76
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/RPCStruct.java49
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java71
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/callbacks/InternalProxyMessage.java51
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/callbacks/OnError.java57
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyClosed.java65
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyOpened.java40
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceEnded.java53
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceNACKed.java53
-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/IProxyListenerALM.java37
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java461
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java41
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java92
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java55
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java86
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java92
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java10
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java65
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AppInfo.java28
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java35
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java80
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java28
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java49
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java28
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java89
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java45
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java93
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java23
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java12
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteraction.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java94
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java34
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java54
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java45
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java21
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java94
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java84
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindow.java15
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DTC.java72
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java79
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java73
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java69
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java71
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java71
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindow.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java40
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java103
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java79
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java40
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapability.java11
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DriverDistractionCapability.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DynamicUpdateCapabilities.java10
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java73
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java25
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/FuelRange.java172
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java135
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GearStatus.java13
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java74
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java35
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetFileResponse.java28
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java13
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsent.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsentResponse.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java210
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java211
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java5
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Grid.java18
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java52
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java72
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java35
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java27
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java71
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Headers.java110
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java73
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java76
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java84
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java25
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java30
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java21
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java33
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java24
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceData.java91
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java79
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java56
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java56
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleInfo.java12
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java65
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java56
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java63
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceManifest.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OasisAddress.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java65
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java79
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java15
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java11
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java30
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java8
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java76
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java18
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java21
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java42
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java72
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateFile.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateSubMenu.java8
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java215
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java72
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java28
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java122
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java80
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java51
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java9
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java45
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java39
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RdsData.java24
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java76
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java28
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java212
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java111
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModule.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java49
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java71
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java76
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java30
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java13
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java119
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java113
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SeatLocation.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SeatLocationCapability.java12
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java21
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java43
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java69
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java21
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java70
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java96
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Show.java129
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ShowAppMenu.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java63
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java37
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java42
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java67
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java81
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java19
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java71
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/StabilityControlsStatus.java127
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java69
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java295
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java191
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SubtleAlert.java25
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SubtleAlertResponse.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java10
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java9
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateConfiguration.java11
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java20
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java41
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java68
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java91
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java71
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java21
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppService.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java71
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java306
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java193
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java21
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java74
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java45
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java18
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java72
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherAlert.java42
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherData.java154
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java42
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceManifest.java35
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java30
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WindowState.java8
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WindowStatus.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WindowTypeCapabilities.java6
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonName.java4
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CapacityUnit.java57
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CarModeStatus.java70
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayType.java64
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HMILevel.java64
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeypressMode.java54
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaClockFormat.java70
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeStatus.java64
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java2
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlInterfaceAvailability.java12
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemCapabilityType.java4
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java2
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WarningLightStatus.java68
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnMultipleRequestListener.java20
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnPutFileUpdateListener.java80
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCListener.java7
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java21
-rw-r--r--base/src/main/java/com/smartdevicelink/security/AbstractSdlSecurityBase.java4
-rw-r--r--base/src/main/java/com/smartdevicelink/security/ISecurityInitializedListener.java2
-rw-r--r--base/src/main/java/com/smartdevicelink/session/BaseSdlSession.java (renamed from base/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java)25
-rw-r--r--base/src/main/java/com/smartdevicelink/session/ISdlSessionListener.java (renamed from base/src/main/java/com/smartdevicelink/SdlConnection/ISdlSessionListener.java)3
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java93
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/IStreamListener.java15
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingLPCMParams.java5
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingParams.java8
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/audio/IAudioStreamListener.java (renamed from base/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java)16
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/video/IVideoStreamListener.java (renamed from base/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java)2
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java12
-rw-r--r--base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java54
-rw-r--r--base/src/main/java/com/smartdevicelink/trace/DiagLevel.java64
-rw-r--r--base/src/main/java/com/smartdevicelink/trace/Mime.java70
-rw-r--r--base/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java3
-rw-r--r--base/src/main/java/com/smartdevicelink/trace/SdlTraceBase.java12
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/ITransportListener.java48
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/SdlPsm.java11
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/SiphonServer.java18
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/TransportConstants.java14
-rw-r--r--base/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java5
-rw-r--r--base/src/main/java/com/smartdevicelink/util/ByteEnumer.java69
-rw-r--r--base/src/main/java/com/smartdevicelink/util/DebugTool.java39
-rw-r--r--base/src/main/java/com/smartdevicelink/util/NativeLogTool.java18
-rw-r--r--base/src/main/java/com/smartdevicelink/util/Version.java6
-rw-r--r--hello_sdl_java/gradle/wrapper/gradle-wrapper.jarbin56172 -> 0 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
l---------hello_sdl_java_ee/assets1
-rw-r--r--hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.jarbin56172 -> 0 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--javaEE/build.gradle74
-rw-r--r--javaEE/gradlew.bat168
l---------javaEE/hello_sdl_java_ee/assets1
-rw-r--r--javaEE/hello_sdl_java_ee/build.gradle (renamed from hello_sdl_java_ee/build.gradle)2
-rw-r--r--javaEE/hello_sdl_java_ee/src/main/java/com/smartdevicelink/Main.java (renamed from hello_sdl_java_ee/src/main/java/com/smartdevicelink/Main.java)0
-rw-r--r--javaEE/hello_sdl_java_ee/src/main/java/com/smartdevicelink/SdlService.java (renamed from hello_sdl_java_ee/src/main/java/com/smartdevicelink/SdlService.java)0
-rw-r--r--javaEE/javaEE/README.md (renamed from javaEE/README.md)0
-rw-r--r--javaEE/javaEE/bintray.gradle (renamed from javaEE/bintray.gradle)2
-rw-r--r--javaEE/javaEE/bintray.properties (renamed from javaEE/bintray.properties)0
-rw-r--r--javaEE/javaEE/build.gradle81
-rw-r--r--javaEE/javaEE/src/test/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java153
-rw-r--r--javaEE/javaEE/src/test/java/com/smartdevicelink/test/TestValues.java13
-rw-r--r--javaEE/settings.gradle2
-rw-r--r--javaSE/build.gradle76
-rw-r--r--javaSE/gradlew.bat168
-rwxr-xr-xjavaSE/hello_sdl_java/assets/images/sdl.png (renamed from hello_sdl_java/assets/images/sdl.png)bin3274 -> 3274 bytes
-rwxr-xr-xjavaSE/hello_sdl_java/assets/images/sdl_s_green.png (renamed from hello_sdl_java/assets/images/sdl_s_green.png)bin25896 -> 25896 bytes
-rw-r--r--javaSE/hello_sdl_java/build.gradle (renamed from hello_sdl_java/build.gradle)4
-rw-r--r--javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java (renamed from hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java)10
-rw-r--r--javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java (renamed from hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java)23
-rw-r--r--javaSE/javaSE/README.md (renamed from javaSE/README.md)0
-rw-r--r--javaSE/javaSE/bintray.gradle (renamed from javaSE/bintray.gradle)2
-rw-r--r--javaSE/javaSE/bintray.properties (renamed from javaSE/bintray.properties)0
-rw-r--r--javaSE/javaSE/build.gradle81
-rw-r--r--javaSE/javaSE/src/main/java/com/livio/BSON/BsonEncoder.java (renamed from javaSE/src/main/java/com/livio/BSON/BsonEncoder.java)13
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java (renamed from javaSE/src/main/java/com/smartdevicelink/BuildConfig.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java)8
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java)15
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java)49
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java)16
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java)62
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java)2
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java)2
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java)2
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java)5
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java)5
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java)5
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java20
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java)9
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java)5
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java)5
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java)5
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java (renamed from javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java)28
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java (renamed from javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java)4
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java (renamed from javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java)10
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/session/SdlSession.java (renamed from javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java)7
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java (renamed from javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java)0
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java)7
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java)7
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java)5
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java)2
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java (renamed from javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java)16
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java (renamed from android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java)19
-rw-r--r--javaSE/javaSE/src/main/java/com/smartdevicelink/util/Log.java (renamed from javaSE/src/main/java/com/smartdevicelink/util/Log.java)0
-rw-r--r--javaSE/javaSE/src/main/java/org/json/JSON.java (renamed from javaSE/src/main/java/org/json/JSON.java)0
-rw-r--r--javaSE/javaSE/src/main/java/org/json/JSONArray.java (renamed from javaSE/src/main/java/org/json/JSONArray.java)0
-rw-r--r--javaSE/javaSE/src/main/java/org/json/JSONException.java (renamed from javaSE/src/main/java/org/json/JSONException.java)0
-rw-r--r--javaSE/javaSE/src/main/java/org/json/JSONObject.java (renamed from javaSE/src/main/java/org/json/JSONObject.java)0
-rw-r--r--javaSE/javaSE/src/main/java/org/json/JSONStringer.java (renamed from javaSE/src/main/java/org/json/JSONStringer.java)0
-rw-r--r--javaSE/javaSE/src/main/java/org/json/JSONTokener.java (renamed from javaSE/src/main/java/org/json/JSONTokener.java)0
-rw-r--r--javaSE/javaSE/src/test/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java153
-rw-r--r--javaSE/javaSE/src/test/java/com/smartdevicelink/test/TestValues.java13
-rw-r--r--javaSE/settings.gradle3
-rw-r--r--javaSE/src/main/java/android/os/AsyncTask.java27
-rw-r--r--javaSE/src/main/java/android/os/Parcel.java59
-rw-r--r--javaSE/src/main/java/android/os/Parcelable.java31
-rw-r--r--javaSE/src/main/java/android/util/Log.java71
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java11
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java77
-rw-r--r--javaSE/src/main/java/com/smartdevicelink/util/HttpRequestTask.java183
694 files changed, 12923 insertions, 38356 deletions
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index c2ec6bf32..721ac4915 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -28,13 +28,13 @@ jobs:
run: ./android/gradlew -p ./android/hello_sdl_android test
- name: Sdl JavaSE Tests
- run: ./javaSE/gradlew -p ./javaSE test
+ run: ./javaSE/gradlew -p ./javaSE/javaSE test
- name: Hello Sdl JavaSE Tests
- run: ./hello_sdl_java/gradlew -p ./hello_sdl_java test
+ run: ./javaSE/gradlew -p ./javaSE/hello_sdl_java test
- name: Sdl JavaEE Tests
- run: ./javaEE/gradlew -p ./javaEE test
+ run: ./javaEE/gradlew -p ./javaEE/javaEE test
- name: RPC Generator Tests
run: |
@@ -42,6 +42,6 @@ jobs:
python3 ./generator/test/runner.py
- name: Codecov
- uses: codecov/codecov-action@v1.0.6
+ uses: codecov/codecov-action@v1.0.13
with:
yml: ./codecov.yml
diff --git a/.gitignore b/.gitignore
index 3682f20b3..e9408b57d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,14 +1,12 @@
##############################
# Project Specific
##############################
-javaSE/out/
-javaSE/build/
-javaSE/local.properties
-javaEE/out/
-javaEE/build/
-javaEE/local.properties
-baseAndroid/windows/
-
+javaSE/javaSE/out/
+javaSE/javaSE/build/
+javaSE/javaSE/local.properties
+javaEE/javaEE/out/
+javaEE/javaEE/build/
+javaEE/javaEE/local.properties
##############################
# OS generated files
diff --git a/android/build.gradle b/android/build.gradle
index f94362a81..7ecff6a6a 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.3.1'
+ classpath 'com.android.tools.build:gradle:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index 567cd660e..6691197d2 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Sun Jan 20 22:30:48 EST 2019
+#Wed Aug 19 13:26:39 EDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip \ No newline at end of file
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
diff --git a/android/hello_sdl_android/build.gradle b/android/hello_sdl_android/build.gradle
index 3e3a83528..f990b38e6 100755
--- a/android/hello_sdl_android/build.gradle
+++ b/android/hello_sdl_android/build.gradle
@@ -5,7 +5,7 @@ android {
defaultConfig {
applicationId "com.sdl.hellosdlandroid"
minSdkVersion 16
- targetSdkVersion 28
+ targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
@@ -54,7 +54,7 @@ dependencies {
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
- implementation 'androidx.appcompat:appcompat:1.0.0'
+ implementation 'androidx.appcompat:appcompat:1.2.0'
implementation project(path: ':sdl_android')
testImplementation 'junit:junit:4.12'
} \ No newline at end of file
diff --git a/android/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 3c4fabc57..69a86129a 100755
--- a/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java
+++ b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java
@@ -2,13 +2,13 @@ package com.sdl.hellosdlandroid;
import android.content.Intent;
import android.os.Bundle;
-import androidx.appcompat.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
+import androidx.appcompat.app.AppCompatActivity;
+
public class MainActivity extends AppCompatActivity {
- private static final String TAG = "MainActivity";
-
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
diff --git a/android/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 c850f388c..a63258a49 100755
--- a/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java
+++ b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlReceiver.java
@@ -9,7 +9,7 @@ import com.smartdevicelink.transport.SdlRouterService;
import com.smartdevicelink.util.DebugTool;
public class SdlReceiver extends SdlBroadcastReceiver {
- private static final String TAG = "SdlBroadcastReciever";
+ private static final String TAG = "SdlBroadcastReceiver";
@Override
public void onSdlEnabled(Context context, Intent intent) {
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
index 893525b97..9a7ef2eeb 100755
--- 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
@@ -12,11 +12,11 @@ import android.os.IBinder;
import android.util.Log;
import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.managers.screen.OnButtonListener;
import com.smartdevicelink.managers.SdlManager;
import com.smartdevicelink.managers.SdlManagerListener;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
import com.smartdevicelink.managers.lifecycle.LifecycleConfigurationUpdate;
+import com.smartdevicelink.managers.screen.OnButtonListener;
import com.smartdevicelink.managers.screen.choiceset.ChoiceCell;
import com.smartdevicelink.managers.screen.choiceset.ChoiceSet;
import com.smartdevicelink.managers.screen.choiceset.ChoiceSetSelectionListener;
@@ -26,12 +26,12 @@ import com.smartdevicelink.managers.screen.menu.VoiceCommand;
import com.smartdevicelink.managers.screen.menu.VoiceCommandSelectionListener;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.TTSChunkFactory;
import com.smartdevicelink.proxy.rpc.Alert;
import com.smartdevicelink.proxy.rpc.OnButtonEvent;
import com.smartdevicelink.proxy.rpc.OnButtonPress;
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
import com.smartdevicelink.proxy.rpc.Speak;
+import com.smartdevicelink.proxy.rpc.TTSChunk;
import com.smartdevicelink.proxy.rpc.enums.AppHMIType;
import com.smartdevicelink.proxy.rpc.enums.ButtonName;
import com.smartdevicelink.proxy.rpc.enums.FileType;
@@ -40,6 +40,7 @@ import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
import com.smartdevicelink.proxy.rpc.enums.Language;
import com.smartdevicelink.proxy.rpc.enums.MenuLayout;
import com.smartdevicelink.proxy.rpc.enums.PredefinedWindows;
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
import com.smartdevicelink.transport.BaseTransportConfig;
@@ -203,11 +204,6 @@ public class SdlService extends Service {
}
@Override
- public LifecycleConfigurationUpdate managerShouldUpdateLifecycle(Language language) {
- return null;
- }
-
- @Override
public LifecycleConfigurationUpdate managerShouldUpdateLifecycle(Language language, Language hmiLanguage) {
boolean isNeedUpdate = false;
String appName = APP_NAME;
@@ -237,7 +233,8 @@ public class SdlService extends Service {
break;
}
if (isNeedUpdate) {
- return new LifecycleConfigurationUpdate(appName, null, TTSChunkFactory.createSimpleTTSChunks(ttsName), null);
+ Vector<TTSChunk> chunks = new Vector<>(Collections.singletonList(new TTSChunk(ttsName, SpeechCapabilities.TEXT)));
+ return new LifecycleConfigurationUpdate(appName, null, chunks, null);
} else {
return null;
}
@@ -352,7 +349,8 @@ public class SdlService extends Service {
* Will speak a sample welcome message
*/
private void performWelcomeSpeak(){
- sdlManager.sendRPC(new Speak(TTSChunkFactory.createSimpleTTSChunks(WELCOME_SPEAK)));
+ List<TTSChunk> chunks = Collections.singletonList(new TTSChunk(WELCOME_SPEAK, SpeechCapabilities.TEXT));
+ sdlManager.sendRPC(new Speak(chunks));
}
/**
@@ -414,7 +412,8 @@ public class SdlService extends Service {
sdlManager.getScreenManager().setTextField2("");
sdlManager.getScreenManager().commit(null);
- sdlManager.sendRPC(new Speak(TTSChunkFactory.createSimpleTTSChunks(TEST_COMMAND_NAME)));
+ List<TTSChunk> chunks = Collections.singletonList(new TTSChunk(TEST_COMMAND_NAME, SpeechCapabilities.TEXT));
+ sdlManager.sendRPC(new Speak(chunks));
}
private void showAlert(String text){
diff --git a/android/hello_sdl_android/src/main/res.zip b/android/hello_sdl_android/src/main/res.zip
deleted file mode 100755
index 16370f43a..000000000
--- a/android/hello_sdl_android/src/main/res.zip
+++ /dev/null
Binary files differ
diff --git a/android/hello_sdl_android/src/main/res/values-v11/styles.xml b/android/hello_sdl_android/src/main/res/values-v11/styles.xml
deleted file mode 100755
index a4a95bc46..000000000
--- a/android/hello_sdl_android/src/main/res/values-v11/styles.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<resources>
-
- <!--
- Base application theme for API 11+. This theme completely replaces
- AppBaseTheme from res/values/styles.xml on API 11+ devices.
- -->
- <style name="AppBaseTheme" parent="Theme.AppCompat.Light">
- <!-- API 11 theme customizations can go here. -->
- </style>
-
-</resources>
diff --git a/android/hello_sdl_android/src/main/res/values-v14/styles.xml b/android/hello_sdl_android/src/main/res/values-v14/styles.xml
deleted file mode 100755
index 664f4f162..000000000
--- a/android/hello_sdl_android/src/main/res/values-v14/styles.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<resources>
-
- <!--
- Base application theme for API 14+. This theme completely replaces
- AppBaseTheme from BOTH res/values/styles.xml and
- res/values-v11/styles.xml on API 14+ devices.
- -->
- <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
- <!-- API 14 theme customizations can go here. -->
- </style>
-
-</resources>
diff --git a/android/sdl_android/build.gradle b/android/sdl_android/build.gradle
index 100a266ca..e92009c2a 100644
--- a/android/sdl_android/build.gradle
+++ b/android/sdl_android/build.gradle
@@ -1,6 +1,4 @@
apply plugin: 'com.android.library'
-import org.apache.tools.ant.taskdefs.condition.Os
-
android {
compileSdkVersion 29
@@ -37,6 +35,7 @@ android {
sourceSets {
main.java.srcDirs += '../../base/src/main/java'
+ androidTest.assets.srcDirs += '../../generator/rpc_spec/'
}
}
@@ -48,13 +47,13 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation 'junit:junit:4.12'
- testImplementation 'org.mockito:mockito-core:2.9.0'
+ testImplementation 'org.mockito:mockito-core:3.0.0'
+ androidTestImplementation 'org.mockito:mockito-core:3.0.0'
+ androidTestImplementation 'org.mockito:mockito-android:3.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
- androidTestImplementation 'org.mockito:mockito-core:2.9.0'
- androidTestImplementation 'org.mockito:mockito-android:2.9.0'
- api 'androidx.annotation:annotation:1.0.0'
- api 'androidx.lifecycle:lifecycle-extensions:2.0.0'
- annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.0.0'
+ api 'androidx.annotation:annotation:1.1.0'
+ api 'androidx.lifecycle:lifecycle-extensions:2.2.0'
+ annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.2.0'
}
buildscript {
@@ -63,7 +62,7 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
+ classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
diff --git a/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json b/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json
index e75de1d3b..085cfedce 100644
--- a/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json
+++ b/android/sdl_android/src/androidTest/assets/json/GetVehicleData.json
@@ -34,7 +34,8 @@
"electronicParkBrakeStatus":true,
"gearStatus": true,
"oemCustomVehicleDataName":true,
- "windowStatus": true
+ "windowStatus": true,
+ "stabilityControlsStatus": true
}
},
"response":{
@@ -172,6 +173,10 @@
"range":10.0
}
],
+ "stabilityControlsStatus": {
+ "escSystem": "ON",
+ "trailerSwayControl": "OFF"
+ },
"oemCustomVehicleDataName":"oemCustomVehicleDataState",
"gearStatus": {
"userSelectedGear": "PARK",
diff --git a/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json b/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json
index c61da0661..a876a8a10 100644
--- a/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json
+++ b/android/sdl_android/src/androidTest/assets/json/SubscribeVehicleData.json
@@ -31,6 +31,7 @@
"fuelRange":true,
"turnSignal":true,
"electronicParkBrakeStatus":true,
+ "stabilityControlsStatus": true,
"gearStatus": true,
"oemCustomVehicleDataName":true,
"windowStatus": true,
@@ -157,6 +158,10 @@
"dataType":"VEHICLEDATA_HANDSOFFSTEERING",
"resultCode":"SUCCESS"
},
+ "stabilityControlsStatus":{
+ "dataType":"VEHICLEDATA_STABILITYCONTROLSSTATUS",
+ "resultCode":"SUCCESS"
+ },
"gearStatus":{
"dataType":"VEHICLEDATA_GEARSTATUS",
"resultCode":"SUCCESS"
diff --git a/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json b/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json
index dd00502e5..e57dea0c8 100644
--- a/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json
+++ b/android/sdl_android/src/androidTest/assets/json/UnsubscribeVehicleData.json
@@ -31,6 +31,7 @@
"fuelRange":true,
"turnSignal":true,
"electronicParkBrakeStatus":true,
+ "stabilityControlsStatus": true,
"handsOffSteering": true,
"gearStatus": true,
"oemCustomVehicleDataName":true,
@@ -161,6 +162,10 @@
"dataType":"VEHICLEDATA_GEARSTATUS",
"resultCode":"SUCCESS"
},
+ "stabilityControlsStatus":{
+ "dataType":"VEHICLEDATA_STABILITYCONTROLSSTATUS",
+ "resultCode":"SUCCESS"
+ },
"oemCustomVehicleDataName":{
"oemCustomDataType":"oemCustomVehicleDataName",
"resultCode":"SUCCESS"
diff --git a/android/sdl_android/src/androidTest/assets/xml/MOBILE_API.xml b/android/sdl_android/src/androidTest/assets/xml/MOBILE_API.xml
deleted file mode 100644
index 86cfe4f5c..000000000
--- a/android/sdl_android/src/androidTest/assets/xml/MOBILE_API.xml
+++ /dev/null
@@ -1,8429 +0,0 @@
-<?xml version="1.0" standalone="no"?>
-<?xml-stylesheet type="text/xml" href="protocol2html.xsl"?>
-
-<interface name="SmartDeviceLink RAPI" version="6.0.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>
- <element name="ENCRYPTION_NEEDED" since="6.0">
- <description>SDL receives an un-encrypted RPC request that needs protection. </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="WindowType" since="6.0">
- <element name="MAIN">
- <description>
- This window type describes the main window on a display.
- </description>
- </element>
- <element name="WIDGET">
- <description>
- A widget is a small window that the app can create to provide information and soft buttons for quick app control.
- </description>
- </element>
- </enum>
-
- <enum name="PredefinedWindows" since="6.0">
- <element name="DEFAULT_WINDOW" value="0">
- <description>The default window is a main window pre-created on behalf of the app.</description>
- </element>
- <element name="PRIMARY_WIDGET" value="1">
- <description>The primary widget of the app.</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"/>
- <element name="VEHICLEDATA_OEM_CUSTOM_DATA" since="6.0"/>
- </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" />
- <!-- Navigation Buttons -->
- <element name="NAV_CENTER_LOCATION" since="6.0" />
- <element name="NAV_ZOOM_IN" since="6.0" />
- <element name="NAV_ZOOM_OUT" since="6.0" />
- <element name="NAV_PAN_UP" since="6.0" />
- <element name="NAV_PAN_UP_RIGHT" since="6.0" />
- <element name="NAV_PAN_RIGHT" since="6.0" />
- <element name="NAV_PAN_DOWN_RIGHT" since="6.0" />
- <element name="NAV_PAN_DOWN" since="6.0" />
- <element name="NAV_PAN_DOWN_LEFT" since="6.0" />
- <element name="NAV_PAN_LEFT" since="6.0" />
- <element name="NAV_PAN_UP_LEFT" since="6.0" />
- <element name="NAV_TILT_TOGGLE" since="6.0" >
- <description>If supported, this toggles between a top-down view and an angled/3D view. If your app supports different, but substantially similar options, then you may implement those. If you don't implement these or similar options, do not subscribe to this button.</description>
- </element>
- <element name="NAV_ROTATE_CLOCKWISE" since="6.0" />
- <element name="NAV_ROTATE_COUNTERCLOCKWISE" since="6.0" />
- <element name="NAV_HEADING_TOGGLE" since="6.0" >
- <description>If supported, this toggles between locking the orientation to north or to the vehicle's heading. If your app supports different, but substantially similar options, then you may implement those. If you don't implement these or similar options, do not subscribe to this button.</description>
- </element>
- </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="templateTitle" since="6.0">
- <description>The title of the new template that will be displayed; 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>
-
- <element name="alertIcon" since="6.0">
- <description>The image field for Alert</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 SmartDeviceLink 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="USER_LOCATION" since="6.0">
- <description>Location of the user's seat of setGlobalProperties</description>
- </element>
- <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>
-
- <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>
-
- <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 the OEM/Manufactorer of the connected module.</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>
-
- <enum name="MenuLayout" since="6.0">
- <description>How the main menu or submenu is laid out on screen</description>
- <element name="LIST" />
- <element name="TILES" />
- </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>
- <param name="shifted" type="Boolean" mandatory="false" since="6.0">
- <description>
- True, if GPS lat/long, time, and altitude have been purposefully shifted (requires a proprietary algorithm to unshift).
- False, if the GPS data is raw and un-shifted.
- If not provided, then value is assumed False.
- </description>
- </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>
- <param name="oemCustomDataType" type="String" mandatory="false" since="6.0">
- <description>Type of requested oem specific parameter </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"/>
- <param name="requireEncryption" type="Boolean" mandatory="false" since="6.0"/>
- </struct>
-
- <struct name="DisplayCapabilities" deprecated="true" since="6.0">
- <history>
- <struct name="DisplayCapabilities" since="1.0" until="6.0"/>
- </history>
- <description>Contains information about the display capabilities. This struct is deprecated; please see the new SystemCapability DISPLAYS and corresponding struct DisplayCapability </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="Grid" since="6.0">
- <description>Describes a location (origin coordinates and span) of a vehicle component.</description>
- <param name="col" type="Integer" mandatory="true" minvalue="-1" maxvalue="100">
- </param>
- <param name="row" type="Integer" mandatory="true" minvalue="-1" maxvalue="100">
- </param>
- <param name="level" type="Integer" mandatory="false" defvalue="0" minvalue="-1" maxvalue="100" >
- </param>
- <param name="colspan" type="Integer" mandatory="false" defvalue="1" minvalue="1" maxvalue="100">
- </param>
- <param name="rowspan" type="Integer" mandatory="false" defvalue="1" minvalue="1" maxvalue="100">
- </param>
- <param name="levelspan" type="Integer" mandatory="false" defvalue="1" minvalue="1" maxvalue="100">
- </param>
- </struct>
-
- <struct name="ModuleInfo" since="6.0">
- <description>Information about a RC module</description>
- <param name="moduleId" type="String" maxlength="100" mandatory="true">
- <description> uuid of a module. "moduleId + moduleType" uniquely identify a module.</description>
- </param>
- <param name="location" type="Grid" mandatory="false">
- <description>Location of a module.</description>
- </param>
- <param name="serviceArea" type="Grid" mandatory="false">
- <description>Service area of a module. </description>
- </param>
- <param name="allowMultipleAccess" type="Boolean" mandatory="false" defvalue="true">
- <description>allow multiple users/apps to access the module or not </description>
- </param>
- </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="moduleInfo" type="ModuleInfo" mandatory="false" since="6.0">
- <description>Information about a RC module, including its id. </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>
- <param name="textSupported" type="Boolean" mandatory="false" since="6.0">
- <description>
- The button supports the use of text.
- If not included, the default value should be considered true that the button will support text.
- </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="WindowCapability" since="6.0">
- <param name="windowID" type="Integer" mandatory="false">
- <description>
- The specified ID of the window. This ID is either one used when sending the CreateWindow request,
- or one of the predefined window ID values from the enum PredefinedWindows. If ommited, value is
- assumed to be the main window on the main display.
- </description>
- </param>
- <param name="textFields" type="TextField" minsize="1" maxsize="100" array="true" mandatory="false">
- <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="imageTypeSupported" type="ImageType" array="true" minsize="0" maxsize="1000" mandatory="false">
- <description>Provides information about image types supported by the system.</description>
- </param>
- <param name="templatesAvailable" type="String" minsize="0" maxsize="100" maxlength="100" array="true" mandatory="false">
- <description>A set of all window templates available on the head unit.</description>
- </param>
- <param name="numCustomPresetsAvailable" type="Integer" minvalue="1" maxvalue="100" mandatory="false">
- <description>The number of on-window custom presets available (if any); otherwise omitted.</description>
- </param>
- <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>The number of buttons and the capabilities of each on-window button.</description>
- </param>
- <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false">
- <description>The number of soft buttons available on-window and the capabilities for each button.</description>
- </param>
- <param name="menuLayoutsAvailable" type="MenuLayout" array="true" minsize="1" maxsize="1000" mandatory="false" since="6.0">
- <description>An array of available menu layouts. If this parameter is not provided, only the `LIST` layout is assumed to be available</description>
- </param>
- </struct>
-
- <struct name="WindowTypeCapabilities" since="6.0">
- <param name="type" type="WindowType" mandatory="true" />
- <param name="maximumNumberOfWindows" type="Integer" mandatory="true" />
- </struct>
-
- <struct name="DisplayCapability" since="6.0">
- <param name="displayName" type="String" mandatory="false" />
- <param name="windowTypeSupported" type="WindowTypeCapabilities" array="true" minsize="1" mandatory="false">
- <description>
- Informs the application how many windows the app is allowed to create per type.
- </description>
- </param>
- <param name="windowCapabilities" type="WindowCapability" array="true" minsize="1" maxsize="1000" mandatory="false">
- <description>
- Contains a list of capabilities of all windows related to the app.
- Once the app has registered the capabilities of all windows are provided.
- GetSystemCapability still allows requesting window capabilities of all windows.
- After registration, only windows with capabilities changed will be included. Following cases will cause only affected windows to be included:
- 1. App creates a new window. After the window is created, a system capability notification will be sent related only to the created window.
- 2. App sets a new layout to the window. The new layout changes window capabilties. The notification will reflect those changes to the single window.
- </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>
- <param name="appServices" type="Boolean" mandatory="false" since="6.0">
- <description>Availability of App Services functionality. True: Available, False: Not Available</description>
- </param>
- <param name="displays" type="Boolean" mandatory="false" since="6.0">
- <description>Availability of displays capability. True: Available, False: Not Available</description>
- </param>
- <param name="seatLocation" type="Boolean" mandatory="false" since="6.0">
- <description>Availability of seat location 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" deprecated="true" since="6.0">
- <description>Deprecated, use autoCompleteList instead.</description>
- <history>
- <param name="autoCompleteText" type="String" maxlength="1000" mandatory="false" since="3.0" until="6.0" />
- </history>
- </param>
- <param name="autoCompleteList" type="String" maxlength="1000" minsize="0" maxsize="100" array="true" mandatory="false" since="6.0">
- <description>
- Allows an app to prepopulate the text field with a list of suggested or completed entries as the user types.
- If empty, the auto-complete list will be removed from the screen.
- </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 SmartDeviceLink 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" />
- <element name="UnpublishAppServiceID" value="56" hexvalue="38" since="6.0" />
- <element name="CancelInteractionID" value="57" hexvalue="39" since="6.0" />
- <element name="CloseApplicationID" value="58" hexvalue="3A" since="6.0" />
- <element name="ShowAppMenuID" value="59" hexvalue="3B" since="6.0" />
- <element name="CreateWindowID" value="60" hexvalue="3C" since="6.0" />
- <element name="DeleteWindowID" value="61" hexvalue="3D" since="6.0" />
- <element name="GetInteriorVehicleDataConsentID" value="62" hexvalue="3E" since="6.0" />
- <element name="ReleaseInteriorVehicleDataModuleID" value="63" hexvalue="3F" since="6.0" />
-
- <!--
- 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"/>
- <element name="SEAT_LOCATION" since="6.0"/>
- <element name="DISPLAYS" since="6.0"/>
- </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>
- <param name="diagonalScreenSize" type="Float" minvalue="0" mandatory="false" since="6.0">
- <description>The diagonal screen size in inches.</description>
- </param>
- <param name="pixelPerInch" type="Float" minvalue="0" mandatory="false" since="6.0">
- <description>PPI is the diagonal resolution in pixels divided by the diagonal screen size in inches.</description>
- </param>
- <param name="scale" type="Float" minvalue="1" maxvalue="10" mandatory="false" since="6.0">
- <description>The scaling factor the app should use to change the size of the projecting view.</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>
-
- <struct name="TemplateConfiguration" since="6.0">
- <param name="template" type="String" maxlength="500" mandatory="true">
- <description>
- Predefined or dynamically created window template.
- Currently only predefined window template layouts are defined.
- </description>
- </param>
- <param name="dayColorScheme" type="TemplateColorScheme" mandatory="false" />
- <param name="nightColorScheme" type="TemplateColorScheme" mandatory="false" />
- </struct>
-
- <!---Remote control -->
-
- <struct name="SeatLocation" since="6.0">
- <description>Describes the location of a seat.</description>
- <param name="grid" type="Grid" mandatory="false">
- </param>
- </struct>
-
- <struct name="SeatLocationCapability" since="6.0">
- <description>Contains information about the locations of each seat</description>
- <param name="rows" type="Integer" minvalue="1" maxvalue="100" mandatory="false"></param>
- <param name="columns" type="Integer" minvalue="1" maxvalue="100" mandatory="false"></param>
- <param name="levels" type="Integer" minvalue="1" maxvalue="100" defvalue="1" mandatory="false">
- </param>
- <param name="seats" type="SeatLocation" array="true" mandatory="false">
- <description>Contains a list of SeatLocation in the vehicle</description>
- </param>
- </struct>
-
- <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" deprecated="true" since="6.0">
- <description>List possible seats that is a remote controllable seat.</description>
- <history>
- <enum name="SupportedSeat" since="5.0" until="6.0"/>
- </history>
- <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" deprecated="true" since="6.0">
- <history>
- <param name="id" type="SupportedSeat" mandatory="true" since="5.0" until="6.0"/>
- </history>
- </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="moduleInfo" type="ModuleInfo" mandatory="false" since="6.0">
- <description>Information about a RC module, including its id. </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" deprecated="true" since="6.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"/>
- <param name="availableHDs" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0" until="6.0"/>
- </history>
- </param>
- <param name="availableHdChannels" type="Integer" minvalue="0" maxvalue="7" array="true" minsize="0" maxsize="8" mandatory="false" since="6.0">
- <description>The list of available HD sub-channel indexes. Empty list means no Hd channel is available. Read-only. </description>
- </param>
- <param name="hdChannel" type="Integer" minvalue="0" maxvalue="7" mandatory="false" since="6.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"/>
- <param name="hdChannel" type="Integer" minvalue="1" maxvalue="7" mandatory="false" since="5.0" until="6.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>
- <param name="climateEnable" type="Boolean" mandatory="false" since="6.0">
- <description>True if the climate module is on, false if the climate module is off</description>
- </param>
- </struct>
-
- <struct name="RadioControlCapabilities" since="4.5">
- <description>Contains information about a radio control module's capabilities.</description>
- <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="moduleInfo" type="ModuleInfo" mandatory="false" since="6.0">
- <description>Information about a RC module, including its id. </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" deprecated="true" since="6.0">
- <description>
- Availability of the getting the number of available HD channels.
- True: Available, False: Not Available, Not present: Not Available.
- </description>
- <history>
- <param name="availableHDsAvailable" type="Boolean" mandatory="false" since="4.5" until="6.0"/>
- </history>
- </param>
- <param name="availableHdChannelsAvailable" type="Boolean" mandatory="false" since="6.0">
- <description>
- Availability of the list of available HD sub-channel indexes.
- 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>
- <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="moduleInfo" type="ModuleInfo" mandatory="false" since="6.0">
- <description>Information about a RC module, including its id. </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>
- <param name="climateEnableAvailable" type="Boolean" mandatory="false" since="6.0">
- <description>
- Availability of the control of enable/disable climate control.
- 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="moduleInfo" type="ModuleInfo" mandatory="false" since="6.0">
- <description>Information about a RC module, including its id. </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="moduleInfo" type="ModuleInfo" mandatory="false" since="6.0">
- <description>Information about a RC module, including its id. </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="moduleInfo" type="ModuleInfo" mandatory="false" since="6.0">
- <description>Information about a RC module, including its id. </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="moduleId" type="String" maxlength="100" mandatory="false" since="6.0">
- <description>Id of a module, published by System Capability. </description>
- </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>
- <param name="mediaImage" type="Image" mandatory="false" since="6.0">
- <description>
- Music: The album art of the current track
- Podcast: The podcast or chapter artwork of the current podcast episode
- Audiobook: The book or chapter artwork of the current audiobook
- </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>
- <param name="seatLocationCapability" type="SeatLocationCapability" mandatory="false" since="6.0">
- <description>Contains information about the locations of each seat</description>
- </param>
- <param name="displayCapabilities" type="DisplayCapability" array="true" minsize="1" maxsize="1000" mandatory="false" since="6.0"/>
- </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. "My SDL App".
- Needs to be unique over all applications from the same device.
- May not be empty.
- May not start with a new line character.
- May not interfere with any name or synonym of previously registered applications from the same device and any predefined blacklist of words (global commands)
- Additional applications with the same name from the same device 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. "My S D L App".
- Meant to overcome any failing on speech engine in properly pronouncing / understanding app name.
- Needs to be unique over all applications from the same device.
- 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 from the same device 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" deprecated="true" since="6.0">
- <description>
- See DisplayCapabilities. This parameter is deprecated and replaced by SystemCapability using DISPLAYS.
- </description>
- <history>
- <param name="displayCapabilities" type="DisplayCapabilities" mandatory="false" since="2.0" until="6.0"/>
- </history>
- </param>
-
- <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" deprecated="true" since="6.0">
- <description>
- See ButtonCapabilities. This parameter is deprecated and replaced by SystemCapability using DISPLAYS.
- </description>
- <history>
- <param name="buttonCapabilities" type="ButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0" until="6.0"/>
- </history>
- </param>
-
- <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" deprecated="true" since="6.0">
- <description>
- If returned, the platform supports on-screen SoftButtons; see SoftButtonCapabilities.
- This parameter is deprecated and replaced by SystemCapability using DISPLAYS.
- </description>
- <history>
- <param name="softButtonCapabilities" type="SoftButtonCapabilities" minsize="1" maxsize="100" array="true" mandatory="false" since="2.0" until="6.0"/>
- </history>
- </param>
-
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false" deprecated="true" since="6.0">
- <description>
- If returned, the platform supports custom on-screen Presets; see PresetBankCapabilities.
- This parameter is deprecated and replaced by SystemCapability using DISPLAYS.
- </description>
- <history>
- <param name="presetBankCapabilities" type="PresetBankCapabilities" mandatory="false" since="2.0" until="6.0"/>
- </history>
- </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="CreateWindow" functionID="CreateWindowID" messagetype="request" since="6.0">
- <description>
- Create a new window on the display with the specified window type.
- </description>
- <param name="windowID" type="Integer" mandatory="true">
- <description>
- A unique ID to identify the window. The value of '0' will always be the default main window on the main display and should not be used in this context as it will already be created for the app. See PredefinedWindows enum. Creating a window with an ID that is already in use will be rejected with `INVALID_ID`.
- </description>
- </param>
-
- <param name="windowName" type="String" maxlength="100" mandatory="true">
- <description>
- The window name to be used by the HMI. The name of the pre-created default window will match the app name.
- Multiple apps can share the same window name except for the default main window.
- Creating a window with a name which is already in use by the app will result in `DUPLICATE_NAME`.
- </description>
- </param>
-
- <param name="type" type="WindowType" mandatory="true">
- <description>The type of the window to be created. Main window or widget.</description>
- </param>
-
- <param name="associatedServiceType" type="String" mandatory="false">
- <description>
- Allows an app to create a widget related to a specific service type.
- As an example if a `MEDIA` app becomes active, this app becomes audible and is allowed to play audio. Actions such as skip or play/pause will be
- directed to this active media app. In case of widgets, the system can provide a single "media" widget which will act as a placeholder for the active media app.
-
- It is only allowed to have one window per service type. This means that a media app can only have a single MEDIA widget. Still the app can create widgets omitting this parameter. Those widgets would be available as app specific widgets that are permanently included in the HMI.
-
- This parameter is related to widgets only. The default main window, which is pre-created during app registration, will be created based on the HMI types specified in the app registration request.
- </description>
- </param>
- <param name="duplicateUpdatesFromWindowID" type="Integer" mandatory="false">
- <description>
- Optional parameter. Specify whether the content sent to an existing window
- should be duplicated to the created window.
- If there isn't a window with the ID, the request will be rejected with `INVALID_DATA`.
- </description>
- </param>
- </function>
-
- <function name="CreateWindow" functionID="CreateWindowID" messagetype="response" since="6.0">
- <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" platform="documentation">
- <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="REJECTED"/>
- <element name="INVALID_DATA"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="DISALLOWED"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- </param>
- </function>
-
- <function name="DeleteWindow" functionID="DeleteWindowID" messagetype="request" since="6.0">
- <description>
- Deletes previously created window of the SDL application.
- </description>
- <param name="windowID" type="Integer" mandatory="true">
- <description>
- A unique ID to identify the window. The value of '0' will always be the default main window on the main display and cannot be deleted.
- See PredefinedWindows enum.
- </description>
- </param>
- </function>
-
- <function name="DeleteWindow" functionID="DeleteWindowID" messagetype="response" since="6.0">
- <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" platform="documentation">
- <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="REJECTED"/>
- <element name="INVALID_DATA"/>
- <element name="INVALID_ID"/>
- <element name="DUPLICATE_NAME"/>
- <element name="DISALLOWED"/>
- <element name="OUT_OF_MEMORY"/>
- <element name="TOO_MANY_PENDING_REQUESTS"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- </param>
- </function>
-
- <function name="SetGlobalProperties" functionID="SetGlobalPropertiesID" messagetype="request" since="1.0">
- <description>Allows setting global properties.</description>
- <param name="userLocation" type="SeatLocation" mandatory="false" since="6.0">
- <description>Location of the user's seat. Default is driver's seat location if it is not set yet.</description>
- </param>
- <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 SmartDeviceLink 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>
-
- <param name="menuLayout" type="MenuLayout" mandatory="false" since="6.0">
- <description>Sets the layout of the main menu screen. If this is sent while a menu is already on-screen, the head unit will change the display to the new layout type.</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>
-
- <param name="menuLayout" type="MenuLayout" mandatory="false" since="6.0">
- <description>Sets the layout of the submenu screen.</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="ShowAppMenu" functionID="ShowAppMenuID" messagetype="request" since="6.0">
- <description>Shows the built in menu view</description>
-
- <param name="menuID" type="Integer" minvalue="1" maxvalue="2000000000" mandatory="false">
- <description>
- If omitted the HMI opens the app's menu.
- If set to a sub-menu ID the HMI opens the corresponding sub-menu previously added using `AddSubMenu`.
- </description>
- </param>
-
- </function>
-
- <function name="ShowAppMenu" functionID="ShowAppMenuID" messagetype="response" since="6.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>
-
- <param name="cancelID" type="Integer" mandatory="false" since="6.0">
- <description>
- An ID for this specific PerformInteraction to allow cancellation through the `CancelInteraction` RPC.
- </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>
-
- <param name="alertIcon" type="Image" mandatory="false" since="6.0">
- <description>
- Image struct determining whether static or dynamic icon.
- If omitted on supported displays, no (or the default if applicable) icon should be displayed.
- </description>
- </param>
-
- <param name="cancelID" type="Integer" mandatory="false" since="6.0">
- <description>
- An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.
- </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>
-
- <param name="templateTitle" type="String" minlength="0" maxlength="100" mandatory="false" since="6.0">
- <description>
- The title of the new template that will be displayed.
- How this will be displayed is dependent on the OEM design and implementation of the template.
- </description>
- </param>
- <param name="windowID" type="Integer" mandatory="false" since="6.0" >
- <description>
- This is the unique ID assigned to the window that this RPC is intended. If this param is not included,
- it will be assumed that this request is specifically for the main window on the main display.
- See PredefinedWindows enum.
- </description>
- </param>
-
- <param name="templateConfiguration" type="TemplateConfiguration" mandatory="false" since="6.0">
- <description>
- Used to set an alternate template layout to a window.
- </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>
- <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>
-
-
- </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>
- <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>
- </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>
- <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>
- </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>
- <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>
- </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>
- <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>
- </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>
- <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>
- </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="false">
- <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="false">
- <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>
- <param name="cancelID" type="Integer" mandatory="false" since="6.0">
- <description>
- An ID for this specific ScrollableMessage to allow cancellation through the `CancelInteraction` RPC.
- </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>
- <param name="cancelID" type="Integer" mandatory="false" since="6.0">
- <description>
- An ID for this specific Slider to allow cancellation through the `CancelInteraction` RPC.
- </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" deprecated="true" since="6.0">
- <history>
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="request" since="3.0" until="6.0"/>
- </history>
- <description>This RPC is deprecated. Use Show RPC to change layout.</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" deprecated="true" since="6.0">
- <history>
- <function name="SetDisplayLayout" functionID="SetDisplayLayoutID" messagetype="response" since="3.0" until="6.0"/>
- </history>
- <description>This RPC is deprecated. Use Show RPC to change layout.</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="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>
-
- <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="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="moduleId" type="String" maxlength="100" mandatory="false" since="6.0">
- <description>Id of a module, published by System Capability. </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="moduleId" type="String" maxlength="100" mandatory="false" since="6.0">
- <description>Id of a module, published by System Capability. </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 module (moduleId and moduleType).
- If subscribe is false, the head unit will unregister OnInteriorVehicleData notifications for the requested module (moduleId and moduleType).
- If subscribe is not included, the subscription status of the app for the requested module (moduleId and 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="false">
- </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="GetInteriorVehicleDataConsent" functionID="GetInteriorVehicleDataConsentID" messagetype="request" since="6.0">
- <param name="moduleType" type="ModuleType" mandatory="true">
- <description>The module type that the app requests to control.</description>
- </param>
- <param name="moduleIds" type="String" maxlength="100" array="true" mandatory="true">
- <description>Ids of a module of same type, published by System Capability. </description>
- </param>
- </function>
-
- <function name="GetInteriorVehicleDataConsent" functionID="GetInteriorVehicleDataConsentID" messagetype="response" since="6.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="USER_DISALLOWED"/>
- <element name="UNSUPPORTED_RESOURCE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false">
- </param>
- <param name="allowed" type="Boolean" array="true" mandatory="false">
- <description>
- This array has the same size as "moduleIds" in the request and each element corresponds to one moduleId
- If true, SDL grants the permission for the requested module
- If false, SDL denies the permission for the requested module.
- </description>
- </param>
- </function>
-
- <function name="ReleaseInteriorVehicleDataModule" functionID="ReleaseInteriorVehicleDataModuleID" messagetype="request" since="6.0">
- <param name="moduleType" type="ModuleType" mandatory="true">
- </param>
- <param name="moduleId" type="String" maxlength="100" mandatory="false" since="5.1">
- <description>Id of a module, published by System Capability. </description>
- </param>
- </function>
-
- <function name="ReleaseInteriorVehicleDataModule" functionID="ReleaseInteriorVehicleDataModuleID" messagetype="response" since="6.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_RESOURCE"/>
- </param>
- <param name="info" type="String" maxlength="1000" mandatory="false">
- </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="false">
- </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="false">
- </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>
-
- <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="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>
-
- <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="PublishAppService" functionID="PublishAppServiceID" messagetype="request" since="5.1">
- <description>
- Registers a service offered by this app on the module.
- Subsequent calls with the same service type will update the manifest for that service.
- </description>
-
- <param name="appServiceManifest" type="AppServiceManifest" mandatory="true">
- <description>
- The manifest of the service that wishes to be published.
- If already published, the updated manifest for this service.
- </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="UnpublishAppService" functionID="UnpublishAppServiceID" messagetype="request" since="6.0">
- <description> Unpublish an existing service published by this application. </description>
-
- <param name="serviceID" type="String" mandatory="true">
- <description> The ID of the service to be unpublished. </description>
- </param>
- </function>
-
- <function name="UnpublishAppService" functionID="UnpublishAppServiceID" messagetype="response" since="6.0">
- <description> The response to UnpublishAppService </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="INVALID_ID"/>
- <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="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>
-
- <function name="CancelInteraction" functionID="CancelInteractionID" messagetype="request" since="6.0">
- <description>
- Close an active interaction on the HMI.
- </description>
-
- <param name="cancelID" type="Integer" mandatory="false">
- <description>
- The ID of the specific interaction you want to dismiss. If not set, the most recent of the RPC type set in functionID will be dismissed.
- </description>
- </param>
-
- <param name="functionID" type="Integer" mandatory="true">
- <description>
- The ID of the type of interaction the developer wants to dismiss. Only values 10, (PerformInteractionID), 12 (AlertID), 25 (ScrollableMessageID), and 26 (SliderID) are permitted.
- </description>
- </param>
- </function>
-
- <function name="CancelInteraction" functionID="CancelInteractionID" messagetype="response" since="6.0">
- <description>
- If no applicable request can be dismissed, the result will be IGNORED.
- </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="IGNORED"/>
- <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="CloseApplication" functionID="CloseApplicationID" messagetype="request" since="6.0">
- <description>Request from the application to exit the foreground and enter HMI_NONE.</description>
- </function>
-
- <function name="CloseApplication" functionID="CloseApplicationID" messagetype="response" since="6.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="DISALLOWED"/>
- <element name="APPLICATION_NOT_REGISTERED"/>
- <element name="GENERIC_ERROR"/>
- <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>
-
- <!-- 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>
- <param name="windowID" type="Integer" mandatory="false" since="6.0">
- <description>
- This is the unique ID assigned to the window that this RPC is intended. If this param is not included, it will be assumed that this request is specifically for the main window on the main display. See PredefinedWindows enum.
- </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>
- <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>
-
-
- </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>
- <param name="lockScreenDismissalEnabled" type="Boolean" mandatory="false" since="6.0">
- <description>
- If enabled, the lock screen will be able to be dismissed while connected to SDL, allowing users
- the ability to interact with the app. Dismissals should include a warning to the user and ensure
- that they are not the driver.
- </description>
- </param>
- <param name="lockScreenDismissalWarning" type="String" mandatory="false" since="6.0">
- <description>
- Warning message to be displayed on the lock screen when dismissal is enabled.
- This warning should be used to ensure that the user is not the driver of the vehicle,
- ex. `Swipe down to dismiss, acknowledging that you are not the driver.`.
- This parameter must be present if "lockScreenDismissalEnabled" is set to true.
- </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>
- <param name="requireEncryption" type="Boolean" mandatory="false" since="6.0"/>
- </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> \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/ManagerUtilityTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/ManagerUtilityTests.java
new file mode 100644
index 000000000..0257be444
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/ManagerUtilityTests.java
@@ -0,0 +1,204 @@
+package com.smartdevicelink.managers;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import com.smartdevicelink.proxy.rpc.ImageField;
+import com.smartdevicelink.proxy.rpc.TextField;
+import com.smartdevicelink.proxy.rpc.WindowCapability;
+import com.smartdevicelink.proxy.rpc.enums.CharacterSet;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
+import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static junit.framework.TestCase.assertEquals;
+import static junit.framework.TestCase.assertFalse;
+import static junit.framework.TestCase.assertNotNull;
+import static junit.framework.TestCase.assertTrue;
+
+/**
+ * This is a unit test class for the SmartDeviceLink library manager class :
+ * {@link ManagerUtility}
+ */
+@RunWith(AndroidJUnit4.class)
+public class ManagerUtilityTests {
+
+
+ @Before
+ public void setUp() throws Exception{
+
+ }
+
+ // TESTS
+
+ @Test
+ public void testGetAllImageFields(){
+
+ List<ImageField> fields = ManagerUtility.WindowCapabilityUtility.getAllImageFields();
+ assertNotNull(fields);
+ int size = fields.size();
+ assertEquals(ImageFieldName.values().length, size);
+
+ ImageFieldName[] names = ImageFieldName.values();
+
+ boolean found;
+ for (ImageFieldName name : names) {
+ found = false;
+ for(ImageField field : fields) {
+ if(field != null
+ && field.getName() != null
+ && field.getName().equals(name)) {
+ found = true;
+ break;
+ }
+ }
+ assertTrue(found);
+ }
+
+ }
+
+ @Test
+ public void testGetAllTextFields(){
+
+ List<TextField> fields = ManagerUtility.WindowCapabilityUtility.getAllTextFields();
+ assertNotNull(fields);
+ int size = fields.size();
+ assertEquals(TextFieldName.values().length, size);
+
+ TextFieldName[] names = TextFieldName.values();
+
+ boolean found;
+ for (TextFieldName name : names) {
+ found = false;
+ for(TextField field : fields) {
+ if(field != null
+ && field.getName() != null
+ && field.getName().equals(name)) {
+ found = true;
+ break;
+ }
+ }
+ assertTrue(found);
+ }
+
+ }
+
+ @Test
+ public void testHasTextFieldOfName() {
+ WindowCapability capability = new WindowCapability();
+ List<TextField> textFieldList = new ArrayList<>();
+ textFieldList.add(new TextField(TextFieldName.mainField1, CharacterSet.UTF_8, 500, 8));
+ capability.setTextFields(textFieldList);
+
+ assertTrue(ManagerUtility.WindowCapabilityUtility.hasTextFieldOfName(capability, TextFieldName.mainField1));
+ assertFalse(ManagerUtility.WindowCapabilityUtility.hasTextFieldOfName(capability, TextFieldName.alertText3));
+
+ textFieldList.add(new TextField(TextFieldName.alertText3, CharacterSet.UTF_8, 500, 8));
+ capability.setTextFields(textFieldList);
+ assertTrue(ManagerUtility.WindowCapabilityUtility.hasTextFieldOfName(capability, TextFieldName.mainField1));
+ assertTrue(ManagerUtility.WindowCapabilityUtility.hasTextFieldOfName(capability, TextFieldName.alertText3));
+
+ textFieldList.clear();
+ textFieldList.add(null);
+ capability.setTextFields(textFieldList);
+ assertFalse(ManagerUtility.WindowCapabilityUtility.hasTextFieldOfName(capability, TextFieldName.mainField1));
+ assertFalse(ManagerUtility.WindowCapabilityUtility.hasTextFieldOfName(capability, TextFieldName.alertText3));
+
+ textFieldList.add(new TextField(TextFieldName.alertText3, CharacterSet.UTF_8, 500, 8));
+ capability.setTextFields(textFieldList);
+ assertFalse(ManagerUtility.WindowCapabilityUtility.hasTextFieldOfName(capability, TextFieldName.mainField1));
+ assertTrue(ManagerUtility.WindowCapabilityUtility.hasTextFieldOfName(capability, TextFieldName.alertText3));
+
+ }
+
+ @Test
+ public void testHasImageFieldOfName() {
+
+ WindowCapability capability = new WindowCapability();
+ List<FileType> allImageFileTypes = Arrays.asList(FileType.GRAPHIC_BMP, FileType.GRAPHIC_JPEG, FileType.GRAPHIC_PNG);
+
+ List<ImageField> imageFieldList = new ArrayList<>();
+ imageFieldList.add(new ImageField(ImageFieldName.graphic, allImageFileTypes));
+ capability.setImageFields(imageFieldList);
+
+ assertTrue(ManagerUtility.WindowCapabilityUtility.hasImageFieldOfName(capability, ImageFieldName.graphic));
+ assertFalse(ManagerUtility.WindowCapabilityUtility.hasImageFieldOfName(capability, ImageFieldName.alertIcon));
+
+ imageFieldList.add(new ImageField(ImageFieldName.alertIcon, allImageFileTypes));
+ capability.setImageFields(imageFieldList);
+ assertTrue(ManagerUtility.WindowCapabilityUtility.hasImageFieldOfName(capability, ImageFieldName.graphic));
+ assertTrue(ManagerUtility.WindowCapabilityUtility.hasImageFieldOfName(capability, ImageFieldName.alertIcon));;
+
+ imageFieldList.clear();
+ imageFieldList.add(null);
+ capability.setImageFields(imageFieldList);
+ assertFalse(ManagerUtility.WindowCapabilityUtility.hasImageFieldOfName(capability, ImageFieldName.graphic));
+ assertFalse(ManagerUtility.WindowCapabilityUtility.hasImageFieldOfName(capability, ImageFieldName.alertIcon));
+
+ imageFieldList.add(new ImageField(ImageFieldName.alertIcon, allImageFileTypes));
+ capability.setImageFields(imageFieldList);
+ assertFalse(ManagerUtility.WindowCapabilityUtility.hasImageFieldOfName(capability, ImageFieldName.graphic));
+ assertTrue(ManagerUtility.WindowCapabilityUtility.hasImageFieldOfName(capability, ImageFieldName.alertIcon));
+
+ }
+
+
+ @Test
+ public void testGetMaxNumberOfMainFieldLines() {
+
+ WindowCapability capability = new WindowCapability();
+ capability.setTextFields(ManagerUtility.WindowCapabilityUtility.getAllTextFields());
+
+ int maxNumerOfLines = ManagerUtility.WindowCapabilityUtility.getMaxNumberOfMainFieldLines(capability);
+
+ assertEquals(4, maxNumerOfLines);
+
+ //Single line
+ List<TextField> singleLineList = new ArrayList<>();
+ singleLineList.add(new TextField(TextFieldName.mainField1, CharacterSet.UTF_8, 500, 8));
+ capability.setTextFields(singleLineList);
+ maxNumerOfLines = ManagerUtility.WindowCapabilityUtility.getMaxNumberOfMainFieldLines(capability);
+ assertEquals(1, maxNumerOfLines);
+
+ singleLineList.add(new TextField(TextFieldName.mainField2, CharacterSet.UTF_8, 500, 8));
+ capability.setTextFields(singleLineList);
+ maxNumerOfLines = ManagerUtility.WindowCapabilityUtility.getMaxNumberOfMainFieldLines(capability);
+ assertEquals(2, maxNumerOfLines);
+
+ singleLineList.add(new TextField(TextFieldName.mainField3, CharacterSet.UTF_8, 500, 8));
+ capability.setTextFields(singleLineList);
+ maxNumerOfLines = ManagerUtility.WindowCapabilityUtility.getMaxNumberOfMainFieldLines(capability);
+ assertEquals(3, maxNumerOfLines);
+
+ singleLineList.add(new TextField(TextFieldName.mainField4, CharacterSet.UTF_8, 500, 8));
+ capability.setTextFields(singleLineList);
+ maxNumerOfLines = ManagerUtility.WindowCapabilityUtility.getMaxNumberOfMainFieldLines(capability);
+ assertEquals(4, maxNumerOfLines);
+
+ List<TextField> nullList = new ArrayList<>();
+ nullList.add(null);
+ assertNotNull(nullList);
+ capability.setTextFields(nullList);
+ assertNotNull(capability);
+ assertNotNull(capability.getTextFields());
+
+ maxNumerOfLines = ManagerUtility.WindowCapabilityUtility.getMaxNumberOfMainFieldLines(capability);
+ assertEquals(0, maxNumerOfLines);
+
+ nullList.add(new TextField(TextFieldName.mainField4, CharacterSet.UTF_8, 500, 8));
+ assertNotNull(nullList);
+ capability.setTextFields(nullList);
+ assertNotNull(capability);
+ assertNotNull(capability.getTextFields());
+ maxNumerOfLines = ManagerUtility.WindowCapabilityUtility.getMaxNumberOfMainFieldLines(capability);
+ assertEquals(4, maxNumerOfLines);
+
+ }
+}
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
index b33c4f494..760a8e40d 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java
@@ -1,6 +1,7 @@
package com.smartdevicelink.managers;
import android.content.Context;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.livio.taskmaster.Taskmaster;
@@ -10,7 +11,6 @@ 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.interfaces.ISdl;
import com.smartdevicelink.proxy.rpc.GetAppServiceDataResponse;
import com.smartdevicelink.proxy.rpc.GetVehicleData;
import com.smartdevicelink.proxy.rpc.OnAppServiceData;
@@ -18,7 +18,6 @@ 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.TestValues;
@@ -112,11 +111,6 @@ public class SdlManagerTests {
}
@Override
- public LifecycleConfigurationUpdate managerShouldUpdateLifecycle(Language language) {
- return null;
- }
-
- @Override
public LifecycleConfigurationUpdate managerShouldUpdateLifecycle(Language language, Language hmiLanguage) {
return null;
}
@@ -222,7 +216,7 @@ public class SdlManagerTests {
sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
- sdlManager.getLockScreenConfig().setEnabled(true);
+ sdlManager.getLockScreenConfig().setDisplayMode(LockScreenConfig.DISPLAY_MODE_ALWAYS);
sdlManager.getLockScreenManager().transitionToState(BaseSubManager.READY);
sdlManager.checkState();
assertEquals(BaseSubManager.READY, sdlManager.getState());
@@ -232,7 +226,7 @@ public class SdlManagerTests {
sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
- sdlManager.getLockScreenConfig().setEnabled(false);
+ sdlManager.getLockScreenConfig().setDisplayMode(LockScreenConfig.DISPLAY_MODE_NEVER);
sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
sdlManager.checkState();
assertEquals(BaseSubManager.READY, sdlManager.getState());
@@ -242,7 +236,7 @@ public class SdlManagerTests {
sdlManager.getPermissionManager().transitionToState(BaseSubManager.ERROR);
sdlManager.getFileManager().transitionToState(BaseSubManager.ERROR);
sdlManager.getScreenManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getLockScreenConfig().setEnabled(true);
+ sdlManager.getLockScreenConfig().setDisplayMode(LockScreenConfig.DISPLAY_MODE_ALWAYS);
sdlManager.getLockScreenManager().transitionToState(BaseSubManager.ERROR);
sdlManager.checkState();
assertEquals(BaseSubManager.ERROR, sdlManager.getState());
@@ -252,7 +246,7 @@ public class SdlManagerTests {
sdlManager.getPermissionManager().transitionToState(BaseSubManager.ERROR);
sdlManager.getFileManager().transitionToState(BaseSubManager.ERROR);
sdlManager.getScreenManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getLockScreenConfig().setEnabled(false);
+ sdlManager.getLockScreenConfig().setDisplayMode(LockScreenConfig.DISPLAY_MODE_NEVER);
sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
sdlManager.checkState();
assertEquals(BaseSubManager.ERROR, sdlManager.getState());
@@ -262,7 +256,7 @@ public class SdlManagerTests {
sdlManager.getPermissionManager().transitionToState(BaseSubManager.ERROR);
sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
sdlManager.getScreenManager().transitionToState(BaseSubManager.SETTING_UP);
- sdlManager.getLockScreenConfig().setEnabled(true);
+ sdlManager.getLockScreenConfig().setDisplayMode(LockScreenConfig.DISPLAY_MODE_ALWAYS);
sdlManager.getLockScreenManager().transitionToState(BaseSubManager.LIMITED);
sdlManager.checkState();
assertEquals(BaseSubManager.SETTING_UP, sdlManager.getState());
@@ -272,7 +266,7 @@ public class SdlManagerTests {
sdlManager.getPermissionManager().transitionToState(BaseSubManager.ERROR);
sdlManager.getFileManager().transitionToState(BaseSubManager.READY);
sdlManager.getScreenManager().transitionToState(BaseSubManager.SETTING_UP);
- sdlManager.getLockScreenConfig().setEnabled(false);
+ sdlManager.getLockScreenConfig().setDisplayMode(LockScreenConfig.DISPLAY_MODE_NEVER);
sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
sdlManager.checkState();
assertEquals(BaseSubManager.SETTING_UP, sdlManager.getState());
@@ -282,7 +276,7 @@ public class SdlManagerTests {
sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
sdlManager.getFileManager().transitionToState(BaseSubManager.ERROR);
sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
- sdlManager.getLockScreenConfig().setEnabled(true);
+ sdlManager.getLockScreenConfig().setDisplayMode(LockScreenConfig.DISPLAY_MODE_ALWAYS);
sdlManager.getLockScreenManager().transitionToState(BaseSubManager.READY);
sdlManager.checkState();
assertEquals(BaseSubManager.LIMITED, sdlManager.getState());
@@ -292,7 +286,7 @@ public class SdlManagerTests {
sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
sdlManager.getFileManager().transitionToState(BaseSubManager.ERROR);
sdlManager.getScreenManager().transitionToState(BaseSubManager.READY);
- sdlManager.getLockScreenConfig().setEnabled(false);
+ sdlManager.getLockScreenConfig().setDisplayMode(LockScreenConfig.DISPLAY_MODE_NEVER);
sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
sdlManager.checkState();
assertEquals(BaseSubManager.LIMITED, sdlManager.getState());
@@ -302,7 +296,7 @@ public class SdlManagerTests {
sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
sdlManager.getFileManager().transitionToState(BaseSubManager.LIMITED);
sdlManager.getScreenManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getLockScreenConfig().setEnabled(true);
+ sdlManager.getLockScreenConfig().setDisplayMode(LockScreenConfig.DISPLAY_MODE_ALWAYS);
sdlManager.getLockScreenManager().transitionToState(BaseSubManager.READY);
sdlManager.checkState();
assertEquals(BaseSubManager.LIMITED, sdlManager.getState());
@@ -312,7 +306,7 @@ public class SdlManagerTests {
sdlManager.getPermissionManager().transitionToState(BaseSubManager.READY);
sdlManager.getFileManager().transitionToState(BaseSubManager.LIMITED);
sdlManager.getScreenManager().transitionToState(BaseSubManager.ERROR);
- sdlManager.getLockScreenConfig().setEnabled(false);
+ sdlManager.getLockScreenConfig().setDisplayMode(LockScreenConfig.DISPLAY_MODE_NEVER);
sdlManager.getLockScreenManager().transitionToState(BaseSubManager.SETTING_UP);
sdlManager.checkState();
assertEquals(BaseSubManager.LIMITED, sdlManager.getState());
@@ -404,10 +398,6 @@ public class SdlManagerTests {
}
@Override
- public void onError(int correlationId, Result resultCode, String info) {
- }
-
- @Override
public void onResponse(int correlationId, RPCResponse response) {
}
};
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
index 3fd5cd943..cf6735ab6 100644
--- 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
@@ -5,16 +5,19 @@ import android.media.AudioFormat;
import android.media.MediaFormat;
import android.media.MediaPlayer;
import android.os.Build;
-import androidx.test.platform.app.InstrumentationRegistry;
import android.util.Log;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import androidx.test.platform.app.InstrumentationRegistry;
+
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.managers.CompletionListener;
import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
+import com.smartdevicelink.managers.lifecycle.OnSystemCapabilityListener;
+import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
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.streaming.audio.IAudioStreamListener;
+import com.smartdevicelink.managers.ISdl;
+import com.smartdevicelink.protocol.ISdlServiceListener;
import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
import com.smartdevicelink.proxy.rpc.enums.AudioType;
import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;
@@ -38,7 +41,9 @@ import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
@@ -64,9 +69,11 @@ public class AudioStreamManagerTest extends TestCase {
public void testCreatingAudioStreamManager() {
ISdl internalInterface = mock(ISdl.class);
+ SystemCapabilityManager systemCapabilityManager = mock(SystemCapabilityManager.class);
+ doReturn(systemCapabilityManager).when(internalInterface).getSystemCapabilityManager();
AudioPassThruCapabilities audioCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
doReturn(true).when(internalInterface).isConnected();
- doReturn(audioCapabilities).when(internalInterface).getCapability(SystemCapabilityType.PCM_STREAMING);
+ doReturn(audioCapabilities).when(systemCapabilityManager).getCapability(eq(SystemCapabilityType.PCM_STREAMING), (OnSystemCapabilityListener) isNull(), anyBoolean());
new AudioStreamManager(internalInterface, mContext);
}
@@ -93,10 +100,6 @@ public class AudioStreamManagerTest extends TestCase {
Boolean encrypted = (Boolean) args[0];
serviceListener.onServiceStarted(mockSession, SessionType.PCM, encrypted);
break;
- case "stopAudioService":
- // parameters ()
- serviceListener.onServiceEnded(mockSession, SessionType.PCM);
- break;
}
return null;
@@ -104,12 +107,13 @@ public class AudioStreamManagerTest extends TestCase {
};
ISdl internalInterface = mock(ISdl.class);
+ SystemCapabilityManager systemCapabilityManager = mock(SystemCapabilityManager.class);
+ doReturn(systemCapabilityManager).when(internalInterface).getSystemCapabilityManager();
AudioPassThruCapabilities audioCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
doReturn(true).when(internalInterface).isConnected();
- doReturn(audioCapabilities).when(internalInterface).getCapability(SystemCapabilityType.PCM_STREAMING);
+ doReturn(audioCapabilities).when(systemCapabilityManager).getCapability(eq(SystemCapabilityType.PCM_STREAMING), (OnSystemCapabilityListener) isNull(), anyBoolean());
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
@@ -228,7 +232,7 @@ public class AudioStreamManagerTest extends TestCase {
testFullAudioManagerDecodeFlowCorrectCounter = 0;
testFullAudioManagerDecodeFlowWrongCounter = 0;
- IAudioStreamListener audioStreamListener = new IAudioStreamListener() {
+ final 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);
@@ -236,11 +240,6 @@ public class AudioStreamManagerTest extends TestCase {
}
@Override
- public void sendAudio(ByteBuffer data, long presentationTimeUs) {
- sendAudio(data, presentationTimeUs, null);
- }
-
- @Override
public void sendAudio(ByteBuffer data, long presentationTimeUs, CompletionListener listener) {
SampleBuffer samples = SampleBuffer.wrap(data, sampleType, presentationTimeUs);
double timeUs = presentationTimeUs;
@@ -270,7 +269,6 @@ public class AudioStreamManagerTest extends TestCase {
};
final SdlSession mockSession = mock(SdlSession.class);
- doReturn(audioStreamListener).when(mockSession).startAudioStream();
Answer<Void> audioServiceAnswer = new Answer<Void>() {
ISdlServiceListener serviceListener = null;
@@ -292,10 +290,6 @@ public class AudioStreamManagerTest extends TestCase {
Boolean encrypted = (Boolean) args[0];
serviceListener.onServiceStarted(mockSession, SessionType.PCM, encrypted);
break;
- case "stopAudioService":
- // parameters ()
- serviceListener.onServiceEnded(mockSession, SessionType.PCM);
- break;
}
return null;
@@ -303,11 +297,12 @@ public class AudioStreamManagerTest extends TestCase {
};
ISdl internalInterface = mock(ISdl.class);
+ SystemCapabilityManager systemCapabilityManager = mock(SystemCapabilityManager.class);
+ doReturn(systemCapabilityManager).when(internalInterface).getSystemCapabilityManager();
doReturn(true).when(internalInterface).isConnected();
- doReturn(audioCapabilities).when(internalInterface).getCapability(any(SystemCapabilityType.class));
+ doReturn(audioCapabilities).when(systemCapabilityManager).getCapability(any(SystemCapabilityType.class), (OnSystemCapabilityListener) isNull(), anyBoolean());
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
@@ -325,7 +320,12 @@ public class AudioStreamManagerTest extends TestCase {
final CompletionListener mockFileListener = spy(fileCompletionListener);
- final AudioStreamManager manager = new AudioStreamManager(internalInterface, mContext);
+ final AudioStreamManager manager = new AudioStreamManager(internalInterface, mContext) {
+ @Override
+ public IAudioStreamListener startAudioStream(SdlSession session) {
+ return audioStreamListener;
+ }
+ };
manager.startAudioStream(false, new CompletionListener() {
@Override
public void onComplete(boolean success) {
@@ -483,11 +483,6 @@ public class AudioStreamManagerTest extends TestCase {
}
@Override
- public void sendAudio(ByteBuffer data, long presentationTimeUs) {
- sendAudio(data, presentationTimeUs, null);
- }
-
- @Override
public void sendAudio(ByteBuffer data, long presentationTimeUs, CompletionListener listener) {
try {
long length = data.limit();
@@ -504,7 +499,6 @@ public class AudioStreamManagerTest extends TestCase {
};
final SdlSession mockSession = mock(SdlSession.class);
- doReturn(audioStreamListener).when(mockSession).startAudioStream();
Answer<Void> audioServiceAnswer = new Answer<Void>() {
ISdlServiceListener serviceListener = null;
@@ -526,10 +520,6 @@ public class AudioStreamManagerTest extends TestCase {
Boolean encrypted = (Boolean) args[0];
serviceListener.onServiceStarted(mockSession, SessionType.PCM, encrypted);
break;
- case "stopAudioService":
- // parameters ()
- serviceListener.onServiceEnded(mockSession, SessionType.PCM);
- break;
}
return null;
@@ -537,11 +527,12 @@ public class AudioStreamManagerTest extends TestCase {
};
ISdl internalInterface = mock(ISdl.class);
+ SystemCapabilityManager systemCapabilityManager = mock(SystemCapabilityManager.class);
+ doReturn(systemCapabilityManager).when(internalInterface).getSystemCapabilityManager();
doReturn(true).when(internalInterface).isConnected();
- doReturn(audioCapabilities).when(internalInterface).getCapability(any(SystemCapabilityType.class));
+ doReturn(audioCapabilities).when(systemCapabilityManager).getCapability(any(SystemCapabilityType.class), (OnSystemCapabilityListener) isNull(), anyBoolean());
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();
@@ -583,14 +574,11 @@ public class AudioStreamManagerTest extends TestCase {
public void testPlayRawAudio() {
AudioPassThruCapabilities audioCapabilities = new AudioPassThruCapabilities(SamplingRate._16KHZ, BitsPerSample._16_BIT, AudioType.PCM);
- IAudioStreamListener audioStreamListener = mock(IAudioStreamListener.class);
-
+ final IAudioStreamListener audioStreamListener = mock(IAudioStreamListener.class);
final CompletionListener completionListener = mock(CompletionListener.class);
final SdlSession mockSession = mock(SdlSession.class);
- doReturn(audioStreamListener).when(mockSession).startAudioStream();
-
Answer<Void> audioServiceAnswer = new Answer<Void>() {
ISdlServiceListener serviceListener = null;
@@ -618,12 +606,20 @@ public class AudioStreamManagerTest extends TestCase {
};
ISdl internalInterface = mock(ISdl.class);
+ SystemCapabilityManager systemCapabilityManager = mock(SystemCapabilityManager.class);
+ doReturn(systemCapabilityManager).when(internalInterface).getSystemCapabilityManager();
doReturn(true).when(internalInterface).isConnected();
- doReturn(audioCapabilities).when(internalInterface).getCapability(any(SystemCapabilityType.class));
+ doReturn(audioCapabilities).when(systemCapabilityManager).getCapability(any(SystemCapabilityType.class), (OnSystemCapabilityListener) isNull(), anyBoolean());
doAnswer(audioServiceAnswer).when(internalInterface).addServiceListener(any(SessionType.class), any(ISdlServiceListener.class));
doAnswer(audioServiceAnswer).when(internalInterface).startAudioService(any(Boolean.class));
- final AudioStreamManager manager = new AudioStreamManager(internalInterface, mContext);
+ final AudioStreamManager manager = new AudioStreamManager(internalInterface, mContext) {
+ @Override
+ public IAudioStreamListener startAudioStream(SdlSession session) {
+ return audioStreamListener;
+ }
+ };
+
manager.startAudioStream(false, new CompletionListener() {
@Override
public void onComplete(boolean success) {
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
index dccd7c10b..a99214774 100644
--- 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
@@ -2,6 +2,7 @@ package com.smartdevicelink.managers.file;
import android.content.Context;
import android.net.Uri;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.smartdevicelink.managers.BaseSubManager;
@@ -10,7 +11,7 @@ import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
import com.smartdevicelink.managers.file.filetypes.SdlFile;
import com.smartdevicelink.proxy.RPCMessage;
import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.DeleteFile;
import com.smartdevicelink.proxy.rpc.DeleteFileResponse;
import com.smartdevicelink.proxy.rpc.ListFiles;
@@ -72,10 +73,9 @@ public class FileManagerTests {
RPCRequest message = (RPCRequest) args[0];
if (message instanceof PutFile) {
int correlationId = message.getCorrelationID();
- Result resultCode = Result.REJECTED;
- PutFileResponse putFileResponse = new PutFileResponse();
- putFileResponse.setSuccess(false);
- message.getOnRPCResponseListener().onError(correlationId, resultCode, "Binary data empty");
+ PutFileResponse putFileResponse = new PutFileResponse(false, Result.REJECTED);
+ putFileResponse.setInfo("Binary data empty");
+ message.getOnRPCResponseListener().onResponse(correlationId, putFileResponse);
}
return null;
}
@@ -88,13 +88,12 @@ public class FileManagerTests {
List<RPCRequest> rpcs = (List<RPCRequest>) args[0];
OnMultipleRequestListener listener = (OnMultipleRequestListener) args[1];
if (rpcs.get(0) instanceof PutFile) {
- Result resultCode = Result.REJECTED;
for (RPCRequest message : rpcs) {
int correlationId = message.getCorrelationID();
listener.addCorrelationId(correlationId);
- PutFileResponse putFileResponse = new PutFileResponse();
- putFileResponse.setSuccess(true);
- listener.onError(correlationId, resultCode, "Binary data empty");
+ PutFileResponse putFileResponse = new PutFileResponse(false, Result.REJECTED);
+ putFileResponse.setInfo("Binary data empty");
+ listener.onResponse(correlationId, putFileResponse);
}
listener.onFinished();
}
@@ -197,13 +196,12 @@ public class FileManagerTests {
List<RPCRequest> rpcs = (List<RPCRequest>) args[0];
OnMultipleRequestListener listener = (OnMultipleRequestListener) args[1];
if (rpcs.get(0) instanceof DeleteFile) {
- Result resultCode = Result.REJECTED;
for (RPCRequest message : rpcs) {
int correlationId = message.getCorrelationID();
listener.addCorrelationId(correlationId);
- DeleteFileResponse deleteFileResponse = new DeleteFileResponse();
- deleteFileResponse.setSuccess(true);
- listener.onError(correlationId, resultCode, "Binary data empty");
+ DeleteFileResponse deleteFileResponse = new DeleteFileResponse(false, Result.REJECTED);
+ deleteFileResponse.setInfo("Binary data empty");
+ listener.onResponse(correlationId, deleteFileResponse);
}
listener.onFinished();
}
@@ -218,7 +216,6 @@ public class FileManagerTests {
List<RPCRequest> rpcs = (List<RPCRequest>) args[0];
OnMultipleRequestListener listener = (OnMultipleRequestListener) args[1];
if (rpcs.get(0) instanceof PutFile) {
- Result resultCode = Result.REJECTED;
boolean flip = false;
for (RPCRequest message : rpcs) {
int correlationId = message.getCorrelationID();
@@ -231,7 +228,9 @@ public class FileManagerTests {
} else {
flip = true;
putFileResponse.setSuccess(false);
- listener.onError(correlationId, resultCode, "Binary data empty");
+ putFileResponse.setResultCode(Result.REJECTED);
+ putFileResponse.setInfo("Binary data empty");
+ listener.onResponse(correlationId, putFileResponse);
}
}
listener.onFinished();
@@ -250,7 +249,7 @@ public class FileManagerTests {
final ISdl internalInterface = mock(ISdl.class);
doAnswer(onListFilesSuccess).when(internalInterface).sendRPC(any(ListFiles.class));
- doAnswer(onListDeleteRequestSuccess).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ doAnswer(onListDeleteRequestSuccess).when(internalInterface).sendRPCs(any(List.class), any(OnMultipleRequestListener.class));
final List<String> fileNames = new ArrayList<>();
fileNames.add("Julian");
@@ -282,7 +281,7 @@ public class FileManagerTests {
final ISdl internalInterface = mock(ISdl.class);
doAnswer(onListFilesSuccess).when(internalInterface).sendRPC(any(ListFiles.class));
- doAnswer(onListDeleteRequestFail).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ doAnswer(onListDeleteRequestFail).when(internalInterface).sendRPCs(any(List.class), any(OnMultipleRequestListener.class));
final List<String> fileNames = new ArrayList<>();
fileNames.add("Julian");
@@ -405,7 +404,7 @@ public class FileManagerTests {
final ISdl internalInterface = mock(ISdl.class);
doAnswer(onListFilesSuccess).when(internalInterface).sendRPC(any(ListFiles.class));
- doAnswer(onSendRequestsFailOnError).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ doAnswer(onSendRequestsFailOnError).when(internalInterface).sendRPCs(any(List.class), any(OnMultipleRequestListener.class));
SdlFile validFile2 = new SdlFile();
validFile2.setName(TestValues.GENERAL_STRING + "2");
@@ -436,7 +435,7 @@ public class FileManagerTests {
}
});
- verify(internalInterface, times(5)).sendRequests(any(List.class),any(OnMultipleRequestListener.class));
+ verify(internalInterface, times(5)).sendRPCs(any(List.class),any(OnMultipleRequestListener.class));
}
/**
@@ -554,7 +553,7 @@ public class FileManagerTests {
ISdl internalInterface = mock(ISdl.class);
doAnswer(onListFilesSuccess).when(internalInterface).sendRPC(any(ListFiles.class));
- doAnswer(onListFileUploadSuccess).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ doAnswer(onListFileUploadSuccess).when(internalInterface).sendRPCs(any(List.class), any(OnMultipleRequestListener.class));
FileManagerConfig fileManagerConfig = new FileManagerConfig();
final FileManager fileManager = new FileManager(internalInterface, mTestContext, fileManagerConfig);
@@ -575,7 +574,7 @@ public class FileManagerTests {
});
}
});
- verify(internalInterface, times(0)).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ verify(internalInterface, times(0)).sendRPCs(any(List.class), any(OnMultipleRequestListener.class));
}
/**
@@ -586,7 +585,7 @@ public class FileManagerTests {
ISdl internalInterface = mock(ISdl.class);
doAnswer(onListFilesSuccess).when(internalInterface).sendRPC(any(ListFiles.class));
- doAnswer(onListFileUploadSuccess).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ doAnswer(onListFileUploadSuccess).when(internalInterface).sendRPCs(any(List.class), any(OnMultipleRequestListener.class));
FileManagerConfig fileManagerConfig = new FileManagerConfig();
final FileManager fileManager = new FileManager(internalInterface, mTestContext, fileManagerConfig);
@@ -608,7 +607,7 @@ public class FileManagerTests {
});
}
});
- verify(internalInterface, times(1)).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ verify(internalInterface, times(1)).sendRPCs(any(List.class), any(OnMultipleRequestListener.class));
}
/**
@@ -704,7 +703,7 @@ public class FileManagerTests {
ISdl internalInterface = mock(ISdl.class);
doAnswer(onListFilesSuccess).when(internalInterface).sendRPC(any(ListFiles.class));
- doAnswer(onListFileUploadSuccess).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ doAnswer(onListFileUploadSuccess).when(internalInterface).sendRPCs(any(List.class), any(OnMultipleRequestListener.class));
FileManagerConfig fileManagerConfig = new FileManagerConfig();
@@ -741,7 +740,7 @@ public class FileManagerTests {
ISdl internalInterface = mock(ISdl.class);
doAnswer(onListFilesSuccess).when(internalInterface).sendRPC(any(ListFiles.class));
- doAnswer(onSendRequestsFailPartialOnError).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ doAnswer(onSendRequestsFailPartialOnError).when(internalInterface).sendRPCs(any(List.class), any(OnMultipleRequestListener.class));
SdlFile validFile2 = new SdlFile();
validFile2.setName(TestValues.GENERAL_STRING + "2");
@@ -790,7 +789,7 @@ public class FileManagerTests {
ISdl internalInterface = mock(ISdl.class);
doAnswer(onListFilesSuccess).when(internalInterface).sendRPC(any(ListFiles.class));
- doAnswer(onListFileUploadSuccess).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ doAnswer(onListFileUploadSuccess).when(internalInterface).sendRPCs(any(List.class), any(OnMultipleRequestListener.class));
FileManagerConfig fileManagerConfig = new FileManagerConfig();
final FileManager fileManager = new FileManager(internalInterface, mTestContext, fileManagerConfig);
@@ -910,7 +909,7 @@ public class FileManagerTests {
final ISdl internalInterface = mock(ISdl.class);
doAnswer(onListFilesSuccess).when(internalInterface).sendRPC(any(ListFiles.class));
- doAnswer(onListFileUploadSuccess).when(internalInterface).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ doAnswer(onListFileUploadSuccess).when(internalInterface).sendRPCs(any(List.class), any(OnMultipleRequestListener.class));
final SdlFile validFile2 = new SdlFile();
validFile2.setName(TestValues.GENERAL_STRING + "2");
@@ -946,7 +945,7 @@ public class FileManagerTests {
}
});
- verify(internalInterface, times(1)).sendRequests(any(List.class), any(OnMultipleRequestListener.class));
+ verify(internalInterface, times(1)).sendRPCs(any(List.class), any(OnMultipleRequestListener.class));
}
/**
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java
index 5c59f20d7..3f6f6cff5 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/filetypes/SdlArtworkTests.java
@@ -1,8 +1,7 @@
-package com.smartdevicelink.managers.file;
+package com.smartdevicelink.managers.file.filetypes;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
import com.smartdevicelink.proxy.rpc.enums.StaticIconName;
import com.smartdevicelink.test.TestValues;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java
index f96ac72a8..c50e8b1ae 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java
@@ -10,11 +10,8 @@ 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.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.managers.ISdl;
+import com.smartdevicelink.protocol.ISdlServiceListener;
import com.smartdevicelink.proxy.rpc.AppServiceCapability;
import com.smartdevicelink.proxy.rpc.AppServicesCapabilities;
import com.smartdevicelink.proxy.rpc.AudioPassThruCapabilities;
@@ -55,8 +52,6 @@ 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.test.TestValues;
import com.smartdevicelink.test.Validator;
@@ -185,25 +180,25 @@ public class SystemCapabilityManagerTests {
List<DisplayCapability> displayCapabilityList = createDisplayCapabilityList(TestValues.GENERAL_DISPLAYCAPABILITIES, TestValues.GENERAL_BUTTONCAPABILITIES_LIST, TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST);
assertTrue(TestValues.TRUE,
- Validator.validateDisplayCapabilityList(displayCapabilityList, (List<DisplayCapability>) systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAYS)));
+ Validator.validateDisplayCapabilityList(displayCapabilityList, (List<DisplayCapability>) systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAYS, null, false)));
assertTrue(TestValues.TRUE,
- Validator.validateHMICapabilities(TestValues.GENERAL_HMICAPABILITIES, (HMICapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.HMI)));
+ Validator.validateHMICapabilities(TestValues.GENERAL_HMICAPABILITIES, (HMICapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.HMI, null, false)));
assertTrue(TestValues.TRUE,
- Validator.validateDisplayCapabilities(TestValues.GENERAL_DISPLAYCAPABILITIES, (DisplayCapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY)));
+ Validator.validateDisplayCapabilities(TestValues.GENERAL_DISPLAYCAPABILITIES, (DisplayCapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY, null, false)));
assertTrue(TestValues.TRUE,
- Validator.validateAudioPassThruCapabilities(TestValues.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST, (List<AudioPassThruCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.AUDIO_PASSTHROUGH)));
+ Validator.validateAudioPassThruCapabilities(TestValues.GENERAL_AUDIOPASSTHRUCAPABILITIES_LIST, (List<AudioPassThruCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.AUDIO_PASSTHROUGH, null, false)));
assertTrue(TestValues.TRUE,
- Validator.validateButtonCapabilities(TestValues.GENERAL_BUTTONCAPABILITIES_LIST, (List<ButtonCapabilities> )systemCapabilityManager.getCapability(SystemCapabilityType.BUTTON)));
+ Validator.validateButtonCapabilities(TestValues.GENERAL_BUTTONCAPABILITIES_LIST, (List<ButtonCapabilities> )systemCapabilityManager.getCapability(SystemCapabilityType.BUTTON, null, false)));
assertTrue(TestValues.TRUE,
- Validator.validateHMIZoneCapabilities(TestValues.GENERAL_HMIZONECAPABILITIES_LIST, (List<HmiZoneCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.HMI_ZONE)));
+ Validator.validateHMIZoneCapabilities(TestValues.GENERAL_HMIZONECAPABILITIES_LIST, (List<HmiZoneCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.HMI_ZONE, null, false)));
assertTrue(TestValues.TRUE,
- Validator.validatePresetBankCapabilities(TestValues.GENERAL_PRESETBANKCAPABILITIES, (PresetBankCapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.PRESET_BANK)));
+ Validator.validatePresetBankCapabilities(TestValues.GENERAL_PRESETBANKCAPABILITIES, (PresetBankCapabilities) systemCapabilityManager.getCapability(SystemCapabilityType.PRESET_BANK, null, false)));
assertTrue(TestValues.TRUE,
- Validator.validateSoftButtonCapabilities(TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST, (List<SoftButtonCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON)));
+ Validator.validateSoftButtonCapabilities(TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST, (List<SoftButtonCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON, null, false)));
assertTrue(TestValues.TRUE,
- Validator.validateSpeechCapabilities(TestValues.GENERAL_SPEECHCAPABILITIES_LIST, (List<SpeechCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.SPEECH)));
+ Validator.validateSpeechCapabilities(TestValues.GENERAL_SPEECHCAPABILITIES_LIST, (List<SpeechCapabilities>) systemCapabilityManager.getCapability(SystemCapabilityType.SPEECH, null, false)));
assertTrue(TestValues.TRUE,
- Validator.validatePreRecordedSpeechCapabilities(TestValues.GENERAL_PRERECORDEDSPEECH_LIST, (List<PrerecordedSpeech>) systemCapabilityManager.getCapability(SystemCapabilityType.PRERECORDED_SPEECH)));
+ Validator.validatePreRecordedSpeechCapabilities(TestValues.GENERAL_PRERECORDEDSPEECH_LIST, (List<PrerecordedSpeech>) systemCapabilityManager.getCapability(SystemCapabilityType.PRERECORDED_SPEECH, null, false)));
}
@@ -259,7 +254,7 @@ public class SystemCapabilityManagerTests {
public void onError(String info) {
assertTrue(false);
}
- });
+ }, false);
}
private Answer<Void> createOnHMIStatusAnswer(final HMILevel hmiLevel){
@@ -690,7 +685,7 @@ public class SystemCapabilityManagerTests {
@Test
public void testListConversion(){
SystemCapabilityManager systemCapabilityManager = createSampleManager();
- Object capability = systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON);
+ Object capability = systemCapabilityManager.getCapability(SystemCapabilityType.SOFTBUTTON, null, false);
assertNotNull(capability);
List<SoftButtonCapabilities> list = SystemCapabilityManager.convertToList(capability, SoftButtonCapabilities.class);
assertNotNull(list);
@@ -710,7 +705,7 @@ public class SystemCapabilityManagerTests {
OnRPCListener scmRpcListener = iSDL.rpcListeners.get(FunctionID.ON_SYSTEM_CAPABILITY_UPDATED.getId()).get(0);
assertNotNull(scmRpcListener);
- assertNull(systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES));
+ assertNull(systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES, null, false));
/* PERFORM A NOTIFICATION SEND THROUGH THE SCM */
AppServiceCapability addServiceID = AppServiceFactory.createAppServiceCapability(AppServiceType.NAVIGATION, "test", "3453", true, null);
@@ -726,7 +721,7 @@ public class SystemCapabilityManagerTests {
scmRpcListener.onReceived(onSystemCapabilityUpdated);
- assertNotNull(systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES));
+ assertNotNull(systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES, null, false));
}
@Test
@@ -736,8 +731,8 @@ public class SystemCapabilityManagerTests {
OnRPCListener scmRpcListener = iSDL.rpcListeners.get(FunctionID.ON_SYSTEM_CAPABILITY_UPDATED.getId()).get(0);
assertNotNull(scmRpcListener);
- assertNotNull(systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAYS));
- assertNotNull(systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY));
+ assertNotNull(systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAYS, null, false));
+ assertNotNull(systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY, null, false));
List<DisplayCapability> newCaps = createDisplayCapabilityList(TestValues.GENERAL_DISPLAYCAPABILITIES, TestValues.GENERAL_BUTTONCAPABILITIES_LIST, TestValues.GENERAL_SOFTBUTTONCAPABILITIES_LIST);;
@@ -750,11 +745,11 @@ public class SystemCapabilityManagerTests {
scmRpcListener.onReceived(onSystemCapabilityUpdated);
- List<DisplayCapability> appliedCaps = (List<DisplayCapability>)systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAYS);
+ List<DisplayCapability> appliedCaps = (List<DisplayCapability>)systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAYS, null, false);
assertNotNull(appliedCaps);
assertTrue(Validator.validateDisplayCapabilityList(newCaps, appliedCaps));
- DisplayCapabilities appliedConvertedCaps = (DisplayCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY);
+ DisplayCapabilities appliedConvertedCaps = (DisplayCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY, null, false);
assertNotNull(appliedConvertedCaps);
DisplayCapabilities testConvertedCaps = createDisplayCapabilities(newCaps.get(0).getDisplayName(), newCaps.get(0).getWindowCapabilities().get(0));
assertTrue(Validator.validateDisplayCapabilities(appliedConvertedCaps, testConvertedCaps));
@@ -775,13 +770,13 @@ public class SystemCapabilityManagerTests {
assertNotNull(scmRpcListener);
/* CONFIRM THE CAP DOESN'T EXIST IN SCM */
- AppServicesCapabilities cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES);
+ AppServicesCapabilities cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES, null, false);
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);
+ cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES, null, false);
assertNotNull(cachedCap);
/* CONFIRM THE CAP IN SCM EQUALS ORIGINAL*/
assertEquals(cachedCap, appServicesCapabilities);
@@ -801,7 +796,7 @@ public class SystemCapabilityManagerTests {
scmRpcListener.onReceived(onSystemCapabilityUpdated);
- cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES);
+ cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES, null, false);
assertNotNull(cachedCap);
assertTrue(cachedCap.getAppServices().get(0).getUpdatedAppServiceRecord().getServiceID().equals(baseID));
@@ -826,7 +821,7 @@ public class SystemCapabilityManagerTests {
scmRpcListener.onReceived(onSystemCapabilityUpdated);
- cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES);
+ cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES, null, false);
assertNotNull(cachedCap);
assertEquals(cachedCap.getAppServices().size(), 1);
@@ -845,7 +840,7 @@ public class SystemCapabilityManagerTests {
scmRpcListener.onReceived(onSystemCapabilityUpdated);
- cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES);
+ cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES, null, false);
assertNotNull(cachedCap);
assertEquals(cachedCap.getAppServices().size(), 2);
@@ -864,7 +859,7 @@ public class SystemCapabilityManagerTests {
scmRpcListener.onReceived(onSystemCapabilityUpdated);
- cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES);
+ cachedCap = (AppServicesCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES, null, false);
assertNotNull(cachedCap);
assertEquals(cachedCap.getAppServices().size(), 1);
@@ -879,7 +874,7 @@ public class SystemCapabilityManagerTests {
assertNotNull(scmRpcListener);
systemCapabilityManager.setCapability(SystemCapabilityType.PHONE_CALL, TestValues.GENERAL_PHONECAPABILITY);
- PhoneCapability phoneCapability = (PhoneCapability)systemCapabilityManager.getCapability(SystemCapabilityType.PHONE_CALL);
+ PhoneCapability phoneCapability = (PhoneCapability)systemCapabilityManager.getCapability(SystemCapabilityType.PHONE_CALL, null, false);
assertNotNull(phoneCapability);
assertEquals(phoneCapability, TestValues.GENERAL_PHONECAPABILITY);
@@ -892,7 +887,7 @@ public class SystemCapabilityManagerTests {
scmRpcListener.onReceived(onSystemCapabilityUpdated);
- PhoneCapability phoneCapabilityUpdated = (PhoneCapability)systemCapabilityManager.getCapability(SystemCapabilityType.PHONE_CALL);
+ PhoneCapability phoneCapabilityUpdated = (PhoneCapability)systemCapabilityManager.getCapability(SystemCapabilityType.PHONE_CALL, null, false);
assertNotNull(phoneCapabilityUpdated);
assertFalse(phoneCapabilityUpdated.getDialNumberEnabled());
assertEquals(phoneCapability, phoneCapabilityUpdated);
@@ -916,11 +911,11 @@ public class SystemCapabilityManagerTests {
dlRpcListener.onReceived(newLayout);
- DisplayCapabilities appliedCaps = (DisplayCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY);
+ DisplayCapabilities appliedCaps = (DisplayCapabilities)systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY, null, false);
assertNotNull(appliedCaps);
assertTrue(Validator.validateDisplayCapabilities(newLayout.getDisplayCapabilities(), appliedCaps));
- List<DisplayCapability> convertedCaps = (List<DisplayCapability>)systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAYS);
+ List<DisplayCapability> convertedCaps = (List<DisplayCapability>)systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAYS, null, false);
assertNotNull(convertedCaps);
List<DisplayCapability> testCaps = createDisplayCapabilityList(newLayout.getDisplayCapabilities(), newLayout.getButtonCapabilities(), newLayout.getSoftButtonCapabilities());
assertTrue(Validator.validateDisplayCapabilityList(convertedCaps, testCaps));
@@ -963,23 +958,9 @@ public class SystemCapabilityManagerTests {
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 sendRPCs(List<? extends RPCMessage> rpcs, OnMultipleRequestListener listener) {
}
@@ -1030,12 +1011,6 @@ public class SystemCapabilityManagerTests {
return false;
}
- @Override
- public Object getCapability(SystemCapabilityType systemCapabilityType){return null;}
-
- @Override
- public void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener) {
- }
@Override
public RegisterAppInterfaceResponse getRegisterAppInterfaceResponse() {
@@ -1043,11 +1018,6 @@ public class SystemCapabilityManagerTests {
}
@Override
- public Object getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener, boolean forceUpdate) {
- return null;
- }
-
- @Override
public SdlMsgVersion getSdlMsgVersion() {
return null;
}
@@ -1057,46 +1027,24 @@ public class SystemCapabilityManagerTests {
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) {}
+ public void startAudioService(boolean encrypted){}
@Override
- public IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters){
- return null;
- }
+ public void startRPCEncryption() {}
@Override
- public IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec,
- AudioStreamingParams params) {
+ public Taskmaster getTaskmaster() {
return null;
}
@Override
- public void startAudioService(boolean encrypted){}
-
- @Override
- public void startRPCEncryption() {}
-
- @Override
- public Taskmaster getTaskmaster() {
+ public SystemCapabilityManager getSystemCapabilityManager() {
return null;
}
}
diff --git a/android/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 84a4e52ef..500680e02 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenConfigTests.java
@@ -30,7 +30,6 @@ public class LockScreenConfigTests {
lockScreenConfig.setAppIcon(TestValues.GENERAL_INT);
lockScreenConfig.setBackgroundColor(TestValues.GENERAL_INT);
lockScreenConfig.showDeviceLogo(true);
- lockScreenConfig.setEnabled(true);
lockScreenConfig.setDisplayMode(LockScreenConfig.DISPLAY_MODE_OPTIONAL_OR_REQUIRED);
}
@@ -41,7 +40,6 @@ public class LockScreenConfigTests {
assertEquals(TestValues.GENERAL_INT, lockScreenConfig.getCustomView());
assertEquals(TestValues.GENERAL_INT, lockScreenConfig.getAppIcon());
assertEquals(TestValues.GENERAL_INT, lockScreenConfig.getBackgroundColor());
- assertTrue(lockScreenConfig.isEnabled());
assertTrue(lockScreenConfig.isDeviceLogoEnabled());
assertEquals(LockScreenConfig.DISPLAY_MODE_OPTIONAL_OR_REQUIRED, lockScreenConfig.getDisplayMode());
}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManagerTests.java
index 38701bd64..727c043cc 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManagerTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManagerTests.java
@@ -3,6 +3,7 @@ package com.smartdevicelink.managers.lockscreen;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
diff --git a/android/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 2509a2298..dd606a2c0 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java
@@ -1,10 +1,11 @@
package com.smartdevicelink.managers.lockscreen;
import android.content.Context;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState;
import com.smartdevicelink.proxy.rpc.enums.HMILevel;
@@ -60,7 +61,6 @@ public class LockScreenManagerTests {
lockScreenConfig.setAppIcon(TestValues.GENERAL_INT);
lockScreenConfig.setBackgroundColor(TestValues.GENERAL_INT);
lockScreenConfig.showDeviceLogo(true);
- lockScreenConfig.setEnabled(true);
lockScreenConfig.setDisplayMode(LockScreenConfig.DISPLAY_MODE_OPTIONAL_OR_REQUIRED);
lockScreenManager = new LockScreenManager(lockScreenConfig, context, internalInterface);
diff --git a/android/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 d53287b61..973625106 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/permission/PermissionManagerTests.java
@@ -4,7 +4,7 @@ import androidx.annotation.NonNull;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.HMIPermissions;
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
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
index f1e68e9b3..5e9203e99 100644
--- 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
@@ -1,13 +1,13 @@
package com.smartdevicelink.managers.screen;
-import com.livio.taskmaster.Taskmaster;
import androidx.test.ext.junit.runners.AndroidJUnit4;
+import com.livio.taskmaster.Taskmaster;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.file.FileManager;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
import com.smartdevicelink.managers.screen.menu.DynamicMenuUpdatesMode;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.enums.FileType;
import com.smartdevicelink.proxy.rpc.enums.MetadataType;
import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
@@ -21,7 +21,6 @@ import java.util.Arrays;
import java.util.List;
import static junit.framework.TestCase.assertEquals;
-import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static org.mockito.Mockito.mock;
@@ -99,14 +98,11 @@ public class ScreenManagerTests {
screenManager.setPrimaryGraphic(testArtwork);
assertEquals(screenManager.getPrimaryGraphic(), testArtwork);
}
-
@Test
public void testSetPrimaryGraphicWithBlankImage() {
screenManager.setPrimaryGraphic(null);
- assertNotNull(screenManager.getPrimaryGraphic());
- assertEquals(screenManager.getPrimaryGraphic().getName(), "blankArtwork");
+ assertNull(screenManager.getPrimaryGraphic());
}
-
@Test
public void testSetSecondaryGraphic() {
screenManager.setSecondaryGraphic(testArtwork);
@@ -116,8 +112,7 @@ public class ScreenManagerTests {
@Test
public void testSetSecondaryGraphicWithBlankImage() {
screenManager.setSecondaryGraphic(null);
- assertNotNull(screenManager.getSecondaryGraphic());
- assertEquals(screenManager.getSecondaryGraphic().getName(), "blankArtwork");
+ assertNull(screenManager.getSecondaryGraphic());
}
@Test
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
index 3a680221e..713aae4fd 100644
--- 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
@@ -3,14 +3,14 @@ package com.smartdevicelink.managers.screen;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import com.smartdevicelink.managers.CompletionListener;
import com.livio.taskmaster.Taskmaster;
import com.smartdevicelink.managers.file.FileManager;
import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.managers.lifecycle.OnSystemCapabilityListener;
+import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.DisplayCapability;
import com.smartdevicelink.proxy.rpc.Image;
import com.smartdevicelink.proxy.rpc.OnButtonEvent;
@@ -51,6 +51,7 @@ import static org.junit.Assert.assertNotEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -89,7 +90,7 @@ public class SoftButtonManagerTests {
doAnswer(onHMIStatusAnswer).when(internalInterface).addOnRPCNotificationListener(eq(FunctionID.ON_HMI_STATUS), any(OnRPCNotificationListener.class));
- // When internalInterface.addOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onSystemCapabilityListener) is called
+ // When internalInterface.getSystemCapabilityManager().addOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onSystemCapabilityListener) is called
// inside SoftButtonManager, respond with a fake response to let the SoftButtonManager continue working.
Answer<Void> onSystemCapabilityAnswer = new Answer<Void>() {
@Override
@@ -108,8 +109,9 @@ public class SoftButtonManagerTests {
return null;
}
};
- doAnswer(onSystemCapabilityAnswer).when(internalInterface).addOnSystemCapabilityListener(eq(SystemCapabilityType.DISPLAYS), any(OnSystemCapabilityListener.class));
-
+ SystemCapabilityManager systemCapabilityManager = mock(SystemCapabilityManager.class);
+ doAnswer(onSystemCapabilityAnswer).when(systemCapabilityManager).addOnSystemCapabilityListener(eq(SystemCapabilityType.DISPLAYS), any(OnSystemCapabilityListener.class));
+ doReturn(systemCapabilityManager).when(internalInterface).getSystemCapabilityManager();
// When fileManager.uploadArtworks() is called inside the SoftButtonManager, respond with
// a fake onComplete() callback to let the SoftButtonManager continue working.
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SubscribeButtonManagerTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SubscribeButtonManagerTest.java
index 8e16c3ed0..e0fcc5d0a 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SubscribeButtonManagerTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SubscribeButtonManagerTest.java
@@ -5,7 +5,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.proxy.RPCMessage;
import com.smartdevicelink.proxy.RPCRequest;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.OnButtonEvent;
import com.smartdevicelink.proxy.rpc.OnButtonPress;
import com.smartdevicelink.proxy.rpc.SubscribeButton;
@@ -61,9 +61,9 @@ public class SubscribeButtonManagerTest {
Object[] args = invocation.getArguments();
RPCRequest message = (RPCRequest) args[0];
if(message instanceof SubscribeButton){
- SubscribeButtonResponse subscribeButtonResponse = new SubscribeButtonResponse();
- subscribeButtonResponse.setSuccess(false);
- message.getOnRPCResponseListener().onError(message.getCorrelationID(), Result.GENERIC_ERROR, "Fail");
+ SubscribeButtonResponse subscribeButtonResponse = new SubscribeButtonResponse(false, Result.GENERIC_ERROR);
+ subscribeButtonResponse.setInfo("Fail");
+ message.getOnRPCResponseListener().onResponse(message.getCorrelationID(), subscribeButtonResponse);
}
return null;
}
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
index 439b7ebe9..e65911ccb 100644
--- 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
@@ -2,30 +2,38 @@ package com.smartdevicelink.managers.screen;
import android.content.Context;
import android.net.Uri;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
+import com.livio.taskmaster.Task;
+import com.livio.taskmaster.Taskmaster;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.ManagerUtility;
import com.smartdevicelink.managers.file.FileManager;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.rpc.MetadataTags;
-import com.smartdevicelink.proxy.rpc.Show;
+import com.smartdevicelink.managers.lifecycle.OnSystemCapabilityListener;
+import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
+import com.smartdevicelink.protocol.enums.FunctionID;
+import com.smartdevicelink.managers.ISdl;
+import com.smartdevicelink.proxy.rpc.DisplayCapability;
+import com.smartdevicelink.proxy.rpc.OnHMIStatus;
import com.smartdevicelink.proxy.rpc.TextField;
import com.smartdevicelink.proxy.rpc.WindowCapability;
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.SystemCapabilityType;
import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
-import org.json.JSONException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
import java.util.ArrayList;
-import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
@@ -33,7 +41,13 @@ import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
+import static junit.framework.TestCase.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
/**
* This is a unit test class for the SmartDeviceLink library manager class :
@@ -49,6 +63,7 @@ public class TextAndGraphicManagerTests {
@Before
public void setUp() throws Exception{
Context mTestContext = getInstrumentation().getContext();
+
// mock things
ISdl internalInterface = mock(ISdl.class);
FileManager fileManager = mock(FileManager.class);
@@ -60,6 +75,40 @@ public class TextAndGraphicManagerTests {
testArtwork.setUri(uri);
testArtwork.setType(FileType.GRAPHIC_PNG);
+ Taskmaster taskmaster = new Taskmaster.Builder().build();
+ taskmaster.start();
+ when(internalInterface.getTaskmaster()).thenReturn(taskmaster);
+
+ 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));
+
+ Answer<Void> onSystemCapabilityAnswer = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ OnSystemCapabilityListener onSystemCapabilityListener = (OnSystemCapabilityListener) args[1];
+ WindowCapability windowCapability = getWindowCapability(4);
+ DisplayCapability displayCapability = new DisplayCapability();
+ displayCapability.setWindowCapabilities(Collections.singletonList(windowCapability));
+ List<DisplayCapability> capabilities = Collections.singletonList(displayCapability);
+ onSystemCapabilityListener.onCapabilityRetrieved(capabilities);
+ return null;
+ }
+ };
+ SystemCapabilityManager systemCapabilityManager = mock(SystemCapabilityManager.class);
+ doAnswer(onSystemCapabilityAnswer).when(systemCapabilityManager).addOnSystemCapabilityListener(eq(SystemCapabilityType.DISPLAYS), any(OnSystemCapabilityListener.class));
+ doReturn(systemCapabilityManager).when(internalInterface).getSystemCapabilityManager();
+
textAndGraphicManager = new TextAndGraphicManager(internalInterface, fileManager, softButtonManager);
}
@@ -122,13 +171,9 @@ public class TextAndGraphicManagerTests {
assertNull(textAndGraphicManager.getTextField2Type());
assertNull(textAndGraphicManager.getTextField3Type());
assertNull(textAndGraphicManager.getTextField4Type());
-
assertNotNull(textAndGraphicManager.currentScreenData);
- assertNull(textAndGraphicManager.inProgressUpdate);
- assertNull(textAndGraphicManager.queuedImageUpdate);
- assertFalse(textAndGraphicManager.hasQueuedUpdate);
- assertNull(textAndGraphicManager.defaultMainWindowCapability);
- assertEquals(textAndGraphicManager.currentHMILevel, HMILevel.HMI_NONE);
+ assertNotNull(textAndGraphicManager.defaultMainWindowCapability);
+ assertEquals(textAndGraphicManager.currentHMILevel, HMILevel.HMI_FULL);
assertFalse(textAndGraphicManager.isDirty);
assertEquals(textAndGraphicManager.getState(), BaseSubManager.SETTING_UP);
assertNotNull(textAndGraphicManager.getBlankArtwork());
@@ -153,494 +198,6 @@ public class TextAndGraphicManagerTests {
}
@Test
- public void testAssemble1Line(){
-
- Show inputShow = new Show();
-
- // Force it to return display with support for only 1 line of text
- textAndGraphicManager.defaultMainWindowCapability = getWindowCapability(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");
- }
-
- @Test
- public void testAssemble2Lines() {
-
- Show inputShow = new Show();
-
- // Force it to return display with support for only 2 lines of text
- textAndGraphicManager.defaultMainWindowCapability = getWindowCapability(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);
- }
-
- @Test
- public void testAssemble3Lines() {
-
- Show inputShow = new Show();
-
- // Force it to return display with support for only 3 lines of text
- textAndGraphicManager.defaultMainWindowCapability = getWindowCapability(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");
- }
-
- @Test
- public void testAssemble4Lines() {
-
- Show inputShow = new Show();
-
- textAndGraphicManager.defaultMainWindowCapability = getWindowCapability(4);
- TextField tx1 = new TextField();
- TextField tx2 = new TextField();
- TextField tx3 = new TextField();
- TextField tx4 = new TextField();
- TextField tx5 = new TextField();
- TextField tx6 = new TextField();
-
- tx1.setName(TextFieldName.mainField1);
- tx2.setName(TextFieldName.mainField2);
- tx3.setName(TextFieldName.mainField3);
- tx4.setName(TextFieldName.mainField4);
- tx5.setName(TextFieldName.mediaTrack);
- tx6.setName(TextFieldName.templateTitle);
-
- List<TextField> textFieldNames = Arrays.asList(tx1,tx2,tx3,tx4,tx5,tx6);
- textAndGraphicManager.defaultMainWindowCapability.setTextFields(textFieldNames);
-
- textAndGraphicManager.setMediaTrackTextField("HI");
- textAndGraphicManager.setTitle("bye");
-
- // Force it to return display with support for only 4 lines of text
-
- 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(), "");
- assertEquals(assembledShow.getMediaTrack(), "HI");
- assertEquals(assembledShow.getTemplateTitle(), "bye");
-
- // 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);
- }
-
- /**
- * Testing if WindowCapability is null, TextFields should still update.
- */
- @Test
- public void testAssemble4LinesNullWindowCapability() {
-
- Show inputShow = new Show();
-
- textAndGraphicManager.setMediaTrackTextField("HI");
- textAndGraphicManager.setTitle("bye");
-
- 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(), "");
- assertEquals(assembledShow.getMediaTrack(), "HI");
- assertEquals(assembledShow.getTemplateTitle(), "bye");
-
- // 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);
- }
-
- @Test
public void testMediaTrackTextField() {
String songTitle = "Wild For The Night";
@@ -663,22 +220,6 @@ public class TextAndGraphicManagerTests {
assertEquals(textAndGraphicManager.getTextAlignment(), TextAlignment.LEFT_ALIGNED);
}
- @Test
- 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
@Test
@@ -714,11 +255,40 @@ public class TextAndGraphicManagerTests {
assertNull(textAndGraphicManager.getTitle());
assertNotNull(textAndGraphicManager.getBlankArtwork());
assertNull(textAndGraphicManager.currentScreenData);
- assertNull(textAndGraphicManager.inProgressUpdate);
- assertNull(textAndGraphicManager.queuedImageUpdate);
- assertFalse(textAndGraphicManager.hasQueuedUpdate);
assertNull(textAndGraphicManager.defaultMainWindowCapability);
assertFalse(textAndGraphicManager.isDirty);
assertEquals(textAndGraphicManager.getState(), BaseSubManager.SHUTDOWN);
}
+
+ @Test
+ public void testOperationManagement() {
+ textAndGraphicManager.isDirty = true;
+ textAndGraphicManager.updateOperation = null;
+ textAndGraphicManager.update(null);
+ assertEquals(textAndGraphicManager.transactionQueue.getTasksAsList().size(), 1);
+
+ textAndGraphicManager.transactionQueue.clear();
+ textAndGraphicManager.updateOperation = null;
+
+ assertEquals(textAndGraphicManager.transactionQueue.getTasksAsList().size(), 0);
+
+ textAndGraphicManager.isDirty = true;
+ textAndGraphicManager.update(null);
+
+ assertEquals(textAndGraphicManager.transactionQueue.getTasksAsList().size(), 1);
+
+ assertTrue(textAndGraphicManager.transactionQueue.getTasksAsList().get(0).getState() == Task.READY);
+ }
+
+ @Test
+ public void testHasData() {
+ assertFalse(textAndGraphicManager.hasData());
+
+ textAndGraphicManager.setTextField1("HI");
+ assertTrue(textAndGraphicManager.hasData());
+
+ textAndGraphicManager.setTextField1(null);
+ textAndGraphicManager.setPrimaryGraphic(testArtwork);
+ assertTrue(textAndGraphicManager.hasData());
+ }
}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperationTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperationTest.java
new file mode 100644
index 000000000..94f75d764
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperationTest.java
@@ -0,0 +1,902 @@
+package com.smartdevicelink.managers.screen;
+
+import android.content.Context;
+import android.net.Uri;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import com.smartdevicelink.R;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ManagerUtility;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.managers.file.filetypes.SdlFile;
+import com.smartdevicelink.proxy.RPCRequest;
+import com.smartdevicelink.managers.ISdl;
+import com.smartdevicelink.proxy.rpc.ImageField;
+import com.smartdevicelink.proxy.rpc.MetadataTags;
+import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
+import com.smartdevicelink.proxy.rpc.Show;
+import com.smartdevicelink.proxy.rpc.ShowResponse;
+import com.smartdevicelink.proxy.rpc.TextField;
+import com.smartdevicelink.proxy.rpc.WindowCapability;
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
+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 org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
+import static junit.framework.TestCase.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.mockito.ArgumentMatchers.any;
+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;
+
+@RunWith(AndroidJUnit4.class)
+public class TextAndGraphicUpdateOperationTest {
+
+ private TextAndGraphicUpdateOperation textAndGraphicUpdateOperation;
+ private String textField1, textField2, textField3, textField4, mediaTrackField, title;
+ private MetadataType textField1Type, textField2Type, textField3Type, textField4Type;
+ private SdlArtwork testArtwork1, testArtwork2, testArtwork3, testArtwork4;
+ private TextAlignment textAlignment;
+ private WindowCapability defaultMainWindowCapability;
+ private Show currentScreenData;
+ private CompletionListener listener;
+ private TextAndGraphicManager.CurrentScreenDataUpdatedListener currentScreenDataUpdatedListener;
+ private SdlArtwork blankArtwork;
+ ISdl internalInterface;
+ FileManager fileManager;
+
+ private Answer<Void> onShowSuccess = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ RPCRequest message = (RPCRequest) args[0];
+ if (message instanceof Show) {
+ int correlationId = message.getCorrelationID();
+ ShowResponse showResponse = new ShowResponse();
+ showResponse.setSuccess(true);
+ message.getOnRPCResponseListener().onResponse(correlationId, showResponse);
+ }
+ return null;
+ }
+ };
+
+ private Answer<Void> onShowSuccessCanceled = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ RPCRequest message = (RPCRequest) args[0];
+ if (message instanceof Show) {
+ int correlationId = message.getCorrelationID();
+ textAndGraphicUpdateOperation.cancelTask();
+ ShowResponse showResponse = new ShowResponse();
+ showResponse.setSuccess(true);
+ message.getOnRPCResponseListener().onResponse(correlationId, showResponse);
+ }
+ return null;
+ }
+ };
+
+
+ private Answer<Void> onImageUploadSuccessTaskCanceled = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) throws Throwable {
+ Object[] args = invocation.getArguments();
+ MultipleFileCompletionListener listener = (MultipleFileCompletionListener) args[1];
+ textAndGraphicUpdateOperation.cancelTask();
+ listener.onComplete(null);
+ return null;
+ }
+ };
+
+ private Answer<Void> onArtworkUploadSuccess = new Answer<Void>() {
+ @Override
+ public Void answer(InvocationOnMock invocation) {
+ Object[] args = invocation.getArguments();
+ MultipleFileCompletionListener listener = (MultipleFileCompletionListener) args[1];
+ when(fileManager.hasUploadedFile(any(SdlFile.class))).thenReturn(true);
+ listener.onComplete(null);
+ return null;
+ }
+ };
+
+
+ @Before
+ public void setUp() throws Exception {
+ Context mTestContext = getInstrumentation().getContext();
+ // mock things
+ internalInterface = mock(ISdl.class);
+ fileManager = mock(FileManager.class);
+ setUpCompletionListener();
+ textField1 = "It is";
+ textField2 = "Wednesday";
+ textField3 = "My";
+ textField4 = "Dudes";
+ mediaTrackField = "dudes";
+ title = "dudes";
+
+ blankArtwork = new SdlArtwork();
+ blankArtwork.setType(FileType.GRAPHIC_PNG);
+ blankArtwork.setName("blankArtwork");
+ blankArtwork.setResourceId(R.drawable.transparent);
+
+ textField1Type = MetadataType.MEDIA_TITLE;
+ textField2Type = MetadataType.MEDIA_TITLE;
+ textField3Type = MetadataType.MEDIA_TITLE;
+ textField4Type = MetadataType.MEDIA_TITLE;
+
+
+ textAlignment = TextAlignment.CENTERED;
+
+ testArtwork1 = new SdlArtwork();
+ testArtwork1.setName("testFile1");
+ Uri uri1 = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/ic_sdl");
+ testArtwork1.setUri(uri1);
+ testArtwork1.setType(FileType.GRAPHIC_PNG);
+
+ testArtwork2 = new SdlArtwork();
+ testArtwork2.setName("testFile2");
+ Uri uri2 = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/ic_sdl");
+ testArtwork2.setUri(uri2);
+ testArtwork2.setType(FileType.GRAPHIC_PNG);
+
+ testArtwork3 = new SdlArtwork();
+ testArtwork3.setName("testFile3");
+ Uri uri3 = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/ic_sdl");
+ testArtwork3.setUri(uri3);
+ testArtwork3.setType(FileType.GRAPHIC_PNG);
+
+ testArtwork4 = new SdlArtwork();
+ testArtwork4.setName("testFile4");
+ Uri uri4 = Uri.parse("android.resource://" + mTestContext.getPackageName() + "/drawable/ic_sdl");
+ testArtwork4.setUri(uri4);
+ testArtwork4.setType(FileType.GRAPHIC_PNG);
+
+ currentScreenData = new Show();
+ currentScreenData.setMainField1("Old");
+ currentScreenData.setMainField2("Text");
+ currentScreenData.setMainField3("Not");
+ currentScreenData.setMainField4("Important");
+
+ currentScreenData.setGraphic(testArtwork1.getImageRPC());
+ currentScreenData.setSecondaryGraphic(testArtwork2.getImageRPC());
+
+ currentScreenDataUpdatedListener = new TextAndGraphicManager.CurrentScreenDataUpdatedListener() {
+ @Override
+ public void onUpdate(Show show) {
+
+ }
+ };
+
+ defaultMainWindowCapability = getWindowCapability(4);
+
+ TextsAndGraphicsState textsAndGraphicsState = new TextsAndGraphicsState(textField1, textField2, textField3, textField4,
+ mediaTrackField, title, testArtwork3, testArtwork4, textAlignment, textField1Type, textField2Type, textField3Type, textField4Type);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+ }
+
+
+ private void setUpCompletionListener() {
+ listener = new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+
+ }
+ };
+
+ }
+
+ private WindowCapability getWindowCapability(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));
+ }
+ }
+
+ WindowCapability windowCapability = new WindowCapability();
+ windowCapability.setTextFields(returnList);
+
+ ImageField imageField = new ImageField();
+ imageField.setName(ImageFieldName.graphic);
+ ImageField imageField2 = new ImageField();
+ imageField2.setName(ImageFieldName.secondaryGraphic);
+ List<ImageField> imageFieldList = new ArrayList<>();
+ imageFieldList.add(imageField);
+ imageFieldList.add(imageField2);
+ windowCapability.setImageFields(imageFieldList);
+
+ windowCapability.setImageFields(imageFieldList);
+
+ return windowCapability;
+ }
+
+ /**
+ * Used to simulate WindowCapability having no capabilities set
+ *
+ * @return windowCapability that has no capabilities set
+ */
+ private WindowCapability getNullVarWindowCapability() {
+
+ WindowCapability windowCapability = new WindowCapability();
+ return windowCapability;
+ }
+
+ @Test
+ public void testUploads() {
+ doAnswer(onShowSuccess).when(internalInterface).sendRPC(any(Show.class));
+ doAnswer(onArtworkUploadSuccess).when(fileManager).uploadArtworks(any(List.class), any(MultipleFileCompletionListener.class));
+ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(4, 0));
+
+ // Test Images need to be uploaded, sending text and uploading images
+ textAndGraphicUpdateOperation.onExecute();
+ assertEquals(textAndGraphicUpdateOperation.getCurrentScreenData().getMainField1(), textField1);
+ assertEquals(textAndGraphicUpdateOperation.getCurrentScreenData().getMainField2(), textField2);
+ assertEquals(textAndGraphicUpdateOperation.getCurrentScreenData().getMainField3(), textField3);
+ assertEquals(textAndGraphicUpdateOperation.getCurrentScreenData().getMainField4(), textField4);
+ assertEquals(textAndGraphicUpdateOperation.getCurrentScreenData().getAlignment(), textAlignment);
+ assertEquals(textAndGraphicUpdateOperation.getCurrentScreenData().getGraphic(), testArtwork3.getImageRPC());
+ assertEquals(textAndGraphicUpdateOperation.getCurrentScreenData().getSecondaryGraphic(), testArtwork4.getImageRPC());
+
+
+ // Test The files to be updated are already uploaded, send the full show immediately
+ String textField11 = "It's not";
+ TextsAndGraphicsState textsAndGraphicsState = new TextsAndGraphicsState(textField11, textField2, textField3, textField4,
+ mediaTrackField, title, testArtwork1, testArtwork2, textAlignment, textField1Type, textField2Type, textField3Type, textField4Type);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+ textAndGraphicUpdateOperation.onExecute();
+ assertEquals(textAndGraphicUpdateOperation.getCurrentScreenData().getMainField1(), textField11);
+
+ //Test: If there are no images to update, just send the text
+ TextsAndGraphicsState textsAndGraphicsStateNullImages = new TextsAndGraphicsState(textField1, textField2, textField3, textField4,
+ mediaTrackField, title, blankArtwork, blankArtwork, textAlignment, textField1Type, textField2Type, textField3Type, textField4Type);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsStateNullImages, listener, currentScreenDataUpdatedListener);
+ textAndGraphicUpdateOperation.onExecute();
+ assertEquals(textAndGraphicUpdateOperation.getCurrentScreenData().getMainField1(), textField1);
+
+ // Verifies that uploadArtworks gets called only with the fist textAndGraphicsUpdateOperation.onExecute call
+ verify(fileManager, times(1)).uploadArtworks(any(List.class), any(MultipleFileCompletionListener.class));
+ }
+
+ @Test
+ public void testCanceledRightAway() {
+ textAndGraphicUpdateOperation.cancelTask();
+ textAndGraphicUpdateOperation.onExecute();
+ assertEquals(textAndGraphicUpdateOperation.getCurrentScreenData().getMainField1(), "Old");
+ }
+
+ @Test
+ public void testTaskCanceledAfterImageUpload() {
+ doAnswer(onShowSuccess).when(internalInterface).sendRPC(any(Show.class));
+ doAnswer(onImageUploadSuccessTaskCanceled).when(fileManager).uploadArtworks(any(List.class), any(MultipleFileCompletionListener.class));
+ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(5, 0));
+
+ // Test Canceled after Image upload
+ textAndGraphicUpdateOperation.onExecute();
+ verify(internalInterface, times(1)).sendRPC(any(Show.class));
+ assertEquals(textAndGraphicUpdateOperation.getCurrentScreenData().getMainField1(), textField1);
+
+ }
+
+ @Test
+ public void testTaskCanceledAfterTextSent() {
+ doAnswer(onShowSuccessCanceled).when(internalInterface).sendRPC(any(Show.class));
+ when(internalInterface.getSdlMsgVersion()).thenReturn(new SdlMsgVersion(5, 0));
+
+ textAndGraphicUpdateOperation.onExecute();
+ verify(fileManager, times(0)).uploadArtworks(any(List.class), any(MultipleFileCompletionListener.class));
+
+ }
+
+ /**
+ * Test getting number of lines available to be set based off of windowCapability
+ */
+ @Test
+ public void testGetMainLines() {
+
+ // We want to test that the looping works. By default, it will return 4 if display cap is null
+ textAndGraphicUpdateOperation.defaultMainWindowCapability = getNullVarWindowCapability();
+
+ // Null test
+ assertEquals(0, ManagerUtility.WindowCapabilityUtility.getMaxNumberOfMainFieldLines(textAndGraphicUpdateOperation.defaultMainWindowCapability));
+
+ // 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
+ textAndGraphicUpdateOperation.defaultMainWindowCapability = getWindowCapability(3);
+ assertEquals(ManagerUtility.WindowCapabilityUtility.getMaxNumberOfMainFieldLines(textAndGraphicUpdateOperation.defaultMainWindowCapability), 3);
+ }
+
+
+ @Test
+ public void testAssemble1Line() {
+
+ Show inputShow = new Show();
+
+ TextsAndGraphicsState textsAndGraphicsState = new TextsAndGraphicsState(textField1, null, null, null,
+ mediaTrackField, title, testArtwork3, testArtwork4, textAlignment, MetadataType.HUMIDITY, null, null, null);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, getWindowCapability(1), currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ Show assembledShow = textAndGraphicUpdateOperation.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);
+
+ textsAndGraphicsState.setTextField2(textField2);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, getWindowCapability(1), currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is - Wednesday");
+
+ textsAndGraphicsState.setTextField3(textField3);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, getWindowCapability(1), currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "It is - Wednesday - My");
+
+ textsAndGraphicsState.setTextField4(textField4);
+ textsAndGraphicsState.setTextField4Type(MetadataType.CURRENT_TEMPERATURE);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, getWindowCapability(1), currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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
+ textsAndGraphicsState.setTextField1(null);
+ textsAndGraphicsState.setTextField3(null);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, getWindowCapability(1), currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+
+ assembledShow = textAndGraphicUpdateOperation.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "Wednesday - Dudes");
+ }
+
+ @Test
+ public void testAssemble2Lines() {
+
+ Show inputShow = new Show();
+ defaultMainWindowCapability = getWindowCapability(2);
+
+ // Force it to return display with support for only 2 lines of text
+ TextsAndGraphicsState textsAndGraphicsState = new TextsAndGraphicsState(textField1, null, null, null,
+ mediaTrackField, title, testArtwork3, testArtwork4, textAlignment, MetadataType.HUMIDITY, null, null, null);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ Show assembledShow = textAndGraphicUpdateOperation.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);
+
+ textsAndGraphicsState.setTextField2(textField2);
+ textsAndGraphicsState.setTextField2Type(MetadataType.CURRENT_TEMPERATURE);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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);
+
+ textsAndGraphicsState.setTextField3(textField3);
+ textsAndGraphicsState.setTextField3Type(MetadataType.MEDIA_ALBUM);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, getWindowCapability(2), currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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);
+
+ textsAndGraphicsState.setTextField4(textField4);
+ textsAndGraphicsState.setTextField4Type(MetadataType.MEDIA_STATION);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, getWindowCapability(2), currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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
+ textsAndGraphicsState.setTextField1(null);
+ textsAndGraphicsState.setTextField3(null);
+ textsAndGraphicsState.setTextField1Type(null);
+ textsAndGraphicsState.setTextField3Type(null);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, getWindowCapability(2), currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.assembleShowText(inputShow);
+ assertEquals(assembledShow.getMainField1(), "Wednesday");
+ assertEquals(assembledShow.getMainField2(), "Dudes");
+
+ // And 3 fields without setting 1
+ textsAndGraphicsState.setTextField3(textField3);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, getWindowCapability(2), currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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);
+ }
+
+ @Test
+ public void testAssemble3Lines() {
+
+ Show inputShow = new Show();
+
+ // Force it to return display with support for only 3 lines of text
+ defaultMainWindowCapability = getWindowCapability(3);
+ TextsAndGraphicsState textsAndGraphicsState = new TextsAndGraphicsState(textField1, null, null, null,
+ mediaTrackField, title, testArtwork3, testArtwork4, textAlignment, MetadataType.HUMIDITY, null, null, null);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ Show assembledShow = textAndGraphicUpdateOperation.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);
+
+ textsAndGraphicsState.setTextField2(textField2);
+ textsAndGraphicsState.setTextField2Type(MetadataType.CURRENT_TEMPERATURE);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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);
+
+ textsAndGraphicsState.setTextField3(textField3);
+ textsAndGraphicsState.setTextField3Type(MetadataType.MEDIA_ALBUM);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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);
+
+ textsAndGraphicsState.setTextField4(textField4);
+ textsAndGraphicsState.setTextField4Type(MetadataType.MEDIA_STATION);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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
+ textsAndGraphicsState.setTextField1(null);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.assembleShowText(inputShow);
+ try {
+ System.out.println(assembledShow.serializeJSON().toString());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+
+ assertEquals(assembledShow.getMainField2(), "Wednesday");
+ assertEquals(assembledShow.getMainField3(), "My - Dudes");
+ }
+
+ @Test
+ public void testAssemble4Lines() {
+
+ Show inputShow = new Show();
+
+ defaultMainWindowCapability = getWindowCapability(4);
+ TextField tx1 = new TextField();
+ TextField tx2 = new TextField();
+ TextField tx3 = new TextField();
+ TextField tx4 = new TextField();
+ TextField tx5 = new TextField();
+ TextField tx6 = new TextField();
+
+ tx1.setName(TextFieldName.mainField1);
+ tx2.setName(TextFieldName.mainField2);
+ tx3.setName(TextFieldName.mainField3);
+ tx4.setName(TextFieldName.mainField4);
+ tx5.setName(TextFieldName.mediaTrack);
+ tx6.setName(TextFieldName.templateTitle);
+
+ List<TextField> textFieldNames = Arrays.asList(tx1, tx2, tx3, tx4, tx5, tx6);
+ defaultMainWindowCapability.setTextFields(textFieldNames);
+
+ TextsAndGraphicsState textsAndGraphicsState = new TextsAndGraphicsState(textField1, null, null, null,
+ mediaTrackField, title, testArtwork3, testArtwork4, textAlignment, MetadataType.HUMIDITY, null, null, null);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+ textsAndGraphicsState.setMediaTrackTextField("HI");
+ textsAndGraphicsState.setTitle("bye");
+
+ // Force it to return display with support for only 4 lines of text
+ Show assembledShow = textAndGraphicUpdateOperation.assembleShowText(inputShow);
+
+ assertEquals(assembledShow.getMainField1(), "It is");
+ assertEquals(assembledShow.getMainField2(), "");
+ assertEquals(assembledShow.getMainField3(), "");
+ assertEquals(assembledShow.getMainField4(), "");
+ assertEquals(assembledShow.getMediaTrack(), "HI");
+ assertEquals(assembledShow.getTemplateTitle(), "bye");
+
+ // test tags
+ MetadataTags tags = assembledShow.getMetadataTags();
+ List<MetadataType> tagsList = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ assertEquals(tags.getMainField1(), tagsList);
+
+ textsAndGraphicsState.setTextField2("Wednesday");
+ textsAndGraphicsState.setTextField2Type(MetadataType.CURRENT_TEMPERATURE);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+
+ assembledShow = textAndGraphicUpdateOperation.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);
+
+ textsAndGraphicsState.setTextField3("My");
+ textsAndGraphicsState.setTextField3Type(MetadataType.MEDIA_ALBUM);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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);
+
+ textsAndGraphicsState.setTextField4("Dudes");
+ textsAndGraphicsState.setTextField4Type(MetadataType.MEDIA_STATION);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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
+ textsAndGraphicsState.setTextField2(null);
+ textsAndGraphicsState.setTextField3(null);
+ textsAndGraphicsState.setTextField2Type(null);
+ textsAndGraphicsState.setTextField3Type(null);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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);
+ }
+
+ /**
+ * Testing if WindowCapability is null, TextFields should still update.
+ */
+ @Test
+ public void testAssemble4LinesNullWindowCapability() {
+
+ Show inputShow = new Show();
+
+ TextsAndGraphicsState textsAndGraphicsState = new TextsAndGraphicsState(textField1, null, null, null,
+ mediaTrackField, title, testArtwork3, testArtwork4, textAlignment, MetadataType.HUMIDITY, null, null, null);
+
+ textsAndGraphicsState.setMediaTrackTextField("HI");
+ textsAndGraphicsState.setTitle("bye");
+
+ textsAndGraphicsState.setTextField1("It is");
+ textsAndGraphicsState.setTextField1Type(MetadataType.HUMIDITY);
+
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, null, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ Show assembledShow = textAndGraphicUpdateOperation.assembleShowText(inputShow);
+
+ assertEquals(assembledShow.getMainField1(), "It is");
+ assertEquals(assembledShow.getMainField2(), "");
+ assertEquals(assembledShow.getMainField3(), "");
+ assertEquals(assembledShow.getMainField4(), "");
+ assertEquals(assembledShow.getMediaTrack(), "HI");
+ assertEquals(assembledShow.getTemplateTitle(), "bye");
+
+ // test tags
+ MetadataTags tags = assembledShow.getMetadataTags();
+ List<MetadataType> tagsList = new ArrayList<>();
+ tagsList.add(MetadataType.HUMIDITY);
+ assertEquals(tags.getMainField1(), tagsList);
+
+ textsAndGraphicsState.setTextField2("Wednesday");
+ textsAndGraphicsState.setTextField2Type(MetadataType.CURRENT_TEMPERATURE);
+
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, null, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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);
+
+ textsAndGraphicsState.setTextField3("My");
+ textsAndGraphicsState.setTextField3Type(MetadataType.MEDIA_ALBUM);
+
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, null, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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);
+
+ textsAndGraphicsState.setTextField4("Dudes");
+ textsAndGraphicsState.setTextField4Type(MetadataType.MEDIA_STATION);
+
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, null, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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
+ textsAndGraphicsState.setTextField2(null);
+ textsAndGraphicsState.setTextField3(null);
+ textsAndGraphicsState.setTextField2Type(null);
+ textsAndGraphicsState.setTextField3Type(null);
+
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, null, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+
+ assembledShow = textAndGraphicUpdateOperation.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);
+ }
+
+ @Test
+ public void testExtractTextFromShow() {
+ Show mainShow = new Show();
+ mainShow.setMainField1("test");
+ mainShow.setMainField3("Sauce");
+ mainShow.setMainField4("");
+
+ Show newShow = textAndGraphicUpdateOperation.extractTextFromShow(mainShow);
+
+ assertEquals(newShow.getMainField1(), "test");
+ assertEquals(newShow.getMainField3(), "Sauce");
+ assertEquals(newShow.getMainField4(), "");
+ assertNull(newShow.getMainField2());
+ }
+
+ @Test
+ public void testCreateImageOnlyShowWithPrimaryArtwork() {
+ // Test null
+ Show testShow = textAndGraphicUpdateOperation.createImageOnlyShowWithPrimaryArtwork(null, null);
+ assertNull(testShow);
+
+ // Test when artwork hasn't been uploaded
+ when(fileManager.hasUploadedFile(any(SdlFile.class))).thenReturn(false);
+ TextsAndGraphicsState textsAndGraphicsState = new TextsAndGraphicsState(textField1, textField2, textField3, textField4,
+ mediaTrackField, title, testArtwork3, testArtwork4, textAlignment, textField1Type, textField2Type, textField3Type, textField4Type);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+ testShow = textAndGraphicUpdateOperation.createImageOnlyShowWithPrimaryArtwork(testArtwork1, testArtwork2);
+ assertNull(testShow);
+
+ // Test when artwork has been uploaded
+ when(fileManager.hasUploadedFile(any(SdlFile.class))).thenReturn(true);
+ textsAndGraphicsState = new TextsAndGraphicsState(textField1, textField2, textField3, textField4,
+ mediaTrackField, title, testArtwork3, testArtwork4, textAlignment, textField1Type, textField2Type, textField3Type, textField4Type);
+ textAndGraphicUpdateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
+ testShow = textAndGraphicUpdateOperation.createImageOnlyShowWithPrimaryArtwork(testArtwork1, testArtwork2);
+ assertEquals(testShow.getGraphic(), testArtwork1.getImageRPC());
+ assertEquals(testShow.getSecondaryGraphic(), testArtwork2.getImageRPC());
+ }
+
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperationTests.java
index abf868876..fb8308e5f 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperationTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperationTests.java
@@ -37,7 +37,7 @@ package com.smartdevicelink.managers.screen.choiceset;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.Choice;
import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet;
import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManagerTests.java
index 4e9ba2e6b..482d29b90 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManagerTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManagerTests.java
@@ -40,7 +40,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.livio.taskmaster.Taskmaster;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.KeyboardProperties;
import com.smartdevicelink.proxy.rpc.enums.HMILevel;
import com.smartdevicelink.proxy.rpc.enums.KeyboardLayout;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperationTests.java
index e8a9eeb23..ca5c7df56 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperationTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperationTests.java
@@ -37,7 +37,7 @@ package com.smartdevicelink.managers.screen.choiceset;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet;
import org.junit.Before;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java
index 14144758f..f5094917f 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperationTests.java
@@ -39,7 +39,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.smartdevicelink.managers.file.FileManager;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.ImageField;
import com.smartdevicelink.proxy.rpc.TextField;
import com.smartdevicelink.proxy.rpc.WindowCapability;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java
index 8e91c3a04..6da649165 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperationTests.java
@@ -42,7 +42,7 @@ import com.livio.taskmaster.Task;
import com.livio.taskmaster.Taskmaster;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.CancelInteraction;
import com.smartdevicelink.proxy.rpc.KeyboardProperties;
import com.smartdevicelink.proxy.rpc.PerformInteraction;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java
index 37264b865..6eb3a1912 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperationTests.java
@@ -42,7 +42,7 @@ import com.livio.taskmaster.Task;
import com.livio.taskmaster.Taskmaster;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.CancelInteraction;
import com.smartdevicelink.proxy.rpc.KeyboardProperties;
import com.smartdevicelink.proxy.rpc.PerformInteraction;
@@ -60,14 +60,8 @@ import org.junit.runner.RunWith;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
import static junit.framework.TestCase.assertEquals;
-import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertNull;
-import static junit.framework.TestCase.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java
index 518fa451c..eae5b530a 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuCellTests.java
@@ -34,7 +34,7 @@ package com.smartdevicelink.managers.screen.menu;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import com.smartdevicelink.managers.file.SdlArtworkTests;
+import com.smartdevicelink.managers.file.filetypes.SdlArtworkTests;
import com.smartdevicelink.proxy.rpc.enums.MenuLayout;
import com.smartdevicelink.proxy.rpc.enums.TriggerSource;
import com.smartdevicelink.test.TestValues;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuManagerTests.java
index b740d303a..08b0deb86 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuManagerTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/MenuManagerTests.java
@@ -42,7 +42,7 @@ import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.OnCommand;
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManagerTests.java
index a73c28ef2..a3d07438e 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManagerTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManagerTests.java
@@ -37,7 +37,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.CompletionListener;
import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.OnCommand;
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
import com.smartdevicelink.proxy.rpc.enums.HMILevel;
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
index 1701dcc99..c02ba30c4 100644
--- 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
@@ -2,20 +2,21 @@ package com.smartdevicelink.managers.video;
import android.content.Context;
import android.os.Bundle;
-import androidx.annotation.NonNull;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.MotionEvent;
import android.view.View;
+import androidx.annotation.NonNull;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.lifecycle.OnSystemCapabilityListener;
+import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
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.managers.ISdl;
+import com.smartdevicelink.protocol.ISdlServiceListener;
import com.smartdevicelink.proxy.rpc.ImageResolution;
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
import com.smartdevicelink.proxy.rpc.OnTouchEvent;
@@ -39,13 +40,13 @@ import org.junit.runner.RunWith;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
-import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertNotNull;
@@ -54,11 +55,11 @@ 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.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink video streaming manager class :
@@ -139,6 +140,9 @@ public class VideoStreamManagerTests {
public void testHMILevelNotFull(){
final ISdl internalInterface = mock(ISdl.class);
+ SystemCapabilityManager systemCapabilityManager = mock(SystemCapabilityManager.class);
+ doReturn(systemCapabilityManager).when(internalInterface).getSystemCapabilityManager();
+
when(internalInterface.getProtocolVersion()).thenReturn((new Version(5,0,0)));
RegisterAppInterfaceResponse mockRegisterAppInterfaceResponse = new RegisterAppInterfaceResponse();
@@ -147,7 +151,7 @@ public class VideoStreamManagerTests {
mockRegisterAppInterfaceResponse.setVehicleType(mockVehicleType);
when(internalInterface.getRegisterAppInterfaceResponse()).thenReturn(mockRegisterAppInterfaceResponse);
- when(internalInterface.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(true);
+ when(systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(true);
final VideoStreamManager videoStreamManager = new VideoStreamManager(internalInterface);
videoStreamManager.start(new CompletionListener() {
@@ -174,7 +178,10 @@ public class VideoStreamManagerTests {
final Set<Object> listenerSet = new HashSet<>();
when(internalInterface.getProtocolVersion()).thenReturn(new Version(5,0,0));
- when(internalInterface.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(true);
+
+ SystemCapabilityManager systemCapabilityManager = mock(SystemCapabilityManager.class);
+ doReturn(systemCapabilityManager).when(internalInterface).getSystemCapabilityManager();
+ when(systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)).thenReturn(true);
Answer<Void> onGetCapability = new Answer<Void>() {
@Override
@@ -186,7 +193,7 @@ public class VideoStreamManagerTests {
}
};
- doAnswer(onGetCapability).when(internalInterface).getCapability(eq(SystemCapabilityType.VIDEO_STREAMING), any(OnSystemCapabilityListener.class));
+ doAnswer(onGetCapability).when(systemCapabilityManager).getCapability(eq(SystemCapabilityType.VIDEO_STREAMING), any(OnSystemCapabilityListener.class), anyBoolean());
Answer<Void> onAddServiceListener = new Answer<Void>() {
@Override
@@ -247,14 +254,7 @@ public class VideoStreamManagerTests {
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(TestValues.GENERAL_VIDEOSTREAMINGCAPABILITY);
+ when(systemCapabilityManager.getCapability(eq(SystemCapabilityType.VIDEO_STREAMING), any(OnSystemCapabilityListener.class), anyBoolean())).thenReturn(TestValues.GENERAL_VIDEOSTREAMINGCAPABILITY);
final VideoStreamManager videoStreamManager = new VideoStreamManager(internalInterface);
videoStreamManager.start(new CompletionListener() {
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
index e05767aac..ba6249e40 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/protocol/SdlProtocolTests.java
@@ -1,8 +1,9 @@
package com.smartdevicelink.protocol;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
import android.util.Log;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.security.SdlSecurityBase;
import com.smartdevicelink.streaming.video.VideoStreamingParameters;
@@ -21,12 +22,12 @@ import org.junit.runner.RunWith;
import java.io.ByteArrayOutputStream;
import java.lang.reflect.Method;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static org.mockito.Mockito.mock;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
@RunWith(AndroidJUnit4.class)
public class SdlProtocolTests {
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
index cc5b2f7ab..ac575dfbc 100644
--- 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
@@ -1,20 +1,18 @@
package com.smartdevicelink.test.SdlConnection;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.session.SdlSession;
+import com.smartdevicelink.protocol.ISdlServiceListener;
import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
import com.smartdevicelink.test.streaming.MockInterfaceBroker;
import com.smartdevicelink.transport.MultiplexTransportConfig;
-import com.smartdevicelink.transport.TCPTransportConfig;
import junit.framework.TestCase;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
-import static org.mockito.Mockito.mock;
/**
* This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.SdlConnection.SdlSession}
+ * {@link com.smartdevicelink.session.SdlSession}
*/
public class SdlSessionTests extends TestCase {
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java
index 05d0327a7..16c1c9613 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/TestValues.java
@@ -6,6 +6,7 @@ import android.util.Log;
import com.smartdevicelink.R;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.managers.lifecycle.LifecycleManager;
import com.smartdevicelink.managers.lockscreen.LockScreenConfig;
import com.smartdevicelink.managers.screen.choiceset.ChoiceCell;
import com.smartdevicelink.managers.screen.menu.MenuCell;
@@ -15,8 +16,6 @@ import com.smartdevicelink.managers.screen.menu.VoiceCommand;
import com.smartdevicelink.managers.screen.menu.VoiceCommandSelectionListener;
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.AppInfo;
import com.smartdevicelink.proxy.rpc.AppServiceCapability;
import com.smartdevicelink.proxy.rpc.AppServiceData;
@@ -89,6 +88,7 @@ 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.StabilityControlsStatus;
import com.smartdevicelink.proxy.rpc.StartTime;
import com.smartdevicelink.proxy.rpc.StationIDNumber;
import com.smartdevicelink.proxy.rpc.SystemCapability;
@@ -125,6 +125,7 @@ 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.CapacityUnit;
import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
import com.smartdevicelink.proxy.rpc.enums.CharacterSet;
import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
@@ -224,7 +225,7 @@ import java.util.Vector;
public class TestValues {
//Versions
- public static final Version MAX_RPC_VERSION_SUPPORTED = SdlProxyBase.MAX_SUPPORTED_RPC_VERSION;
+ public static final Version MAX_RPC_VERSION_SUPPORTED = LifecycleManager.MAX_SUPPORTED_RPC_VERSION;
/**
* @see SdlProtocol
*/
@@ -335,6 +336,7 @@ public class TestValues {
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 CapacityUnit GENERAL_CAPACITYUNIT = CapacityUnit.KILOGRAMS;
public static final VehicleDataEventStatus GENERAL_VEHCILEDATAEVENTSTATUS = VehicleDataEventStatus.YES;
public static final VehicleDataEventStatus GENERAL_VEHICLEDATAEVENTSTATUS = VehicleDataEventStatus.YES;
public static final TouchEventCapabilities GENERAL_TOUCHEVENTCAPABILITIES = new TouchEventCapabilities();
@@ -444,6 +446,9 @@ public class TestValues {
public static final Grid GENERAL_GRID = new Grid();
public static final SeatLocation GENERAL_SEAT_LOCATION = new SeatLocation();
public static final ModuleInfo GENERAL_MODULE_INFO = new ModuleInfo();
+ public static final StabilityControlsStatus GENERAL_STABILITY_CONTROL_STATUS = new StabilityControlsStatus();
+ public static final VehicleDataStatus GENERAL_ESC_SYSTEM = VehicleDataStatus.ON;
+ public static final VehicleDataStatus GENERAL_S_WAY_CONTROL = VehicleDataStatus.OFF;
public static final WindowType GENERAL_WINDOWTYPE = WindowType.MAIN;
public static final GearStatus GENERAL_GEAR_STATUS = new GearStatus();
public static final PRNDL GENERAL_USER_SELECTED_GEAR = PRNDL.NEUTRAL;
@@ -488,7 +493,7 @@ public class TestValues {
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 Vector<TTSChunk> GENERAL_VECTOR_TTS_CHUNKS = new Vector<>(Arrays.asList(new TTSChunk("Welcome to the jungle", SpeechCapabilities.TEXT)));
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);
@@ -788,8 +793,8 @@ public class TestValues {
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_TTSCHUNK_LIST.add(new TTSChunk("Welcome to the jungle", SpeechCapabilities.TEXT));
+ GENERAL_TTSCHUNK_LIST.add(new TTSChunk("Say a command", SpeechCapabilities.TEXT));
GENERAL_KEYBOARDPROPERTIES.setAutoCompleteText(GENERAL_STRING);
GENERAL_KEYBOARDPROPERTIES.setKeypressMode(KeypressMode.SINGLE_KEYPRESS);
@@ -1025,7 +1030,7 @@ public class TestValues {
GENERAL_LOCKSCREENCONFIG.setAppIcon(R.drawable.sdl_lockscreen_icon);
GENERAL_LOCKSCREENCONFIG.setBackgroundColor(Color.BLUE);
- GENERAL_LOCKSCREENCONFIG.setEnabled(true);
+ GENERAL_LOCKSCREENCONFIG.setDisplayMode(LockScreenConfig.DISPLAY_MODE_ALWAYS);
GENERAL_LOCKSCREENCONFIG.setCustomView(R.layout.activity_sdllock_screen);
GENERAL_CLOUDAPPPROPERTIES.setNicknames(GENERAL_STRING_LIST);
GENERAL_CLOUDAPPPROPERTIES.setAppID(GENERAL_STRING);
@@ -1143,6 +1148,8 @@ public class TestValues {
GENERAL_WINDOW_STATUS.setLocation(TestValues.GENERAL_GRID);
GENERAL_WINDOW_STATUS.setState(TestValues.GENERAL_WINDOW_STATE);
+ GENERAL_STABILITY_CONTROL_STATUS.setEscSystem(GENERAL_ESC_SYSTEM);
+ GENERAL_STABILITY_CONTROL_STATUS.setTrailerSwayControl(GENERAL_S_WAY_CONTROL);
try {
JSON_HMIPERMISSIONS.put(HMIPermissions.KEY_ALLOWED, GENERAL_HMILEVEL_LIST);
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
index d34bfea07..da99ac3fd 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/Validator.java
@@ -1,7 +1,6 @@
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;
@@ -146,28 +145,7 @@ public class Validator{
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){
@@ -2343,7 +2321,23 @@ public class Validator{
if (item1.get(i).getType() != item2.get(i).getType()) {
return false;
}
- if (item1.get(i).getRange() != item2.get(i).getRange()) {
+ if (!item1.get(i).getRange().equals(item2.get(i).getRange())) {
+ return false;
+ }
+
+ if (!item1.get(i).getCapacity().equals(item2.get(i).getCapacity())) {
+ return false;
+ }
+
+ if (!item1.get(i).getCapacityUnit().equals(item2.get(i).getCapacityUnit())) {
+ return false;
+ }
+
+ if (!item1.get(i).getLevel().equals(item2.get(i).getLevel())) {
+ return false;
+ }
+
+ if (!item1.get(i).getLevelState().equals(item2.get(i).getLevelState())) {
return false;
}
}
@@ -3913,4 +3907,24 @@ public class Validator{
return approxPosition1.equals(approxPosition2) && deviation1.equals(deviation2);
}
+
+ public static boolean validateStabilityControlStatus(StabilityControlsStatus status1, StabilityControlsStatus status2) {
+ if (status1 == null) {
+ return (status2 == null);
+ }
+ if (status2 == null) {
+ return (status2 == null);
+ }
+ return status1.getEscSystem().equals(status2.getEscSystem()) && status1.getTrailerSwayControl().equals(status2.getTrailerSwayControl());
+ }
+
+ public static boolean validateStabilityControlStatus(VehicleDataResult status1, VehicleDataResult status2) {
+ if (status1 == null) {
+ return (status2 == null);
+ }
+ if (status2 == null) {
+ return (status2 == null);
+ }
+ return status1.getDataType().equals(status2.getDataType()) && status1.getResultCode().equals(status2.getResultCode());
+ }
}
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
index 542cf28c3..569b13b13 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/VehicleDataHelper.java
@@ -16,10 +16,12 @@ 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.StabilityControlsStatus;
import com.smartdevicelink.proxy.rpc.TireStatus;
import com.smartdevicelink.proxy.rpc.WindowState;
import com.smartdevicelink.proxy.rpc.WindowStatus;
import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
+import com.smartdevicelink.proxy.rpc.enums.CapacityUnit;
import com.smartdevicelink.proxy.rpc.enums.CarModeStatus;
import com.smartdevicelink.proxy.rpc.enums.CompassDirection;
import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
@@ -84,6 +86,7 @@ public class VehicleDataHelper{
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;
+ public static final StabilityControlsStatus STABILITY_CONTROLS_STATUS = new StabilityControlsStatus();
public static final String OEM_CUSTOM_VEHICLE_DATA_STATE = "oemCustomVehicleDataState";
public static final Boolean HANDS_OFF_STEERING = Boolean.TRUE;
@@ -197,6 +200,10 @@ public class VehicleDataHelper{
// fuel range
public static final FuelType FUEL_RANGE_TYPE = FuelType.GASOLINE;
public static final Float FUEL_RANGE_RANGE = TestValues.GENERAL_FLOAT;
+ public static final Float FUEL_RANGE_CAPACITY = TestValues.GENERAL_FLOAT;
+ public static final CapacityUnit FUEL_RANGE_CAPACITY_UNIT = TestValues.GENERAL_CAPACITYUNIT;
+ public static final Float FUEL_RANGE_LEVEL = TestValues.GENERAL_FLOAT;
+ public static final ComponentVolumeStatus FUEL_RANGE_LEVEL_STATE = TestValues.GENERAL_COMPONENTVOLUMESTATUS;
// Gear status
public static final GearStatus GEAR_STATUS = new GearStatus();
@@ -208,6 +215,10 @@ public class VehicleDataHelper{
public static final Grid LOCATION_GRID = TestValues.GENERAL_LOCATION_GRID;
public static final WindowState WINDOW_STATE = TestValues.GENERAL_WINDOW_STATE;
+ // stability control status
+ public static final VehicleDataStatus ESC_SYSTEM = VehicleDataStatus.ON;
+ public static final VehicleDataStatus S_WAY_TRAILER = VehicleDataStatus.OFF;
+
public static final JSONArray JSON_FUEL_RANGE = new JSONArray();
//the OnVehicleData which stores all the information above
@@ -336,6 +347,10 @@ public class VehicleDataHelper{
// FUEL_RANGE and FUEL_RANGE_LIST set up
FUEL_RANGE.setType(FUEL_RANGE_TYPE);
FUEL_RANGE.setRange(FUEL_RANGE_RANGE);
+ FUEL_RANGE.setCapacity(FUEL_RANGE_CAPACITY);
+ FUEL_RANGE.setCapacityUnit(FUEL_RANGE_CAPACITY_UNIT);
+ FUEL_RANGE.setLevel(FUEL_RANGE_LEVEL);
+ FUEL_RANGE.setLevelState(FUEL_RANGE_LEVEL_STATE);
FUEL_RANGE_LIST.add(FUEL_RANGE);
//WINDOW_STATUS and WINDOW_STATUS_LIST set up
@@ -349,6 +364,10 @@ public class VehicleDataHelper{
e.printStackTrace();
}
+ // STABILITY_CONTROLS_STATUS
+ STABILITY_CONTROLS_STATUS.setEscSystem(VehicleDataStatus.ON);
+ STABILITY_CONTROLS_STATUS.setTrailerSwayControl(VehicleDataStatus.OFF);
+
// GEAR_STATUS
GEAR_STATUS.setTransmissionType(TRANSMISSION_TYPE);
GEAR_STATUS.setUserSelectedGear(USER_SELECTED_GEAR);
@@ -386,6 +405,7 @@ public class VehicleDataHelper{
VEHICLE_DATA.setElectronicParkBrakeStatus(ELECTRONIC_PARK_BRAKE_STATUS);
VEHICLE_DATA.setGearStatus(GEAR_STATUS);
VEHICLE_DATA.setWindowStatus(WINDOW_STATUS_LIST);
+ VEHICLE_DATA.setStabilityControlsStatus(STABILITY_CONTROLS_STATUS);
VEHICLE_DATA.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, OEM_CUSTOM_VEHICLE_DATA_STATE);
VEHICLE_DATA.setHandsOffSteering(HANDS_OFF_STEERING);
//set up the GetVehicleDataResponse object
@@ -420,6 +440,7 @@ public class VehicleDataHelper{
VEHICLE_DATA_RESPONSE.setElectronicParkBrakeStatus(ELECTRONIC_PARK_BRAKE_STATUS);
VEHICLE_DATA_RESPONSE.setGearStatus(GEAR_STATUS);
VEHICLE_DATA_RESPONSE.setWindowStatus(WINDOW_STATUS_LIST);
+ VEHICLE_DATA_RESPONSE.setStabilityControlsStatus(STABILITY_CONTROLS_STATUS);
VEHICLE_DATA_RESPONSE.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, OEM_CUSTOM_VEHICLE_DATA_STATE);
VEHICLE_DATA_RESPONSE.setHandsOffSteering(HANDS_OFF_STEERING);
}
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
deleted file mode 100644
index e2ad1ea3a..000000000
--- a/android/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 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/proxy/InternalProxyMessageTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/InternalProxyMessageTests.java
deleted file mode 100644
index ec64ed99d..000000000
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/InternalProxyMessageTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.smartdevicelink.test.proxy;
-
-import com.smartdevicelink.proxy.callbacks.InternalProxyMessage;
-import com.smartdevicelink.test.TestValues;
-
-import junit.framework.TestCase;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.callbacks.InternalProxyMessage}
- */
-public class InternalProxyMessageTests extends TestCase {
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.proxy.callbacks.InternalProxyMessage#InternalProxyMessage(String)}
- */
- public void testValues () {
- // Valid Tests
- String test = "functionName";
- InternalProxyMessage testIPM = new InternalProxyMessage(test);
- assertEquals(TestValues.MATCH, test, testIPM.getFunctionName());
-
- test = "OnProxyError";
- assertEquals(TestValues.MATCH, test, InternalProxyMessage.OnProxyError);
- test = "OnProxyOpened";
- assertEquals(TestValues.MATCH, test, InternalProxyMessage.OnProxyOpened);
- test = "OnProxyClosed";
- assertEquals(TestValues.MATCH, test, InternalProxyMessage.OnProxyClosed);
-
- // Invalid/Null Tests
- testIPM = new InternalProxyMessage(null);
- assertNull(TestValues.NULL, testIPM.getFunctionName());
- }
-} \ No newline at end of file
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
deleted file mode 100644
index 8c66446af..000000000
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/RPCRequestFactoryTests.java
+++ /dev/null
@@ -1,1102 +0,0 @@
-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.TestValues;
-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(TestValues.NOT_NULL, testBSR.getBulkData());
- assertEquals(TestValues.MATCH, testInt, testBSR.getCorrelationID());
-
- testBSR = RPCRequestFactory.buildSystemRequest(testData, null);
- assertNotNull(TestValues.NULL, testBSR.getCorrelationID());
-
- testBSR = RPCRequestFactory.buildSystemRequest(null, testInt);
- assertNull(TestValues.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(TestValues.MATCH, testVData, new Vector<String>(testBSR.getLegacyData()));
- assertEquals(TestValues.MATCH, testInt, testBSR.getCorrelationID());
-
- testBSR = RPCRequestFactory.buildSystemRequestLegacy(testVData, null);
- assertNotNull(TestValues.NOT_NULL, testBSR.getCorrelationID());
-
- testBSR = RPCRequestFactory.buildSystemRequestLegacy(null, testInt);
- assertNull(TestValues.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(TestValues.MATCH, testCommandID, testBAC.getCmdID());
- assertEquals(TestValues.MATCH, testMenuText, testBAC.getMenuParams().getMenuName());
- assertEquals(TestValues.MATCH, testParentID, testBAC.getMenuParams().getParentID());
- assertEquals(TestValues.MATCH, testPosition, testBAC.getMenuParams().getPosition());
- assertEquals(TestValues.MATCH, testVrCommands, testBAC.getVrCommands());
- assertTrue(TestValues.TRUE, Validator.validateImage(testImage, testBAC.getCmdIcon()));
- assertEquals(TestValues.MATCH, testCorrelationID, testBAC.getCorrelationID());
-
- testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null, null, null, null);
- assertNull(TestValues.NULL, testBAC.getCmdID());
- assertNull(TestValues.NULL, testBAC.getMenuParams());
- assertNull(TestValues.NULL, testBAC.getVrCommands());
- assertNull(TestValues.NULL, testBAC.getCmdIcon());
- assertNotNull(TestValues.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(TestValues.MATCH, testCommandID, testBAC.getCmdID());
- assertEquals(TestValues.MATCH, testMenuText, testBAC.getMenuParams().getMenuName());
- assertEquals(TestValues.MATCH, testParentID, testBAC.getMenuParams().getParentID());
- assertEquals(TestValues.MATCH, testPosition, testBAC.getMenuParams().getPosition());
- assertEquals(TestValues.MATCH, testVrCommands, testBAC.getVrCommands());
- assertEquals(TestValues.MATCH, testCorrelationID, testBAC.getCorrelationID());
- assertTrue(TestValues.TRUE, Validator.validateImage(testImage, testBAC.getCmdIcon()));
-
- testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null, null, null, null, null);
- assertNull(TestValues.NULL, testBAC.getCmdID());
- assertNull(TestValues.NULL, testBAC.getMenuParams());
- assertNull(TestValues.NULL, testBAC.getVrCommands());
- assertNull(TestValues.NULL, testBAC.getCmdIcon());
- assertNotNull(TestValues.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(TestValues.MATCH, testCommandID, testBAC.getCmdID());
- assertEquals(TestValues.MATCH, testMenuText, testBAC.getMenuParams().getMenuName());
- assertEquals(TestValues.MATCH, testParentID, testBAC.getMenuParams().getParentID());
- assertEquals(TestValues.MATCH, testPosition, testBAC.getMenuParams().getPosition());
- assertEquals(TestValues.MATCH, testVrCommands, testBAC.getVrCommands());
- assertEquals(TestValues.MATCH, testCorrelationID, testBAC.getCorrelationID());
-
- testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null, null, null);
- assertNull(TestValues.NULL, testBAC.getCmdID());
- assertNull(TestValues.NULL, testBAC.getMenuParams());
- assertNull(TestValues.NULL, testBAC.getVrCommands());
- assertNotNull(TestValues.NOT_NULL, testBAC.getCorrelationID());
-
- // Test -- buildAddCommand(Integer commandID, String menuText, Vector<String> vrCommands, Integer correlationID)
- testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testMenuText, testVrCommands, testCorrelationID);
- assertEquals(TestValues.MATCH, testCommandID, testBAC.getCmdID());
- assertEquals(TestValues.MATCH, testMenuText, testBAC.getMenuParams().getMenuName());
- assertEquals(TestValues.MATCH, testVrCommands, testBAC.getVrCommands());
- assertEquals(TestValues.MATCH, testCorrelationID, testBAC.getCorrelationID());
-
- testBAC = RPCRequestFactory.buildAddCommand(null, null, null, null);
- assertNull(TestValues.NULL, testBAC.getCmdID());
- assertNull(TestValues.NULL, testBAC.getMenuParams());
- assertNull(TestValues.NULL, testBAC.getVrCommands());
- assertNotNull(TestValues.NOT_NULL, testBAC.getCorrelationID());
-
- // Test -- buildAddCommand(Integer commandID, Vector<String> vrCommands, Integer correlationID)
- testBAC = RPCRequestFactory.buildAddCommand(testCommandID, testVrCommands, testCorrelationID);
- assertEquals(TestValues.MATCH, testCommandID, testBAC.getCmdID());
- assertEquals(TestValues.MATCH, testVrCommands, testBAC.getVrCommands());
- assertEquals(TestValues.MATCH, testCorrelationID, testBAC.getCorrelationID());
-
- testBAC = RPCRequestFactory.buildAddCommand(null, null, null);
- assertNull(TestValues.NULL, testBAC.getCmdID());
- assertNull(TestValues.NULL, testBAC.getVrCommands());
- assertNotNull(TestValues.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(TestValues.MATCH, testMenuID, testBASM.getMenuID());
- assertEquals(TestValues.MATCH, testMenuName, testBASM.getMenuName());
- assertEquals(TestValues.MATCH, testPosition, testBASM.getPosition());
- assertEquals(TestValues.MATCH, testCorrelationID, testBASM.getCorrelationID());
-
- testBASM = RPCRequestFactory.buildAddSubMenu(null, null, null, null);
- assertNull(TestValues.NULL, testBASM.getMenuID());
- assertNull(TestValues.NULL, testBASM.getMenuName());
- assertNull(TestValues.NULL, testBASM.getPosition());
- assertNotNull(TestValues.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(TestValues.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(TestValues.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(TestValues.TRUE, Validator.validateTtsChunks(testTtsChunks, testAlert.getTtsChunks()));
- assertEquals(TestValues.MATCH, testAlertText1, testAlert.getAlertText1());
- assertEquals(TestValues.MATCH, testAlertText2, testAlert.getAlertText2());
- assertEquals(TestValues.MATCH, testAlertText3, testAlert.getAlertText3());
- assertEquals(TestValues.MATCH, testPlayTone, testAlert.getPlayTone());
- assertEquals(TestValues.MATCH, testDuration, testAlert.getDuration());
- assertTrue(TestValues.TRUE, Validator.validateSoftButtons(testSoftButtons, testAlert.getSoftButtons()));
- assertEquals(TestValues.MATCH, testCorrelationID, testAlert.getCorrelationID());
-
- testAlert = RPCRequestFactory.buildAlert((Vector<TTSChunk>) null, null, null, null, null, null, null, null);
- assertNull(TestValues.NULL, testAlert.getTtsChunks());
- assertNull(TestValues.NULL, testAlert.getAlertText1());
- assertNull(TestValues.NULL, testAlert.getAlertText2());
- assertNull(TestValues.NULL, testAlert.getAlertText3());
- assertNull(TestValues.NULL, testAlert.getPlayTone());
- assertNull(TestValues.NULL, testAlert.getDuration());
- assertNull(TestValues.NULL, testAlert.getSoftButtons());
- assertNotNull(TestValues.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(TestValues.TRUE, Validator.validateTtsChunks(testTtsChunks, testAlert.getTtsChunks()));
- assertEquals(TestValues.MATCH, testAlertText1, testAlert.getAlertText1());
- assertEquals(TestValues.MATCH, testAlertText2, testAlert.getAlertText2());
- assertEquals(TestValues.MATCH, testPlayTone, testAlert.getPlayTone());
- assertEquals(TestValues.MATCH, testDuration, testAlert.getDuration());
- assertEquals(TestValues.MATCH, testCorrelationID, testAlert.getCorrelationID());
-
- testAlert = RPCRequestFactory.buildAlert((Vector<TTSChunk>) null, null, null, null, null, null);
- assertNull(TestValues.NULL, testAlert.getTtsChunks());
- assertNull(TestValues.NULL, testAlert.getAlertText1());
- assertNull(TestValues.NULL, testAlert.getAlertText2());
- assertNull(TestValues.NULL, testAlert.getPlayTone());
- assertNull(TestValues.NULL, testAlert.getDuration());
- assertNotNull(TestValues.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(TestValues.MATCH, testChoiceSet, testBCICS.getChoiceSet());
- assertEquals(TestValues.MATCH, testICSID, testBCICS.getInteractionChoiceSetID());
- assertEquals(TestValues.MATCH, testCorrelationID, testBCICS.getCorrelationID());
-
- testBCICS = RPCRequestFactory.buildCreateInteractionChoiceSet(null, null, null);
- assertNull(TestValues.NULL, testBCICS.getChoiceSet());
- assertNull(TestValues.NULL, testBCICS.getInteractionChoiceSetID());
- assertNotNull(TestValues.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(TestValues.MATCH, testCID, testDC.getCmdID());
- assertEquals(TestValues.MATCH, testCorrelationID, testDC.getCorrelationID());
-
- testDC = RPCRequestFactory.buildDeleteCommand(null, null);
- assertNull(TestValues.NULL, testDC.getCmdID());
- assertNotNull(TestValues.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(TestValues.MATCH, testCorrelationID, testDF.getCorrelationID());
- assertEquals(TestValues.MATCH, testFileName, testDF.getSdlFileName());
-
- testDF = RPCRequestFactory.buildDeleteFile(null, null);
- assertNotNull(TestValues.NOT_NULL, testDF.getCorrelationID());
- assertNull(TestValues.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(TestValues.MATCH, testICSID, testDICS.getInteractionChoiceSetID());
- assertEquals(TestValues.MATCH, testCorrelationID, testDICS.getCorrelationID());
-
- testDICS = RPCRequestFactory.buildDeleteInteractionChoiceSet(null, null);
- assertNull(TestValues.NULL, testDICS.getInteractionChoiceSetID());
- assertNotNull(TestValues.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(TestValues.MATCH, testMenuID, testDSM.getMenuID());
- assertEquals(TestValues.MATCH, testCorrelationID, testDSM.getCorrelationID());
-
- testDSM = RPCRequestFactory.buildDeleteSubMenu(null, null);
- assertNull(TestValues.NULL, testDSM.getMenuID());
- assertNotNull(TestValues.NOT_NULL, testDSM.getCorrelationID());
- }
-
- public void testBuildListFiles () {
-
- Integer testCorrelationID = 0;
- ListFiles testLF;
-
- // Test -- buildListFiles(Integer correlationID)
- testLF = RPCRequestFactory.buildListFiles(testCorrelationID);
- assertEquals(TestValues.MATCH, testCorrelationID, testLF.getCorrelationID());
-
- testLF = RPCRequestFactory.buildListFiles(null);
- assertNotNull(TestValues.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(TestValues.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt()));
- assertEquals(TestValues.MATCH, testDisplayText, testPI.getInitialText());
- assertTrue(TestValues.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList()));
- assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt()));
- assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testPI.getTimeoutPrompt()));
- assertEquals(TestValues.MATCH, testIM, testPI.getInteractionMode());
- assertEquals(TestValues.MATCH, testTimeout, testPI.getTimeout());
- assertTrue(TestValues.TRUE, Validator.validateVrHelpItems(testVrHelpItems, testPI.getVrHelp()));
- assertEquals(TestValues.MATCH, testCorrelationID, testPI.getCorrelationID());
-
- testPI = RPCRequestFactory.buildPerformInteraction((Vector<TTSChunk>) null, null, null, null, null, null, null, null, null);
- assertNull(TestValues.NULL, testPI.getInitialPrompt());
- assertNull(TestValues.NULL, testPI.getInitialText());
- assertNull(TestValues.NULL, testPI.getInteractionChoiceSetIDList());
- assertNull(TestValues.NULL, testPI.getHelpPrompt());
- assertNull(TestValues.NULL, testPI.getTimeoutPrompt());
- assertNull(TestValues.NULL, testPI.getInteractionMode());
- assertNull(TestValues.NULL, testPI.getTimeout());
- assertNull(TestValues.NULL, testPI.getVrHelp());
- assertNotNull(TestValues.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(TestValues.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt()));
- assertEquals(TestValues.MATCH, testDisplayText, testPI.getInitialText());
- assertTrue(TestValues.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList()));
- assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt()));
- assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testPI.getTimeoutPrompt()));
- assertEquals(TestValues.MATCH, testIM, testPI.getInteractionMode());
- assertEquals(TestValues.MATCH, testTimeout, testPI.getTimeout());
- assertEquals(TestValues.MATCH, testCorrelationID, testPI.getCorrelationID());
-
- testPI = RPCRequestFactory.buildPerformInteraction((Vector<TTSChunk>) null, null, null, null, null, null, null, null);
- assertNull(TestValues.NULL, testPI.getInitialPrompt());
- assertNull(TestValues.NULL, testPI.getInitialText());
- assertNull(TestValues.NULL, testPI.getInteractionChoiceSetIDList());
- assertNull(TestValues.NULL, testPI.getHelpPrompt());
- assertNull(TestValues.NULL, testPI.getTimeoutPrompt());
- assertNull(TestValues.NULL, testPI.getInteractionMode());
- assertNull(TestValues.NULL, testPI.getTimeout());
- assertNotNull(TestValues.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(TestValues.TRUE, Validator.validateTtsChunks(testInitChunks, testPI.getInitialPrompt()));
- assertEquals(TestValues.MATCH, testDisplayText, testPI.getInitialText());
- assertTrue(TestValues.TRUE, Validator.validateIntegerList(testCSIDs, testPI.getInteractionChoiceSetIDList()));
- assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testHelpChunks, testPI.getHelpPrompt()));
- assertEquals(TestValues.MATCH, testIM, testPI.getInteractionMode());
- assertEquals(TestValues.MATCH, testTimeout, testPI.getTimeout());
- assertEquals(TestValues.MATCH, testCorrelationID, testPI.getCorrelationID());
-
- testPI = RPCRequestFactory.buildPerformInteraction((Vector<TTSChunk>) null, null, null, null, null, null, null);
- assertNull(TestValues.NULL, testPI.getInitialPrompt());
- assertNull(TestValues.NULL, testPI.getInitialText());
- assertNull(TestValues.NULL, testPI.getInteractionChoiceSetIDList());
- assertNull(TestValues.NULL, testPI.getHelpPrompt());
- assertNull(TestValues.NULL, testPI.getInteractionMode());
- assertNull(TestValues.NULL, testPI.getTimeout());
- assertNotNull(TestValues.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(TestValues.MATCH, testFileName, testPF.getSdlFileName());
- assertEquals(TestValues.MATCH, testFileType, testPF.getFileType());
- assertEquals(TestValues.MATCH, testPFile, testPF.getPersistentFile());
- assertTrue(TestValues.TRUE, Validator.validateBulkData(testFileData, testPF.getFileData()));
- assertEquals(TestValues.MATCH, testCorrelationID, testPF.getCorrelationID());
-
- testPF = RPCRequestFactory.buildPutFile(null, null, null, null, null);
- assertNull(TestValues.NULL, testPF.getSdlFileName());
- assertNull(TestValues.NULL, testPF.getFileType());
- assertNull(TestValues.NULL, testPF.getPersistentFile());
- assertNull(TestValues.NULL, testPF.getFileData());
- assertNotNull(TestValues.NOT_NULL, testPF.getCorrelationID());
-
- // Test -- buildPutFile(String sdlFileName, Integer iOffset, Integer iLength)
- testPF = RPCRequestFactory.buildPutFile(testFileName, testOffset, testLength);
- assertEquals(TestValues.MATCH, testFileName, testPF.getSdlFileName());
- assertEquals(TestValues.MATCH, testOffset, testPF.getOffset());
- assertEquals(TestValues.MATCH, testLength, testPF.getLength());
-
- testPF = RPCRequestFactory.buildPutFile(NullValues.STRING, NullValues.INTEGER, NullValues.INTEGER);
- assertNull(TestValues.NULL, testPF.getSdlFileName());
- assertNull(TestValues.NULL, testPF.getOffset());
- assertNull(TestValues.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(TestValues.MATCH, testFileName, testPF.getSdlFileName());
- assertEquals(TestValues.MATCH, testOffset, testPF.getOffset());
- assertEquals(TestValues.MATCH, testLength, testPF.getLength());
- assertTrue(TestValues.TRUE, testPF.getPersistentFile());
- assertEquals(TestValues.MATCH, testSystemFile, testPF.getSystemFile());
-
- testPF = RPCRequestFactory.buildPutFile(NullValues.STRING, NullValues.INTEGER, NullValues.INTEGER, null, NullValues.BOOLEAN, NullValues.BOOLEAN);
- assertNull(TestValues.NULL, testPF.getSdlFileName());
- assertNull(TestValues.NULL, testPF.getOffset());
- assertNull(TestValues.NULL, testPF.getLength());
- assertNull(TestValues.NULL, testPF.getFileType());
- assertNull(TestValues.NULL, testPF.getPersistentFile());
- assertNull(TestValues.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(TestValues.TRUE, Validator.validateSdlMsgVersion(testSMV, testRAI.getSdlMsgVersion()));
- assertEquals(TestValues.MATCH, testAppName, testRAI.getAppName());
- assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTTSName, testRAI.getTtsName()));
- assertEquals(TestValues.MATCH, testNGN, testRAI.getNgnMediaScreenAppName());
- assertTrue(TestValues.TRUE, Validator.validateStringList(testSynonyms, testRAI.getVrSynonyms()));
- assertEquals(TestValues.MATCH, testIMA, testRAI.getIsMediaApplication());
- assertEquals(TestValues.MATCH, testLang, testRAI.getLanguageDesired());
- assertEquals(TestValues.MATCH, testHMILang, testRAI.getHmiDisplayLanguageDesired());
- assertEquals(TestValues.MATCH, AppHMIType.DEFAULT, testRAI.getAppHMIType().get(0));
- assertEquals(TestValues.MATCH, testAppID, testRAI.getAppID());
- assertEquals(TestValues.MATCH, testCorrelationID, testRAI.getCorrelationID());
- assertEquals(TestValues.MATCH, testDI, testRAI.getDeviceInfo());
-
-
- testRAI = RPCRequestFactory.buildRegisterAppInterface(null, null, null, null, null, null, null, null, null, null, null,null);
- assertEquals(TestValues.MATCH, (Integer) 1, testRAI.getCorrelationID());
- assertEquals(TestValues.MATCH, testSMV.getMajorVersion(), testRAI.getSdlMsgVersion().getMajorVersion());
- assertEquals(TestValues.MATCH, testSMV.getMinorVersion(), testRAI.getSdlMsgVersion().getMinorVersion());
- assertNull(TestValues.NULL, testRAI.getAppName());
- assertNull(TestValues.NULL, testRAI.getTtsName());
- assertNull(TestValues.NULL, testRAI.getNgnMediaScreenAppName());
- assertNull(TestValues.NULL, testRAI.getVrSynonyms());
- assertNull(TestValues.NULL, testRAI.getIsMediaApplication());
- assertNotNull(TestValues.NOT_NULL, testRAI.getLanguageDesired());
- assertNotNull(TestValues.NOT_NULL, testRAI.getHmiDisplayLanguageDesired());
- assertNull(TestValues.NULL, testRAI.getAppHMIType());
- assertNull(TestValues.NULL, testRAI.getAppID());
- assertNull(TestValues.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(TestValues.MATCH, testFileName, testSAI.getSdlFileName());
- assertEquals(TestValues.MATCH, testCorrelationID, testSAI.getCorrelationID());
-
- testSAI = RPCRequestFactory.buildSetAppIcon(null, null);
- assertNull(TestValues.NULL, testSAI.getSdlFileName());
- assertNotNull(TestValues.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(TestValues.TRUE, Validator.validateTtsChunks(testHelpChunks, testSBP.getHelpPrompt()));
- assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testSBP.getTimeoutPrompt()));
- assertEquals(TestValues.MATCH, testCorrelationID, testSBP.getCorrelationID());
-
- testSBP = RPCRequestFactory.buildSetGlobalProperties((Vector<TTSChunk>) null, null, null);
- assertNull(TestValues.NULL, testSBP.getHelpPrompt());
- assertNull(TestValues.NULL, testSBP.getTimeoutPrompt());
- assertNotNull(TestValues.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(TestValues.TRUE, Validator.validateTtsChunks(testHelpChunks, testSBP.getHelpPrompt()));
- assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTimeoutChunks, testSBP.getTimeoutPrompt()));
- assertEquals(TestValues.MATCH, testHelpTitle, testSBP.getVrHelpTitle());
- assertTrue(TestValues.TRUE, Validator.validateVrHelpItems(testVrHelp, testSBP.getVrHelp()));
- assertEquals(TestValues.MATCH, testCorrelationID, testSBP.getCorrelationID());
-
- testSBP = RPCRequestFactory.buildSetGlobalProperties((Vector<TTSChunk>) null, null, null, null, null);
- assertNull(TestValues.NULL, testSBP.getHelpPrompt());
- assertNull(TestValues.NULL, testSBP.getTimeoutPrompt());
- assertNull(TestValues.NULL, testSBP.getVrHelpTitle());
- assertNull(TestValues.NULL, testSBP.getVrHelp());
- assertNotNull(TestValues.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(TestValues.MATCH, hours, testSMCT.getStartTime().getHours());
- assertEquals(TestValues.MATCH, minutes, testSMCT.getStartTime().getMinutes());
- assertEquals(TestValues.MATCH, seconds, testSMCT.getStartTime().getSeconds());
- assertEquals(TestValues.MATCH, testMode, testSMCT.getUpdateMode());
- assertEquals(TestValues.MATCH, testCorrelationID, testSMCT.getCorrelationID());
-
- testSMCT = RPCRequestFactory.buildSetMediaClockTimer(null, null, null, null, null);
- assertNull(TestValues.NULL, testSMCT.getStartTime());
- assertNull(TestValues.NULL, testSMCT.getUpdateMode());
- assertNotNull(TestValues.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(TestValues.MATCH, testText1, testShow.getMainField1());
- assertEquals(TestValues.MATCH, testText2, testShow.getMainField2());
- assertEquals(TestValues.MATCH, testText3, testShow.getMainField3());
- assertEquals(TestValues.MATCH, testText4, testShow.getMainField4());
- assertEquals(TestValues.MATCH, testStatusBar, testShow.getStatusBar());
- assertEquals(TestValues.MATCH, testMediaClock, testShow.getMediaClock());
- assertEquals(TestValues.MATCH, testMediaTrack, testShow.getMediaTrack());
- assertTrue(TestValues.TRUE, Validator.validateImage(testGraphic, testShow.getGraphic()));
- assertTrue(TestValues.TRUE, Validator.validateSoftButtons(testSoftButtons, testShow.getSoftButtons()));
- assertTrue(TestValues.TRUE, Validator.validateStringList(testCustomPresets, testShow.getCustomPresets()));
- assertEquals(TestValues.MATCH, testAlignment, testShow.getAlignment());
- assertEquals(TestValues.MATCH, testCorrelationID, testShow.getCorrelationID());
-
- testShow = RPCRequestFactory.buildShow(null, null, null, null, null, null, null, null, null, null, null, null);
- assertNull(TestValues.NULL, testShow.getMainField1());
- assertNull(TestValues.NULL, testShow.getMainField2());
- assertNull(TestValues.NULL, testShow.getMainField3());
- assertNull(TestValues.NULL, testShow.getMainField4());
- assertNull(TestValues.NULL, testShow.getStatusBar());
- assertNull(TestValues.NULL, testShow.getMediaClock());
- assertNull(TestValues.NULL, testShow.getMediaTrack());
- assertNull(TestValues.NULL, testShow.getGraphic());
- assertNull(TestValues.NULL, testShow.getSoftButtons());
- assertNull(TestValues.NULL, testShow.getCustomPresets());
- assertNull(TestValues.NULL, testShow.getAlignment());
- assertNotNull(TestValues.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(TestValues.MATCH, testText1, testShow.getMainField1());
- assertEquals(TestValues.MATCH, testText2, testShow.getMainField2());
- assertEquals(TestValues.MATCH, testStatusBar, testShow.getStatusBar());
- assertEquals(TestValues.MATCH, testMediaClock, testShow.getMediaClock());
- assertEquals(TestValues.MATCH, testMediaTrack, testShow.getMediaTrack());
- assertEquals(TestValues.MATCH, testAlignment, testShow.getAlignment());
- assertEquals(TestValues.MATCH, testCorrelationID, testShow.getCorrelationID());
-
- testShow = RPCRequestFactory.buildShow(null, null, null, null, null, null, null);
- assertNull(TestValues.NULL, testShow.getMainField1());
- assertNull(TestValues.NULL, testShow.getMainField2());
- assertNull(TestValues.NULL, testShow.getStatusBar());
- assertNull(TestValues.NULL, testShow.getMediaClock());
- assertNull(TestValues.NULL, testShow.getMediaTrack());
- assertNull(TestValues.NULL, testShow.getAlignment());
- assertNotNull(TestValues.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(TestValues.TRUE, Validator.validateTtsChunks(testTTSChunks, testSpeak.getTtsChunks()));
- assertEquals(TestValues.MATCH, testCorrelationID, testSpeak.getCorrelationID());
-
- testSpeak = RPCRequestFactory.buildSpeak((String) null, null);
- assertNull(TestValues.NULL, testSpeak.getTtsChunks());
- assertNotNull(TestValues.NOT_NULL, testSpeak.getCorrelationID());
-
- // Test -- buildSpeak(Vector<TTSChunk> ttsChunks, Integer correlationID)
- testSpeak = RPCRequestFactory.buildSpeak(testTTSChunks, testCorrelationID);
- assertTrue(TestValues.TRUE, Validator.validateTtsChunks(testTTSChunks, testSpeak.getTtsChunks()));
- assertEquals(TestValues.MATCH, testCorrelationID, testSpeak.getCorrelationID());
-
- testSpeak = RPCRequestFactory.buildSpeak((Vector<TTSChunk>) null, null);
- assertNull(TestValues.NULL, testSpeak.getTtsChunks());
- assertNotNull(TestValues.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(TestValues.MATCH, testButtonName, testSB.getButtonName());
- assertEquals(TestValues.MATCH, testCorrelationID, testSB.getCorrelationID());
-
- testSB = RPCRequestFactory.buildSubscribeButton(null, null);
- assertNull(TestValues.NULL, testSB.getButtonName());
- assertNotNull(TestValues.NOT_NULL, testSB.getCorrelationID());
-
- }
-
- public void testBuildUnregisterAppInterface () {
-
- Integer testCorrelationID = 0;
- UnregisterAppInterface testUAI;
-
- // Test -- buildUnregisterAppInterface(Integer correlationID)
- testUAI = RPCRequestFactory.buildUnregisterAppInterface(testCorrelationID);
- assertEquals(TestValues.MATCH, testCorrelationID, testUAI.getCorrelationID());
-
- testUAI = RPCRequestFactory.buildUnregisterAppInterface(null);
- assertNotNull(TestValues.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(TestValues.MATCH, testButtonName, testUB.getButtonName());
- assertEquals(TestValues.MATCH, testCorrelationID, testUB.getCorrelationID());
-
- testUB = RPCRequestFactory.buildUnsubscribeButton(null, null);
- assertNull(TestValues.NULL, testUB.getButtonName());
- assertNotNull(TestValues.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(TestValues.TRUE, testSVD.getGps());
- assertTrue(TestValues.TRUE, testSVD.getSpeed());
- assertTrue(TestValues.TRUE, testSVD.getRpm());
- assertTrue(TestValues.TRUE, testSVD.getFuelLevel());
- assertTrue(TestValues.TRUE, testSVD.getFuelLevelState());
- assertTrue(TestValues.TRUE, testSVD.getInstantFuelConsumption());
- assertTrue(TestValues.TRUE, testSVD.getExternalTemperature());
- assertTrue(TestValues.TRUE, testSVD.getPrndl());
- assertTrue(TestValues.TRUE, testSVD.getTirePressure());
- assertTrue(TestValues.TRUE, testSVD.getOdometer());
- assertTrue(TestValues.TRUE, testSVD.getBeltStatus());
- assertTrue(TestValues.TRUE, testSVD.getBodyInformation());
- assertTrue(TestValues.TRUE, testSVD.getDeviceStatus());
- assertTrue(TestValues.TRUE, testSVD.getDriverBraking());
- assertEquals(TestValues.MATCH, testCorrelationID, testSVD.getCorrelationID());
-
- testSVD = RPCRequestFactory.BuildSubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, null);
- assertNotNull(TestValues.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(TestValues.TRUE, testUVD.getGps());
- assertTrue(TestValues.TRUE, testUVD.getSpeed());
- assertTrue(TestValues.TRUE, testUVD.getRpm());
- assertTrue(TestValues.TRUE, testUVD.getFuelLevel());
- assertTrue(TestValues.TRUE, testUVD.getFuelLevelState());
- assertTrue(TestValues.TRUE, testUVD.getInstantFuelConsumption());
- assertTrue(TestValues.TRUE, testUVD.getExternalTemperature());
- assertTrue(TestValues.TRUE, testUVD.getPrndl());
- assertTrue(TestValues.TRUE, testUVD.getTirePressure());
- assertTrue(TestValues.TRUE, testUVD.getOdometer());
- assertTrue(TestValues.TRUE, testUVD.getBeltStatus());
- assertTrue(TestValues.TRUE, testUVD.getBodyInformation());
- assertTrue(TestValues.TRUE, testUVD.getDeviceStatus());
- assertTrue(TestValues.TRUE, testUVD.getDriverBraking());
- assertEquals(TestValues.MATCH, testCorrelationID, testUVD.getCorrelationID());
-
- testUVD = RPCRequestFactory.BuildUnsubscribeVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, null);
- assertNotNull(TestValues.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(TestValues.TRUE, testGVD.getGps());
- assertTrue(TestValues.TRUE, testGVD.getSpeed());
- assertTrue(TestValues.TRUE, testGVD.getRpm());
- assertTrue(TestValues.TRUE, testGVD.getFuelLevel());
- assertTrue(TestValues.TRUE, testGVD.getFuelLevelState());
- assertTrue(TestValues.TRUE, testGVD.getInstantFuelConsumption());
- assertTrue(TestValues.TRUE, testGVD.getExternalTemperature());
- assertTrue(TestValues.TRUE, testGVD.getPrndl());
- assertTrue(TestValues.TRUE, testGVD.getTirePressure());
- assertTrue(TestValues.TRUE, testGVD.getOdometer());
- assertTrue(TestValues.TRUE, testGVD.getBeltStatus());
- assertTrue(TestValues.TRUE, testGVD.getBodyInformation());
- assertTrue(TestValues.TRUE, testGVD.getDeviceStatus());
- assertTrue(TestValues.TRUE, testGVD.getDriverBraking());
- assertTrue(TestValues.TRUE, testGVD.getVin());
- assertEquals(TestValues.MATCH, testCorrelationID, testGVD.getCorrelationID());
-
- testGVD = RPCRequestFactory.BuildGetVehicleData(testGPS, testSpeed, testRPM, testFuelLevel, testFuelLevelState, testInstantFuelConsumption, testExternalTemperature, testVIN, testPRNDL, testTirePressure, testOdometer, testBeltStatus, testBodyInformation, testDeviceStatus, testDriverBraking, null);
- assertNotNull(TestValues.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(TestValues.MATCH, testSMB, testSM.getScrollableMessageBody());
- assertEquals(TestValues.MATCH, testTimeout, testSM.getTimeout());
- assertTrue(TestValues.TRUE, Validator.validateSoftButtons(testSoftButtons, testSM.getSoftButtons()));
- assertEquals(TestValues.MATCH, testCorrelationID, testSM.getCorrelationID());
-
- testSM = RPCRequestFactory.BuildScrollableMessage(null, null, null, null);
- assertNull(TestValues.NULL, testSM.getScrollableMessageBody());
- assertNull(TestValues.NULL, testSM.getTimeout());
- assertNull(TestValues.NULL, testSM.getSoftButtons());
- assertNotNull(TestValues.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(TestValues.MATCH, testTicks, testSlider.getNumTicks());
- assertEquals(TestValues.MATCH, testPosition, testSlider.getPosition());
- assertEquals(TestValues.MATCH, testHeader, testSlider.getSliderHeader());
- assertTrue(TestValues.TRUE, Validator.validateStringList(testFooter, testSlider.getSliderFooter()));
- assertEquals(TestValues.MATCH, testCorrelationID, testSlider.getCorrelationID());
-
- testSlider = RPCRequestFactory.BuildSlider(null, null, null, null, null, null);
- assertNull(TestValues.NULL, testSlider.getNumTicks());
- assertNull(TestValues.NULL, testSlider.getPosition());
- assertNull(TestValues.NULL, testSlider.getSliderHeader());
- assertNull(TestValues.NULL, testSlider.getSliderFooter());
- assertNull(TestValues.NULL, testSlider.getTimeout());
- assertNotNull(TestValues.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(TestValues.MATCH, testLang, testCR.getLanguage());
- assertEquals(TestValues.MATCH, testHMILang, testCR.getHmiDisplayLanguage());
- assertEquals(TestValues.MATCH, testCorrelationID, testCR.getCorrelationID());
-
- testCR = RPCRequestFactory.BuildChangeRegistration(null, null, null);
- assertNull(TestValues.NULL, testCR.getLanguage());
- assertNull(TestValues.NULL, testCR.getHmiDisplayLanguage());
- assertNotNull(TestValues.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(TestValues.MATCH, testDL, testSDL.getDisplayLayout());
- assertEquals(TestValues.MATCH, testCorrelationID, testSDL.getCorrelationID());
-
- testSDL = RPCRequestFactory.BuildSetDisplayLayout(null, null);
- assertNull(TestValues.NULL, testSDL.getDisplayLayout());
- assertNotNull(TestValues.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(TestValues.TRUE, Validator.validateTtsChunks(testInitialPrompt, testPAPT.getInitialPrompt()));
- assertEquals(TestValues.MATCH, testAPTDT1, testPAPT.getAudioPassThruDisplayText1());
- assertEquals(TestValues.MATCH, testAPTDT2, testPAPT.getAudioPassThruDisplayText2());
- assertEquals(TestValues.MATCH, testSR, testPAPT.getSamplingRate());
- assertEquals(TestValues.MATCH, testMaxDuration, testPAPT.getMaxDuration());
- assertEquals(TestValues.MATCH, testBits, testPAPT.getBitsPerSample());
- assertEquals(TestValues.MATCH, testAT, testPAPT.getAudioType());
- assertEquals(TestValues.MATCH, testMute, testPAPT.getMuteAudio());
- assertEquals(TestValues.MATCH, testCorrelationID, testPAPT.getCorrelationID());
-
- testPAPT = RPCRequestFactory.BuildPerformAudioPassThru((Vector<TTSChunk>) null, null, null, null, null, null, null, null, null);
- assertNull(TestValues.NULL, testPAPT.getInitialPrompt());
- assertNull(TestValues.NULL, testPAPT.getAudioPassThruDisplayText1());
- assertNull(TestValues.NULL, testPAPT.getAudioPassThruDisplayText2());
- assertNull(TestValues.NULL, testPAPT.getSamplingRate());
- assertNull(TestValues.NULL, testPAPT.getMaxDuration());
- assertNull(TestValues.NULL, testPAPT.getBitsPerSample());
- assertNull(TestValues.NULL, testPAPT.getAudioType());
- assertNull(TestValues.NULL, testPAPT.getMuteAudio());
- assertNotNull(TestValues.NOT_NULL, testPAPT.getCorrelationID());
- }
-
- public void testBuildEndAudioPassThru () {
-
- Integer testCorrelationID = 0;
- EndAudioPassThru testEAPT;
-
- // Test -- BuildEndAudioPassThru(Integer correlationID)
- testEAPT = RPCRequestFactory.BuildEndAudioPassThru(testCorrelationID);
- assertEquals(TestValues.MATCH, testCorrelationID, testEAPT.getCorrelationID());
-
- testEAPT = RPCRequestFactory.BuildEndAudioPassThru(null);
- assertNotNull(TestValues.NOT_NULL, testEAPT.getCorrelationID());
- }
-} \ No newline at end of file
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
deleted file mode 100644
index da8b48d8c..000000000
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/SdlProxyBaseTests.java
+++ /dev/null
@@ -1,298 +0,0 @@
-package com.smartdevicelink.test.proxy;
-
-import android.content.Context;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import android.telephony.TelephonyManager;
-import android.util.Log;
-
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.exception.SdlExceptionCause;
-import com.smartdevicelink.proxy.RPCMessage;
-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.interfaces.IProxyListenerALM;
-import com.smartdevicelink.proxy.rpc.Show;
-import com.smartdevicelink.proxy.rpc.ShowResponse;
-import com.smartdevicelink.proxy.rpc.Speak;
-import com.smartdevicelink.proxy.rpc.SpeakResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
-import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
-import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
-import com.smartdevicelink.streaming.video.SdlRemoteDisplay;
-import com.smartdevicelink.streaming.video.VideoStreamingParameters;
-import com.smartdevicelink.test.streaming.video.SdlRemoteDisplayTest;
-
-import junit.framework.Assert;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import static junit.framework.TestCase.assertEquals;
-import static junit.framework.TestCase.assertNotNull;
-import static junit.framework.TestCase.assertTrue;
-import static junit.framework.TestCase.fail;
-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 androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
-
-@RunWith(AndroidJUnit4.class)
-public class SdlProxyBaseTests {
- public static final String TAG = "SdlProxyBaseTests";
-
- int onUpdateListenerCounter, onFinishedListenerCounter, onResponseListenerCounter, onErrorListenerCounter, remainingRequestsExpected;
-
- /**
- * Test SdlProxyBase for handling null SdlProxyConfigurationResources
- */
- @Test
- public void testNullSdlProxyConfigurationResources() {
- SdlProxyALM proxy = null;
- SdlProxyBuilder.Builder builder = new SdlProxyBuilder.Builder(mock(IProxyListenerALM.class), "appId", "appName", true, getInstrumentation().getTargetContext());
- SdlProxyConfigurationResources config = new SdlProxyConfigurationResources("path", (TelephonyManager) getInstrumentation().getTargetContext().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();
- }
- }
- }
-
- @Test
- public void testRemoteDisplayStreaming(){
- SdlProxyALM proxy = null;
- SdlProxyBuilder.Builder builder = new SdlProxyBuilder.Builder(mock(IProxyListenerALM.class), "appId", "appName", true, getInstrumentation().getTargetContext());
- 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,getInstrumentation().getTargetContext(), SdlRemoteDisplayTest.MockRemoteDisplay.class, (VideoStreamingParameters)null, false);
- assert true;
-
- }catch (Exception e){
- assert false;
- }
- }
-
- @Test
- public void testSendRPCsAllSucceed(){
- testSendMultipleRPCs(false, 1);
- }
-
- @Test
- public void testSendRPCsSomeFail(){
- testSendMultipleRPCs(false, 2);
- }
-
- @Test
- public void testSendSequentialRPCsAllSucceed(){
- testSendMultipleRPCs(true, 1);
- }
-
- @Test
- public void testSendSequentialRPCsSomeFail(){
- testSendMultipleRPCs(true, 2);
- }
-
- private void testSendMultipleRPCs(boolean sequentialSend, int caseNumber){
- final List<RPCRequest> rpcsList = new ArrayList<>();
- final List<RPCRequest> rpcsTempList = new ArrayList<>();
- final HashMap<RPCRequest, OnRPCResponseListener> requestsMap = new HashMap<>();
- onUpdateListenerCounter = 0;
- onFinishedListenerCounter = 0;
- onResponseListenerCounter = 0;
- onErrorListenerCounter = 0;
-
-
- // We extend the SdlProxyBase to be able to override getIsConnected() & sendRPCMessagePrivate() methods so they don't cause issues when trying to send RPCs
- // Because otherwise, they will throw exception cause there not actual connection to head unit
- SdlProxyBase proxy = new SdlProxyBase() {
-
- @Override
- public Boolean getIsConnected() {
- return true;
- }
-
- @Override
- protected void sendRPCMessagePrivate(RPCMessage message) {
- // Do nothing
- }
- };
-
-
- // We need to get list of all OnRPCResponseListeners so we can trigger onResponse/onError for each RPC to fake a response from Core
- final Answer<Void> answer = new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocation) {
- Object[] args = invocation.getArguments();
- RPCRequest request = (RPCRequest) invocation.getMock();
- OnRPCResponseListener listener = (OnRPCResponseListener) args[0];
- requestsMap.put(request, listener);
- rpcsTempList.add(request);
- return null;
- }
- };
-
-
- // Prepare RPCs to send
- Speak speak = mock(Speak.class);
- doReturn(RPCMessage.KEY_REQUEST).when(speak).getMessageType();
- doAnswer(answer).when(speak).setOnRPCResponseListener(any(OnRPCResponseListener.class));
- rpcsList.add(speak);
-
- Show show = mock(Show.class);
- doReturn(RPCMessage.KEY_REQUEST).when(show).getMessageType();
- doAnswer(answer).when(show).setOnRPCResponseListener(any(OnRPCResponseListener.class));
- rpcsList.add(show);
-
-
- // Send RPCs
- remainingRequestsExpected = rpcsList.size();
- OnMultipleRequestListener onMultipleRequestListener = new OnMultipleRequestListener() {
- @Override
- public void onUpdate(int remainingRequests) {
- onUpdateListenerCounter++;
- assertEquals(remainingRequestsExpected, remainingRequests);
- }
-
- @Override
- public void onFinished() {
- onFinishedListenerCounter++;
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- onErrorListenerCounter++;
- remainingRequestsExpected--;
- }
-
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- onResponseListenerCounter++;
- remainingRequestsExpected--;
- }
- };
- try {
- if (sequentialSend) {
- proxy.sendSequentialRequests(rpcsList, onMultipleRequestListener);
- } else {
- proxy.sendRequests(rpcsList, onMultipleRequestListener);
- }
- assertTrue(true);
- } catch (SdlException e) {
- e.printStackTrace();
- fail();
- }
-
-
- // Trigger fake RPC responses
- int onUpdateListenerCounterExpected = 0, onFinishedListenerCounterExpected = 0, onResponseListenerCounterExpected = 0, onErrorListenerCounterExpected = 0;
- switch (caseNumber){
- case 1: // All RPCs succeed
- onUpdateListenerCounterExpected = 2;
- onFinishedListenerCounterExpected = 1;
- onResponseListenerCounterExpected = 2;
- onErrorListenerCounterExpected = 0;
-
- while (rpcsTempList.size() != 0){
- RPCRequest request = rpcsTempList.remove(0);
- if (request instanceof Speak) {
- requestsMap.get(request).onResponse(request.getCorrelationID(), new SpeakResponse(true, Result.SUCCESS));
- } else if (request instanceof Show) {
- requestsMap.get(request).onResponse(request.getCorrelationID(), new ShowResponse(true, Result.SUCCESS));
- }
- }
- break;
- case 2: // Some RPCs fail
- onUpdateListenerCounterExpected = 2;
- onFinishedListenerCounterExpected = 1;
- onResponseListenerCounterExpected = 1;
- onErrorListenerCounterExpected = 1;
-
- while (rpcsTempList.size() != 0){
- RPCRequest request = rpcsTempList.remove(0);
- if (request instanceof Speak) {
- requestsMap.get(request).onError(request.getCorrelationID(), Result.DISALLOWED, "ERROR");
- } else if (request instanceof Show) {
- requestsMap.get(request).onResponse(request.getCorrelationID(), new ShowResponse(true, Result.SUCCESS));
- }
- }
- break;
- }
-
-
- // Make sure the listener is called correctly
- assertEquals("onUpdate Listener was not called or called more/less frequently than expected", onUpdateListenerCounterExpected, onUpdateListenerCounter);
- assertEquals("onFinished Listener was not called or called more/less frequently than expected", onFinishedListenerCounterExpected, onFinishedListenerCounter);
- assertEquals("onResponse Listener was not called or called more/less frequently than expected", onResponseListenerCounterExpected, onResponseListenerCounter);
- assertEquals("onError Listener was not called or called more/less frequently than expected", onErrorListenerCounterExpected, onErrorListenerCounter);
- }
-}
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
deleted file mode 100644
index ad1976cb1..000000000
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/proxy/TTSChunkFactoryTests.java
+++ /dev/null
@@ -1,100 +0,0 @@
-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.TestValues;
-
-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, TestValues.GENERAL_STRING);
- assertNotNull(TestValues.NOT_NULL, testChunk);
- assertEquals(TestValues.MATCH, testType, testChunk.getType());
- assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunk.getText());
-
- testType = SpeechCapabilities.SILENCE;
- testChunk = TTSChunkFactory.createChunk(testType, TestValues.GENERAL_STRING);
- assertNotNull(TestValues.NOT_NULL, testChunk);
- assertEquals(TestValues.MATCH, testType, testChunk.getType());
- assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunk.getText());
-
- testType = SpeechCapabilities.SAPI_PHONEMES;
- testChunk = TTSChunkFactory.createChunk(testType, TestValues.GENERAL_STRING);
- assertNotNull(TestValues.NOT_NULL, testChunk);
- assertEquals(TestValues.MATCH, testType, testChunk.getType());
- assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunk.getText());
-
- testType = SpeechCapabilities.PRE_RECORDED;
- testChunk = TTSChunkFactory.createChunk(testType, TestValues.GENERAL_STRING);
- assertNotNull(TestValues.NOT_NULL, testChunk);
- assertEquals(TestValues.MATCH, testType, testChunk.getType());
- assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunk.getText());
-
- testType = SpeechCapabilities.LHPLUS_PHONEMES;
- testChunk = TTSChunkFactory.createChunk(testType, TestValues.GENERAL_STRING);
- assertNotNull(TestValues.NOT_NULL, testChunk);
- assertEquals(TestValues.MATCH, testType, testChunk.getType());
- assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunk.getText());
-
- // Invalid/Null Tests
- testChunk = TTSChunkFactory.createChunk(null, null);
- assertNotNull(TestValues.NOT_NULL, testChunk);
- assertNull(TestValues.NULL, testChunk.getType());
- assertNull(TestValues.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(TestValues.GENERAL_STRING);
-
- // Valid Tests
- assertNotNull(TestValues.NOT_NULL, testChunks);
- assertEquals(TestValues.MATCH, SpeechCapabilities.TEXT, testChunks.get(0).getType());
- assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunks.get(0).getText());
-
- // Invalid/Null Tests
- testChunks = TTSChunkFactory.createSimpleTTSChunks(null);
- assertNull(TestValues.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(TestValues.GENERAL_STRING);
-
- // Valid Tests
- assertNotNull(TestValues.NOT_NULL, testChunks);
- assertEquals(TestValues.MATCH, SpeechCapabilities.PRE_RECORDED, testChunks.get(0).getType());
- assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testChunks.get(0).getText());
-
- // Invalid/Null Tests
- testChunks = TTSChunkFactory.createPrerecordedTTSChunks(null);
- assertNull(TestValues.NULL, testChunks);
- }
-} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java
deleted file mode 100644
index 64f22a673..000000000
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCConstructorsTests.java
+++ /dev/null
@@ -1,339 +0,0 @@
-package com.smartdevicelink.test.rpc;
-
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlPullParserFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
-import static junit.framework.TestCase.assertTrue;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project
- * It makes sure that for each RPC, all mandatory parameters are set in a constructor
- */
-
-@RunWith(AndroidJUnit4.class)
-public class RPCConstructorsTests {
-
- private final String XML_FILE_NAME = "xml/MOBILE_API.xml";
- private final String RPC_PACKAGE_PREFIX = "com.smartdevicelink.proxy.rpc.";
- private Map<String, List<Parameter>> rpcMandatoryParamsMapFromXml;
-
- private class Parameter {
- private String name;
- private String type;
- private boolean isArray;
-
- public Parameter(String name, String type, boolean isArray) {
- this.name = name;
- this.type = type;
- this.isArray = isArray;
- }
- }
-
- @Before
- public void setUp(){
- // Map that has keys correspond to the RPC names and values correspond to the
- // mandatory params for that RPC. All info are loaded from the RPC spec xml file
- rpcMandatoryParamsMapFromXml = getRPCMandatoryParamsMap(XML_FILE_NAME);
-
- }
-
- // This method parses the RPC spec xml file and returns a map that has
- // keys correspond to the RPC names and values correspond to the mandatory params for that RPC
- private Map<String, List<Parameter>> getRPCMandatoryParamsMap(String fileName) {
- Map<String, List<Parameter>> rpcMandatoryParamsMap = new HashMap<>();
- try {
- InputStream stream = getInstrumentation().getTargetContext().getAssets().open(fileName);
- XmlPullParserFactory xmlFactoryObject = XmlPullParserFactory.newInstance();
- XmlPullParser myParser = xmlFactoryObject.newPullParser();
- myParser.setInput(stream, null);
- int event = myParser.getEventType();
- String rpcName = null;
- boolean ignoreRPC = false;
- while (event != XmlPullParser.END_DOCUMENT) {
- String name = myParser.getName();
- switch (event){
- case XmlPullParser.START_TAG:
- // Store the RPC name in the map
- if(name.equals("function") || name.equals("struct")){
- rpcName = myParser.getAttributeValue(null,"name");
- ignoreRPC = false;
- if (name.equals("function") && myParser.getAttributeValue(null, "messagetype").equals("response") && !rpcName.contains("Response")){
- rpcName += "Response";
- }
-
- // -------------- Exceptional cases because of mismatch between the RPC spec and the Android code --------------
- if(rpcName.equals("SyncMsgVersion")){
- rpcName = "SdlMsgVersion";
- } else if(rpcName.equals("ShowConstantTBTResponse")){
- rpcName = "ShowConstantTbtResponse";
- } else if(rpcName.equals("OASISAddress")) {
- rpcName = "OasisAddress";
- } else if(rpcName.equals("ShowConstantTBT")) {
- rpcName = "ShowConstantTbt";
- } else if (rpcName.equals("EncodedSyncPData") || rpcName.equals("OnEncodedSyncPData") || rpcName.equals("EncodedSyncPDataResponse")){
- ignoreRPC = true;
- }
- // -------------------------------------------------------------------------------------------------------------
-
- if (!ignoreRPC) {
- rpcMandatoryParamsMap.put(rpcName, new ArrayList<Parameter>());
- }
- }
- // Store the mandatory params for the current RPC in the map
- if(name.equals("param") && myParser.getAttributeValue(null, "until") == null && !ignoreRPC){
- boolean mandatory = Boolean.valueOf(myParser.getAttributeValue(null,"mandatory"));
- if (mandatory) {
- String paramName = myParser.getAttributeValue(null, "name");
- String paramType = myParser.getAttributeValue(null, "type");
- boolean paramIsArray = Boolean.valueOf(myParser.getAttributeValue(null, "array"));
-
- // -------------- Exceptional cases because of mismatch between the RPC spec and the Android code --------------
- if (paramType.equals("SyncMsgVersion")){
- paramType = "SdlMsgVersion";
- } else if (rpcName.equals("GPSData") && paramType.equals("Float")){
- paramType = "Double";
- } else if (rpcName.equals("TouchEvent") && paramType.equals("Integer") && paramIsArray){
- paramType = "Long";
- }
-
- if (paramName.equals("syncFileName")){
- paramName = "sdlFileName";
- } else if (paramName.equals("syncMsgVersion")){
- paramName = "sdlMsgVersion";
- } else if (paramName.equals("hmiPermissions")){
- paramName = "hMIPermissions";
- } else if (paramName.equals("resolution")){
- paramName = "imageResolution";
- } else if (paramName.equals("pressureTelltale")){
- paramName = "pressureTellTale";
- }
- // -------------------------------------------------------------------------------------------------------------
-
- Parameter param = new Parameter(paramName, paramType, paramIsArray);
- rpcMandatoryParamsMap.get(rpcName).add(param);
- }
- }
- break;
- }
- event = myParser.next();
- }
- stream.close();
- } catch (IOException | XmlPullParserException e) {
- e.printStackTrace();
- }
- return rpcMandatoryParamsMap;
- }
-
- // This method makes sure that for every RPC, there is a constructor that has all the mandatory params
- // It also checks if there are RPC in the XML file that don't exist in the code
- @Test
- public void testMandatoryParamsMatch() {
- // List of RPC names that don't have a constructor that has all mandatory params
- List<String> rpcsWithInvalidConstructor = new ArrayList<>();
-
- // List of the RPC names that couldn't be found in code
- // potentially because of a mismatch between name in the RPC spec xml file and name in code
- List<String> rpcsFromXmlNotFoundInCode = new ArrayList<>();
-
- // Loop through all RPCs that were loaded from RPC spec XML file
- // and make sure that every RPC has a constructor that has all mandatory params
- for (String rpcName : rpcMandatoryParamsMapFromXml.keySet()) {
- Class aClass;
- try {
- aClass = Class.forName(RPC_PACKAGE_PREFIX + rpcName);
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- rpcsFromXmlNotFoundInCode.add(rpcName);
- continue;
- }
- List<String> mandatoryParamsListFromXML = new ArrayList<>();
- for (Parameter param : rpcMandatoryParamsMapFromXml.get(rpcName)) {
- String type = param.type;
- // If the param is a list of objects, the type should be like "List<Object>"
- if (param.isArray){
- type = String.format("List<%s>", type);
- }
- mandatoryParamsListFromXML.add(type);
- }
- List<String> mandatoryParamsListFromCode = new ArrayList<>();
- boolean rpcHasValidConstructor = false;
- for (Constructor constructor : aClass.getConstructors()){
- mandatoryParamsListFromCode.clear();
- for (Type paramType : constructor.getGenericParameterTypes()){
- String paramFullType = paramType.toString();
- String paramSimpleType;
-
- // If the param is a list of objects, the type should be like "List<Object>"
- if (paramFullType.matches("java.util.List<.+>")) {
- paramSimpleType = String.format("List<%s>", paramFullType.substring(paramFullType.lastIndexOf('.') + 1, paramFullType.length() - 1));
- }
- // If the param is a simple object for example "java.lang.String", the type should be the last part "String"
- else if (!paramFullType.contains(">")){
- paramSimpleType = paramFullType.substring(paramFullType.lastIndexOf('.') + 1, paramFullType.length());
- }
- else {
- paramSimpleType = paramFullType;
- }
- mandatoryParamsListFromCode.add(paramSimpleType);
- }
- if (mandatoryParamsListFromCode.containsAll(mandatoryParamsListFromXML) && mandatoryParamsListFromXML.containsAll(mandatoryParamsListFromCode)){
- rpcHasValidConstructor = true;
- break;
- }
- }
- if (!rpcHasValidConstructor){
- rpcsWithInvalidConstructor.add(rpcName);
- }
- }
- assertTrue("The following RPCs were not found in the code: " + rpcsFromXmlNotFoundInCode, rpcsFromXmlNotFoundInCode.isEmpty());
- assertTrue("The following RPCs don't have a constructor that has all the mandatory params: " + rpcsWithInvalidConstructor, rpcsWithInvalidConstructor.isEmpty());
- }
-
- // This method makes sure that for every RPC, the constructor that has the mandatory params is setting the values correctly
- @Test
- public void testMandatoryParamsValues() {
- // List of RPC names that have a constructor which is not settings the values for the mandatory params correctly
- List<String> rpcsWithInvalidConstructor = new ArrayList<>();
-
- // List of types that exist in java.lang.*
- List<String> javaLangBuiltInTypes = Arrays.asList("String", "Integer", "Float", "Double", "Boolean");
-
- // Loop through all RPCs that were loaded from RPC spec XML file
- // and make sure that the constructor that has the mandatory params is setting the values correctly
- for (String rpcName : rpcMandatoryParamsMapFromXml.keySet()) {
- Class aClass;
- try {
- aClass = Class.forName(RPC_PACKAGE_PREFIX + rpcName);
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- continue;
- }
-
- List<Parameter> parameters = rpcMandatoryParamsMapFromXml.get(rpcName);
- List<Class<?>> mandatoryParamsTypes = new ArrayList<>();
- List<Object> mandatoryParamsValues = new ArrayList<>();
-
- // Loop through all mandatory params for the current RPC
- // and try to find the full Java type for each param
- // also assign a value for each param from com.smartdevicelink.test.Test class
- for (Parameter param : parameters) {
- String typeString = null;
- Class<?> type = null;
- String valueString = null;
- Object value = null;
-
- // Find the full Java type for the current param
- try {
- if (param.isArray) {
- type = List.class;
- } else {
- if (javaLangBuiltInTypes.contains(param.type)){
- typeString = "java.lang." + param.type;
- } else {
- typeString = RPC_PACKAGE_PREFIX + param.type;
- }
- type = Class.forName(typeString);
- }
-
- } catch (ClassNotFoundException e) {
- // If the class was not found in the com.smartdevicelink.proxy.rpc package
- // try to see if it can be found in com.smartdevicelink.proxy.rpc.enums package
- typeString = RPC_PACKAGE_PREFIX + "enums." + param.type;
- try {
- type = Class.forName(typeString);
- } catch (ClassNotFoundException e1) {
- e1.printStackTrace();
- assertTrue("Type: " + typeString + " cannot be found for RPC: " + rpcName , false);
- }
- }
-
-
- // Assign a value for the current param from com.smartdevicelink.test.Test based of the param type
- try {
- // --------------------------------------------- Exceptional cases ---------------------------------------------
- // This case is exceptional because the setter changes the input if it is not all digits
- if (rpcName.equals("DialNumber") && param.type.equals("String")){
- value = "5558675309";
- }
- // -------------------------------------------------------------------------------------------------------------
-
- if (value == null) {
- valueString = "GENERAL_" + param.type.toUpperCase();
- if (param.isArray){
- valueString += "_LIST";
- }
- value = Class.forName("com.smartdevicelink.test.TestValues").getDeclaredField(valueString).get(null);
- }
-
- } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
- e.printStackTrace();
- assertTrue("Value: " + valueString + " cannot be found for RPC: " + rpcName + ". Make sure that you declared that value in com.smartdevicelink.test.Test" , false);
- }
-
- mandatoryParamsTypes.add(type);
- mandatoryParamsValues.add(value);
- }
-
-
- // Create an instance of the RPC object using the constructor that has all the mandatory params
- Object instance = null;
- try {
- Constructor constructor = aClass.getConstructor(mandatoryParamsTypes.toArray(new Class<?>[mandatoryParamsTypes.size()]));
- instance = constructor.newInstance(mandatoryParamsValues.toArray(new Object[mandatoryParamsValues.size()]));
- } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {
- e.printStackTrace();
- assertTrue("Constructor for RPC " + rpcName + " cannot be invoked. Make sure that the constructor parameters order and types are identical to the RPC specs", false);
- }
-
-
- // Loop through all getter methods for the instance and make sure that they are returning the expected values
- if (instance != null) {
- for (int i = 0; i < parameters.size(); i++) {
- // Find the getter method name by taking the param name, capitalize the first letter, then add thw word "get" to the beginning
- // for example if the param name is "buttonName" the method name will be "getButtonName"
- String getterMethodName = "get" + parameters.get(i).name.substring(0, 1).toUpperCase() + parameters.get(i).name.substring(1);
-
- // --------------------------------------------- Exceptional cases ---------------------------------------------
- if (rpcName.equals("CancelInteraction") && getterMethodName.equals("getFunctionID")){
- getterMethodName = "getInteractionFunctionID";
- }
- // -------------------------------------------------------------------------------------------------------------
-
- try {
- Method getterMethod = aClass.getMethod(getterMethodName);
- Object val = getterMethod.invoke(instance);
- if (val == null || !val.equals(mandatoryParamsValues.get(i))) {
- rpcsWithInvalidConstructor.add(rpcName);
- break;
- }
- } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
- e.printStackTrace();
- assertTrue("Method: " + getterMethodName + " cannot be found for RPC: " + rpcName + ". Make sure that the method exists and that the parameters order and types are identical to the RPC specs", false);
-
- }
- }
- }
- }
-
- assertTrue("The following RPCs have a constructor that is not setting the mandatory params correctly: " + rpcsWithInvalidConstructor, rpcsWithInvalidConstructor.isEmpty());
- }
-}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCGenericTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCGenericTests.java
new file mode 100644
index 000000000..092f7031b
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCGenericTests.java
@@ -0,0 +1,662 @@
+package com.smartdevicelink.test.rpc;
+
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
+import static junit.framework.TestCase.assertNotNull;
+import static junit.framework.TestCase.assertTrue;
+import static junit.framework.TestCase.fail;
+
+@RunWith(AndroidJUnit4.class)
+public class RPCGenericTests {
+
+ private final String XML_FILE_NAME = "MOBILE_API.xml";
+ private final String RPC_PACKAGE_PREFIX = "com.smartdevicelink.proxy.rpc.";
+ private final String TEST_VALUES_CLASS = "com.smartdevicelink.test.TestValues";
+ private Map<String, List<Parameter>> rpcMandatoryParamsMapFromXml;
+ private Map<String, List<Parameter>> rpcAllParamsMapFromXml;
+
+ private class Parameter {
+ private String rpcName;
+ private String name;
+ private String type;
+ private Class<?> javaType;
+ private boolean isArray;
+ private boolean isMandatory;
+ private String setterName;
+ private String getterName1;
+ private String getterName2;
+ private Object value;
+ private boolean skip;
+
+
+ public Parameter setRPCName(String rpcName) {
+ this.rpcName = rpcName;
+ return this;
+ }
+
+ public Parameter setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public Parameter setType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ public Parameter setJavaType(Class<?> javaType) {
+ this.javaType = javaType;
+ return this;
+ }
+
+ public Parameter setArray(boolean array) {
+ isArray = array;
+ return this;
+ }
+
+ public Parameter setMandatory(boolean mandatory) {
+ isMandatory = mandatory;
+ return this;
+ }
+
+ public Parameter setSetterName(String setterName) {
+ this.setterName = setterName;
+ return this;
+ }
+
+ public Parameter setGetterName1(String getterName1) {
+ this.getterName1 = getterName1;
+ return this;
+ }
+
+ public Parameter setGetterName2(String getterName2) {
+ this.getterName2 = getterName2;
+ return this;
+ }
+
+ public void setValue(Object value) {
+ this.value = value;
+ }
+
+ public Parameter setSkip(boolean skip) {
+ this.skip = skip;
+ return this;
+ }
+ }
+
+ @Before
+ public void setUp(){
+ // Map that has keys correspond to the RPC names and values correspond to the params for that RPC.
+ rpcMandatoryParamsMapFromXml = getRPCParamsMap(XML_FILE_NAME, true);
+ rpcAllParamsMapFromXml = getRPCParamsMap(XML_FILE_NAME, false);
+ }
+
+ // This method parses the RPC spec xml file and returns a map that has
+ // keys correspond to the RPC names and values correspond to the params for that RPC
+ private Map<String, List<Parameter>> getRPCParamsMap(String fileName, boolean includeMandatoryOnly) {
+ Map<String, List<Parameter>> rpcParamsMap = new HashMap<>();
+ try {
+ InputStream stream = getInstrumentation().getTargetContext().getAssets().open(fileName);
+ XmlPullParserFactory xmlFactoryObject = XmlPullParserFactory.newInstance();
+ XmlPullParser myParser = xmlFactoryObject.newPullParser();
+ myParser.setInput(stream, null);
+ int event = myParser.getEventType();
+ String rpcName = null;
+ boolean ignoreRPC = false;
+ String setterMethodName;
+ String getterMethodName1;
+ String getterMethodName2;
+ Class<?> javaParamType;
+ boolean skipParam;
+ while (event != XmlPullParser.END_DOCUMENT) {
+ String name = myParser.getName();
+ switch (event){
+ case XmlPullParser.START_TAG:
+ // Store the RPC name in the map
+ if(name.equals("function") || name.equals("struct")){
+ rpcName = myParser.getAttributeValue(null,"name");
+ ignoreRPC = false;
+ if (name.equals("function") && myParser.getAttributeValue(null, "messagetype").equals("response") && !rpcName.contains("Response")){
+ rpcName += "Response";
+ }
+
+ // -------------- Exceptional cases because of mismatch between the RPC spec and the Android code --------------
+ if(rpcName.equals("SyncMsgVersion")){
+ rpcName = "SdlMsgVersion";
+ } else if(rpcName.equals("ShowConstantTBTResponse")){
+ rpcName = "ShowConstantTbtResponse";
+ } else if(rpcName.equals("OASISAddress")) {
+ rpcName = "OasisAddress";
+ } else if(rpcName.equals("ShowConstantTBT")) {
+ rpcName = "ShowConstantTbt";
+ } else if (rpcName.equals("EncodedSyncPData") || rpcName.equals("OnEncodedSyncPData") || rpcName.equals("EncodedSyncPDataResponse")){
+ ignoreRPC = true;
+ }
+ // -------------------------------------------------------------------------------------------------------------
+
+ if (!ignoreRPC) {
+ rpcParamsMap.put(rpcName, new ArrayList<Parameter>());
+ }
+ }
+ // Store the params for the current RPC in the map
+ if(name.equals("param") && myParser.getAttributeValue(null, "until") == null && !ignoreRPC){
+ setterMethodName = null;
+ getterMethodName1 = null;
+ getterMethodName2 = null;
+ javaParamType = null;
+ skipParam = false;
+ boolean isMandatory = Boolean.valueOf(myParser.getAttributeValue(null,"mandatory"));
+ if (isMandatory || !includeMandatoryOnly) {
+ String paramName = myParser.getAttributeValue(null, "name");
+ String paramType = myParser.getAttributeValue(null, "type");
+ boolean isArray = Boolean.valueOf(myParser.getAttributeValue(null, "array"));
+
+ // -------------- Exceptional cases because of mismatch between the RPC spec and the Android code --------------
+ if (paramName.equals("syncFileName")){
+ paramName = "sdlFileName";
+ } else if (paramName.equals("syncMsgVersion")){
+ paramName = "sdlMsgVersion";
+ } else if (paramName.equals("hmiPermissions")){
+ paramName = "hMIPermissions";
+ } else if (paramName.equals("resolution")){
+ paramName = "imageResolution";
+ } else if (paramName.equals("pressureTelltale")){
+ paramName = "pressureTellTale";
+ }
+
+ setterMethodName = "set" + paramName.substring(0, 1).toUpperCase() + paramName.substring(1);
+
+ if (paramType.equals("SyncMsgVersion")){
+ paramType = "SdlMsgVersion";
+ } else if (rpcName.equals("GPSData") && paramType.equals("Float")){
+ paramType = "Double";
+ } else if (rpcName.equals("TouchEvent") && paramType.equals("Integer") && isArray){
+ paramType = "Long";
+ } else if (paramType.equals("OASISAddress")) {
+ paramType = "OasisAddress";
+ } else if (rpcName.equals("VideoStreamingCapability") && paramType.equals("Float")) {
+ paramType = "Double";
+ } else if (rpcName.equals("UnsubscribeVehicleData") && setterMethodName.equals("setCloudAppVehicleID")) {
+ paramType = "boolean";
+ } else if (rpcName.equals("CancelInteraction") && setterMethodName.equals("setFunctionID")) {
+ setterMethodName = "setInteractionFunctionID";
+ } else if (rpcName.equals("NavigationCapability") && setterMethodName.equals("setGetWayPointsEnabled")) {
+ setterMethodName = "setWayPointsEnabled";
+ } else if (rpcName.equals("UnsubscribeWayPointsResponse") && setterMethodName.equals("setGetWayPointsEnabled")) {
+ setterMethodName = "setWayPointsEnabled";
+ } else if (rpcName.equals("HMICapabilities") && setterMethodName.equals("setNavigation")) {
+ setterMethodName = "setNavigationAvilable";
+ } else if (rpcName.equals("HMICapabilities") && setterMethodName.equals("setPhoneCall")) {
+ setterMethodName = "setPhoneCallAvilable";
+ } else if (rpcName.equals("HMICapabilities") && setterMethodName.equals("setDisplays")) {
+ setterMethodName = "setDisplaysCapabilityAvailable";
+ } else if (rpcName.equals("HMICapabilities")) {
+ setterMethodName += "Available";
+ } else if (rpcName.equals("VideoStreamingCapability") && setterMethodName.equals("setHapticSpatialDataSupported")) {
+ setterMethodName = "setIsHapticSpatialDataSupported";
+ } else if (rpcName.equals("OnDriverDistraction") && setterMethodName.equals("setLockScreenDismissalEnabled")) {
+ setterMethodName = "setLockscreenDismissibility";
+ paramType = "boolean";
+ } else if (rpcName.equals("OnDriverDistraction") && setterMethodName.equals("setLockScreenDismissalWarning")) {
+ setterMethodName = "setLockscreenWarningMessage";
+ } else if (rpcName.equals("PublishAppServiceResponse") && setterMethodName.equals("setAppServiceRecord")) {
+ setterMethodName = "setServiceRecord";
+ } else if (setterMethodName.equals("setFuelLevel_State")) {
+ setterMethodName = "setFuelLevelState";
+ } else if (rpcName.equals("LightCapabilities") && setterMethodName.equals("setRgbColorSpaceAvailable")) {
+ setterMethodName = "setRGBColorSpaceAvailable";
+ } else if (rpcName.equals("CloudAppProperties") && setterMethodName.equals("setEnabled")) {
+ paramType = "boolean";
+ } else if (rpcName.equals("DateTime") && setterMethodName.equals("setMillisecond")) {
+ setterMethodName = "setMilliSecond";
+ } else if (rpcName.equals("DateTime") && setterMethodName.equals("setTz_hour")) {
+ setterMethodName = "setTzHour";
+ } else if (rpcName.equals("DateTime") && setterMethodName.equals("setTz_minute")) {
+ setterMethodName = "setTzMinute";
+ } else if (rpcName.equals("PutFile") && setterMethodName.equals("setCrc")) {
+ setterMethodName = "setCRC";
+ paramType = "Long";
+ } else if (rpcName.equals("AppServiceManifest") && setterMethodName.equals("setHandledRPCs")) {
+ setterMethodName = "setHandledRpcs";
+ } else if (rpcName.equals("LocationDetails") && setterMethodName.equals("setHandledRPCs")) {
+ setterMethodName = "setHandledRpcs";
+ } else if (rpcName.equals("SendLocation") && setterMethodName.equals("setLongitudeDegrees")) {
+ paramType = "Double";
+ } else if (rpcName.equals("SendLocation") && setterMethodName.equals("setLatitudeDegrees")) {
+ paramType = "Double";
+ } else if (rpcName.equals("Grid") && setterMethodName.equals("setColspan")) {
+ setterMethodName = "setColSpan";
+ } else if (rpcName.equals("Grid") && setterMethodName.equals("setRowspan")) {
+ setterMethodName = "setRowSpan";
+ } else if (rpcName.equals("Grid") && setterMethodName.equals("setLevelspan")) {
+ setterMethodName = "setLevelSpan";
+ } else if (rpcName.equals("HeadLampStatus") && setterMethodName.equals("setAmbientLightSensorStatus")) {
+ setterMethodName = "setAmbientLightStatus";
+ } else if (rpcName.equals("GetVehicleData") && setterMethodName.equals("setCloudAppVehicleID")) {
+ paramType = "boolean";
+ } else if (rpcName.equals("GetVehicleDataResponse") && Arrays.asList("setInstantFuelConsumption", "setFuelLevel", "setSpeed", "setExternalTemperature", "setEngineTorque", "setAccPedalPosition", "setSteeringWheelAngle").contains(setterMethodName)) {
+ paramType = "Double";
+ } else if (rpcName.equals("RdsData") && setterMethodName.equals("setPS")) {
+ setterMethodName = "setProgramService";
+ } else if (rpcName.equals("RdsData") && setterMethodName.equals("setCT")) {
+ setterMethodName = "setClockText";
+ } else if (rpcName.equals("RdsData") && setterMethodName.equals("setRT")) {
+ setterMethodName = "setRadioText";
+ } else if (rpcName.equals("RdsData") && setterMethodName.equals("setPI")) {
+ setterMethodName = "setProgramIdentification";
+ } else if (rpcName.equals("RdsData") && setterMethodName.equals("setPTY")) {
+ setterMethodName = "setProgramType";
+ } else if (rpcName.equals("RdsData") && setterMethodName.equals("setTP")) {
+ setterMethodName = "setTrafficProgram";
+ } else if (rpcName.equals("RdsData") && setterMethodName.equals("setTA")) {
+ setterMethodName = "setTrafficAnnouncement";
+ } else if (rpcName.equals("RdsData") && setterMethodName.equals("setREG")) {
+ setterMethodName = "setRegion";
+ } else if (rpcName.equals("RadioControlCapabilities") && setterMethodName.equals("setSiriusxmRadioAvailable")) {
+ setterMethodName = "setSiriusXMRadioAvailable";
+ } else if (rpcName.equals("GetCloudAppPropertiesResponse") && setterMethodName.equals("setProperties")) {
+ setterMethodName = "setCloudAppProperties";
+ } else if (rpcName.equals("GetFileResponse") && setterMethodName.equals("setCrc")) {
+ setterMethodName = "setCRC";
+ } else if (rpcName.equals("RegisterAppInterfaceResponse") && setterMethodName.equals("setPcmStreamCapabilities")) {
+ setterMethodName = "setPcmStreamingCapabilities";
+ } else if (rpcName.equals("SubscribeVehicleData") && setterMethodName.equals("setElectronicParkBrakeStatus")) {
+ paramType = "boolean";
+ } else if (rpcName.equals("SubscribeVehicleData") && setterMethodName.equals("setCloudAppVehicleID")) {
+ paramType = "boolean";
+ } else if (rpcName.equals("ModuleInfo") && setterMethodName.equals("setLocation")) {
+ setterMethodName = "setModuleLocation";
+ } else if (rpcName.equals("ModuleInfo") && setterMethodName.equals("setServiceArea")) {
+ setterMethodName = "setModuleServiceArea";
+ } else if (rpcName.equals("ModuleInfo") && setterMethodName.equals("setAllowMultipleAccess")) {
+ setterMethodName = "setMultipleAccessAllowance";
+ } else if (rpcName.equals("OnVehicleData") && setterMethodName.equals("setSpeed")) {
+ paramType = "Double";
+ } else if (rpcName.equals("OnVehicleData") && setterMethodName.equals("setFuelLevel")) {
+ paramType = "Double";
+ } else if (rpcName.equals("OnVehicleData") && setterMethodName.equals("setInstantFuelConsumption")) {
+ paramType = "Double";
+ } else if (rpcName.equals("OnVehicleData") && setterMethodName.equals("setExternalTemperature")) {
+ paramType = "Double";
+ } else if (rpcName.equals("OnVehicleData") && setterMethodName.equals("setEngineTorque")) {
+ paramType = "Double";
+ } else if (rpcName.equals("OnVehicleData") && setterMethodName.equals("setAccPedalPosition")) {
+ paramType = "Double";
+ } else if (rpcName.equals("OnVehicleData") && setterMethodName.equals("setSteeringWheelAngle")) {
+ paramType = "Double";
+ } else if (rpcName.equals("GetInteriorVehicleDataConsentResponse") && setterMethodName.equals("setAllowed")) {
+ setterMethodName = "setAllowances";
+ } else if (rpcName.equals("SeatLocationCapability") && setterMethodName.equals("setColumns")) {
+ setterMethodName = "setCols";
+ } else if (rpcName.equals("ShowConstantTbt") && setterMethodName.equals("setDistanceToManeuver")) {
+ paramType = "Double";
+ } else if (rpcName.equals("ShowConstantTbt") && setterMethodName.equals("setDistanceToManeuverScale")) {
+ paramType = "Double";
+ } else if (rpcName.equals("SingleTireStatus") && setterMethodName.equals("setTpms")) {
+ setterMethodName = "setTPMS";
+ } else if (rpcName.equals("VehicleDataResult") && setterMethodName.equals("setOemCustomDataType")) {
+ setterMethodName = "setOEMCustomVehicleDataType";
+ } else if (rpcName.equals("SystemCapability") && !setterMethodName.equals("setSystemCapabilityType")) {
+ setterMethodName = "setCapabilityForType";
+ paramType = "SystemCapabilityType";
+ } else if (rpcName.equals("UnsubscribeWayPointsResponse") && paramName.equals("wayPoints")) {
+ skipParam = true;
+ } else if (rpcName.equals("UnsubscribeVehicleDataResponse") && paramName.equals("clusterModes")) {
+ skipParam = true;
+ } else if (rpcName.equals("ClimateControlCapabilities") && paramName.equals("currentTemperatureAvailable")) {
+ skipParam = true;
+ } else if (rpcName.equals("SubscribeVehicleDataResponse") && paramName.equals("clusterModes")) {
+ skipParam = true;
+ }
+
+ // -------------------------------------------------------------------------------------------------------------
+
+ javaParamType = findJavaTypeForParam(paramType, isArray);
+ getterMethodName1 = "get" + setterMethodName.substring(3);
+ if (paramType.equalsIgnoreCase("boolean")) {
+ getterMethodName2 = "is" + setterMethodName.substring(3);
+ }
+
+ Parameter param = new Parameter()
+ .setRPCName(rpcName)
+ .setName(paramName)
+ .setType(paramType)
+ .setJavaType(javaParamType)
+ .setArray(isArray)
+ .setMandatory(isMandatory)
+ .setSkip(skipParam)
+ .setSetterName(setterMethodName)
+ .setGetterName1(getterMethodName1)
+ .setGetterName2(getterMethodName2)
+ ;
+
+ rpcParamsMap.get(rpcName).add(param);
+ }
+ }
+ break;
+ }
+ event = myParser.next();
+ }
+ stream.close();
+ } catch (IOException | XmlPullParserException e) {
+ fail("Cannot parse mobile APIs XML file. Please make sure that the RPC Spec submodule is initialized: " + e.getMessage());
+ }
+ return rpcParamsMap;
+ }
+
+ // This method makes sure that for every RPC, there is a constructor that has all the mandatory params
+ // It also checks if there are RPC in the XML file that don't exist in the code
+ @Test
+ public void testMandatoryParamsMatch() {
+ // List of RPC names that don't have a constructor that has all mandatory params
+ List<String> rpcsWithInvalidConstructor = new ArrayList<>();
+
+ // List of the RPC names that couldn't be found in code
+ // potentially because of a mismatch between name in the RPC spec xml file and name in code
+ List<String> rpcsFromXmlNotFoundInCode = new ArrayList<>();
+
+ // Loop through all RPCs that were loaded from RPC spec XML file
+ // and make sure that every RPC has a constructor that has all mandatory params
+ for (String rpcName : rpcMandatoryParamsMapFromXml.keySet()) {
+ Class aClass;
+ try {
+ aClass = Class.forName(RPC_PACKAGE_PREFIX + rpcName);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ rpcsFromXmlNotFoundInCode.add(rpcName);
+ continue;
+ }
+ List<String> mandatoryParamsListFromXML = new ArrayList<>();
+ for (Parameter param : rpcMandatoryParamsMapFromXml.get(rpcName)) {
+ String type = param.type;
+ // If the param is a list of objects, the type should be like "List<Object>"
+ if (param.isArray){
+ type = String.format("List<%s>", type);
+ }
+ mandatoryParamsListFromXML.add(type);
+ }
+ List<String> mandatoryParamsListFromCode = new ArrayList<>();
+ boolean rpcHasValidConstructor = false;
+ for (Constructor constructor : aClass.getConstructors()){
+ mandatoryParamsListFromCode.clear();
+ for (Type paramType : constructor.getGenericParameterTypes()){
+ String paramFullType = paramType.toString();
+ String paramSimpleType;
+
+ // If the param is a list of objects, the type should be like "List<Object>"
+ if (paramFullType.matches("java.util.List<.+>")) {
+ paramSimpleType = String.format("List<%s>", paramFullType.substring(paramFullType.lastIndexOf('.') + 1, paramFullType.length() - 1));
+ }
+ // If the param is a simple object for example "java.lang.String", the type should be the last part "String"
+ else if (!paramFullType.contains(">")){
+ paramSimpleType = paramFullType.substring(paramFullType.lastIndexOf('.') + 1, paramFullType.length());
+ }
+ else {
+ paramSimpleType = paramFullType;
+ }
+ mandatoryParamsListFromCode.add(paramSimpleType);
+ }
+ if (mandatoryParamsListFromCode.containsAll(mandatoryParamsListFromXML) && mandatoryParamsListFromXML.containsAll(mandatoryParamsListFromCode)){
+ rpcHasValidConstructor = true;
+ break;
+ }
+ }
+ if (!rpcHasValidConstructor){
+ rpcsWithInvalidConstructor.add(rpcName);
+ }
+ }
+ assertTrue("The following RPCs were not found in the code: " + rpcsFromXmlNotFoundInCode, rpcsFromXmlNotFoundInCode.isEmpty());
+ assertTrue("The following RPCs don't have a constructor that has all the mandatory params: " + rpcsWithInvalidConstructor, rpcsWithInvalidConstructor.isEmpty());
+ }
+
+ // This method returns the correct java reflection method in a specific class
+ private Method getMethod(Class aClass, Parameter parameter, String methodName, boolean isGetter) throws NoSuchMethodException {
+ Method method = null;
+ if (methodName == null) {
+ throw new NoSuchMethodException();
+ }
+ if (isGetter) {
+ if (parameter.rpcName.equals("SystemCapability") && !methodName.contains("SystemCapabilityType")) {
+ method = aClass.getMethod(methodName, SystemCapabilityType.class);
+ } else {
+ method = aClass.getMethod(methodName);
+ }
+ } else {
+ if (parameter.rpcName.equals("SystemCapability") && !methodName.contains("SystemCapabilityType")) {
+ method = aClass.getMethod(methodName, SystemCapabilityType.class, Object.class);
+ } else {
+ method = aClass.getMethod(methodName, parameter.javaType);
+ }
+ }
+ return method;
+ }
+
+ // This method returns the full Java type for a param
+ private Class<?> findJavaTypeForParam(String type, boolean isArray) {
+ String typeString = null;
+ Class<?> javaType = null;
+
+ // List of types that exist in java.lang.*
+ List<String> javaLangBuiltInTypes = Arrays.asList("String", "Integer", "Long", "Float", "Double", "Boolean");
+
+ // List of primitive types in java
+ List<String> javaLangPrimitiveTypes = Arrays.asList("int", "long", "float", "double", "boolean");
+
+ // Find the full Java type for the current param
+ try {
+ if (isArray) {
+ javaType = List.class;
+ } else if (javaLangPrimitiveTypes.contains(type)) {
+ if (type.equals("int")) {
+ javaType = int.class;
+ } else if (type.equals("long")) {
+ javaType = long.class;
+ } else if (type.equals("float")) {
+ javaType = float.class;
+ } else if (type.equals("double")) {
+ javaType = double.class;
+ } else if (type.equals("boolean")) {
+ javaType = boolean.class;
+ }
+ } else {
+ if (javaLangBuiltInTypes.contains(type)) {
+ typeString = "java.lang." + type;
+ } else {
+ typeString = RPC_PACKAGE_PREFIX + type;
+ }
+ javaType = Class.forName(typeString);
+ }
+
+ } catch (ClassNotFoundException e) {
+ // If the class was not found in the rpc package
+ // try to see if it can be found in enums package
+ typeString = RPC_PACKAGE_PREFIX + "enums." + type;
+ try {
+ javaType = Class.forName(typeString);
+ } catch (ClassNotFoundException e1) {
+ e1.printStackTrace();
+ }
+ }
+ assertNotNull("Java type cannot be found for: " + type, javaType);
+ return javaType;
+ }
+
+ // This method makes sure that for every RPC, the constructor that has the mandatory params is setting the values correctly
+ @Test
+ public void testMandatoryParamsValues() {
+ // List of RPC names that have a constructor which is not settings the values for the mandatory params correctly
+ List<String> rpcsWithInvalidConstructor = new ArrayList<>();
+
+ // Loop through all RPCs that were loaded from RPC spec XML file
+ // and make sure that the constructor that has the mandatory params is setting the values correctly
+ for (String rpcName : rpcMandatoryParamsMapFromXml.keySet()) {
+ Class aClass;
+ try {
+ aClass = Class.forName(RPC_PACKAGE_PREFIX + rpcName);
+ } catch (ClassNotFoundException e) {
+ fail(e.getMessage());
+ continue;
+ }
+
+ List<Parameter> parameters = rpcMandatoryParamsMapFromXml.get(rpcName);
+ List<Class<?>> mandatoryParamsTypes = new ArrayList<>();
+ List<Object> mandatoryParamsValues = new ArrayList<>();
+
+ // Loop through all mandatory params for the current RPC
+ // and try to find the full Java type for each param
+ // also assign a value for each param from TestValues class
+ for (Parameter param : parameters) {
+ String valueString = null;
+ Object value = null;
+
+ // Assign a value for the current param from TestValues based of the param type
+ try {
+ // --------------------------------------------- Exceptional cases ---------------------------------------------
+ // This case is exceptional because the setter changes the input if it is not all digits
+ if (rpcName.equals("DialNumber") && param.type.equals("String")){
+ value = "5558675309";
+ }
+ // -------------------------------------------------------------------------------------------------------------
+
+ if (value == null) {
+ valueString = "GENERAL_" + param.type.toUpperCase();
+ if (param.isArray){
+ valueString += "_LIST";
+ }
+ value = Class.forName(TEST_VALUES_CLASS).getDeclaredField(valueString).get(null);
+ }
+
+ } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
+ e.printStackTrace();
+ fail("Value: " + valueString + " cannot be found for RPC: " + rpcName + ". Make sure that you declared that value in " + TEST_VALUES_CLASS);
+ }
+
+ mandatoryParamsTypes.add(param.javaType);
+ mandatoryParamsValues.add(value);
+ }
+
+
+ // Create an instance of the RPC object using the constructor that has all the mandatory params
+ Object instance = null;
+ try {
+ Constructor constructor = aClass.getConstructor(mandatoryParamsTypes.toArray(new Class<?>[mandatoryParamsTypes.size()]));
+ instance = constructor.newInstance(mandatoryParamsValues.toArray(new Object[mandatoryParamsValues.size()]));
+ } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {
+ e.printStackTrace();
+ fail("Constructor for RPC " + rpcName + " cannot be invoked. Make sure that the constructor parameters order and types are identical to the RPC specs");
+ }
+
+
+ // Loop through all getter methods for the instance and make sure that they are returning the expected values
+ if (instance != null) {
+ for (int i = 0; i < parameters.size(); i++) {
+ try {
+ Method getterMethod = getMethod(aClass, parameters.get(i), parameters.get(i).getterName1, true);
+ Object val = getterMethod.invoke(instance);
+ if (val == null || !val.equals(mandatoryParamsValues.get(i))) {
+ rpcsWithInvalidConstructor.add(rpcName);
+ break;
+ }
+ } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
+ e.printStackTrace();
+ fail("Method: " + parameters.get(i).getterName1 + " cannot be found for RPC: " + rpcName + ". Make sure that the method exists and that the parameters order and types are identical to the RPC specs");
+ }
+ }
+ }
+ }
+
+ assertTrue("The following RPCs have a constructor that is not setting the mandatory params correctly: " + rpcsWithInvalidConstructor, rpcsWithInvalidConstructor.isEmpty());
+ }
+
+ /**
+ * This method makes sure that for every param in every RPC:
+ * - A setter exists and its name matches the RPC spec
+ * - The setter return type matches the RPC type (to make RPCs chainable)
+ * - A getter exists and its name matches the RPC spec
+ */
+ @Test
+ public void testParamsSettersAndGetters() {
+ List<String> errors = new ArrayList<>();
+
+ // Loop through all RPCs that were loaded from RPC spec XML file
+ for (String rpcName : rpcAllParamsMapFromXml.keySet()) {
+ Class aClass;
+ try {
+ aClass = Class.forName(RPC_PACKAGE_PREFIX + rpcName);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ errors.add("Class not found for rpc: "+ rpcName + ". \n");
+ continue;
+ }
+
+ // Loop through all params for the current RPC and make sure everyone has a a setter and a getter
+ List<Parameter> parameters = rpcAllParamsMapFromXml.get(rpcName);
+ for (int i = 0; i < parameters.size(); i++) {
+ Parameter parameter = parameters.get(i);
+ if (parameter.skip) {
+ continue;
+ }
+
+ // Confirm that the setter is correct
+ try {
+ Method setterMethod = getMethod(aClass, parameter, parameter.setterName, false);
+ List<String> expectedReturnTypes = Arrays.asList(aClass.getName(), aClass.getSuperclass().getName());
+ String actualReturnType = setterMethod.getReturnType().getName();
+ if (!expectedReturnTypes.contains(actualReturnType)) {
+ String errMsg = rpcName + "." + parameter.setterName + "() is expected to return one of these types: " + expectedReturnTypes + " but it returns: " + actualReturnType + ". \n";
+ errors.add(errMsg);
+ }
+ } catch (NoSuchMethodException e) {
+ String errMsg = rpcName + "." + parameter.setterName + "(" + parameter.type + ")" + " cannot be found. Make sure that the method exists. \n";
+ errors.add(errMsg);
+ }
+
+ // Confirm that the getter is correct
+ Method getterMethod = null;
+ try {
+ // --------------------------------------------- Exceptional cases ---------------------------------------------
+ if (parameter.getterName1.contains("Avilable")) {
+ continue;
+ } else if (parameter.getterName1.equals("getSeats")) {
+ parameter.getterName1 = "getSeatLocations";
+ }
+ // -------------------------------------------------------------------------------------------------------------
+ getterMethod = getMethod(aClass, parameter, parameter.getterName1, true);
+ } catch (NoSuchMethodException e) {
+ try {
+ getterMethod = getMethod(aClass, parameter, parameter.getterName2, true);
+ } catch (NoSuchMethodException ex) {
+ ex.printStackTrace();
+ String errMsg = String.format(rpcName + "." + parameter.getterName1 + "()" + "%s" + " cannot be found. Make sure that the method exists. \n", parameter.type.equalsIgnoreCase("boolean")? "/" + parameter.getterName2 + "()" : "");
+ errors.add(errMsg);
+ }
+ }
+ }
+ }
+
+ assertTrue("There are " + errors.size() + " errors: \n" + errors, errors.isEmpty());
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCStructTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCStructTests.java
new file mode 100644
index 000000000..970c3c8ba
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/RPCStructTests.java
@@ -0,0 +1,48 @@
+package com.smartdevicelink.test.rpc;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import com.smartdevicelink.proxy.RPCStruct;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static junit.framework.TestCase.assertNotNull;
+
+@RunWith(AndroidJUnit4.class)
+public class RPCStructTests {
+
+ @Test
+ public void testFormatObject() {
+ final String KEY = "LIST";
+ RPCStruct struct = new RPCStruct();
+ List<RPCStruct> structs = new ArrayList<>();
+ struct.setValue(KEY, structs);
+ assertNotNull(struct.getObject(RPCStruct.class, KEY));
+
+ structs.add(new RPCStruct());
+ struct.setValue(KEY, structs);
+ assertNotNull(struct.getObject(RPCStruct.class, KEY));
+
+ structs.clear();
+ structs.add(null);
+ struct.setValue(KEY, structs);
+ assertNotNull(struct.getObject(RPCStruct.class, KEY));
+
+ structs.clear();
+ structs.add(null);
+ structs.add(new RPCStruct());
+ struct.setValue(KEY, structs);
+ assertNotNull(struct.getObject(RPCStruct.class, KEY));
+
+ structs.clear();
+ structs.add(new RPCStruct());
+ structs.add(null);
+ structs.add(new RPCStruct());
+ struct.setValue(KEY, structs);
+ assertNotNull(struct.getObject(RPCStruct.class, KEY));
+ }
+}
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DriverDistractionCapabilityTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DriverDistractionCapabilityTest.java
index 2e98296a1..767c264fa 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DriverDistractionCapabilityTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DriverDistractionCapabilityTest.java
@@ -3,9 +3,12 @@ package com.smartdevicelink.test.rpc.datatypes;
import com.smartdevicelink.proxy.rpc.DriverDistractionCapability;
import com.smartdevicelink.test.JsonUtils;
import com.smartdevicelink.test.TestValues;
+
import junit.framework.TestCase;
+
import org.json.JSONException;
import org.json.JSONObject;
+
import java.util.Iterator;
/**
diff --git a/android/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 f8bb07caf..6e23edc7a 100644
--- a/android/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
@@ -1,6 +1,8 @@
package com.smartdevicelink.test.rpc.datatypes;
import com.smartdevicelink.proxy.rpc.FuelRange;
+import com.smartdevicelink.proxy.rpc.enums.CapacityUnit;
+import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
import com.smartdevicelink.proxy.rpc.enums.FuelType;
import com.smartdevicelink.test.JsonUtils;
import com.smartdevicelink.test.TestValues;
@@ -26,6 +28,10 @@ public class FuelRangeTests extends TestCase{
msg.setType(TestValues.GENERAL_FUELTYPE);
msg.setRange(TestValues.GENERAL_FLOAT);
+ msg.setLevel(TestValues.GENERAL_FLOAT);
+ msg.setLevelState(TestValues.GENERAL_COMPONENTVOLUMESTATUS);
+ msg.setCapacity(TestValues.GENERAL_FLOAT);
+ msg.setCapacityUnit(TestValues.GENERAL_CAPACITYUNIT);
}
/**
@@ -35,10 +41,18 @@ public class FuelRangeTests extends TestCase{
// Test Values
FuelType fuelType = msg.getType();
float range = msg.getRange();
-
+ float level = msg.getLevel();
+ ComponentVolumeStatus levelState = msg.getLevelState();
+ CapacityUnit capacityUnit = msg.getCapacityUnit();
+ float capacity = msg.getCapacity();
+
// Valid Tests
assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, range);
assertEquals(TestValues.MATCH, TestValues.GENERAL_FUELTYPE, fuelType);
+ assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, level);
+ assertEquals(TestValues.MATCH, TestValues.GENERAL_COMPONENTVOLUMESTATUS, levelState);
+ assertEquals(TestValues.MATCH, TestValues.GENERAL_CAPACITYUNIT, capacityUnit);
+ assertEquals(TestValues.MATCH, TestValues.GENERAL_FLOAT, capacity);
// Invalid/Null Tests
FuelRange msg = new FuelRange();
@@ -46,6 +60,10 @@ public class FuelRangeTests extends TestCase{
assertNull(TestValues.NULL, msg.getType());
assertNull(TestValues.NULL, msg.getRange());
+ assertNull(TestValues.NULL, msg.getLevel());
+ assertNull(TestValues.NULL, msg.getLevelState());
+ assertNull(TestValues.NULL, msg.getCapacityUnit());
+ assertNull(TestValues.NULL, msg.getCapacity());
}
public void testJson(){
@@ -54,6 +72,10 @@ public class FuelRangeTests extends TestCase{
try{
reference.put(FuelRange.KEY_TYPE, TestValues.GENERAL_FUELTYPE);
reference.put(FuelRange.KEY_RANGE, (Float) TestValues.GENERAL_FLOAT);
+ reference.put(FuelRange.KEY_LEVEL, TestValues.GENERAL_FLOAT);
+ reference.put(FuelRange.KEY_LEVEL_STATE, TestValues.GENERAL_COMPONENTVOLUMESTATUS);
+ reference.put(FuelRange.KEY_CAPACITY, TestValues.GENERAL_FLOAT);
+ reference.put(FuelRange.KEY_CAPACITY_UNIT, TestValues.GENERAL_CAPACITYUNIT);
JSONObject underTest = msg.serializeJSON();
assertEquals(TestValues.MATCH, reference.length(), underTest.length());
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StabilityControlsStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StabilityControlsStatusTests.java
new file mode 100644
index 000000000..1de8abfdf
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/StabilityControlsStatusTests.java
@@ -0,0 +1,58 @@
+package com.smartdevicelink.test.rpc.datatypes;
+
+import com.smartdevicelink.proxy.rpc.StabilityControlsStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus;
+import com.smartdevicelink.test.JsonUtils;
+import com.smartdevicelink.test.TestValues;
+
+import junit.framework.TestCase;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.Iterator;
+
+public class StabilityControlsStatusTests extends TestCase {
+ private StabilityControlsStatus msg;
+
+ @Override
+ public void setUp() {
+ msg = new StabilityControlsStatus();
+
+ msg.setEscSystem(TestValues.GENERAL_ESC_SYSTEM);
+ msg.setTrailerSwayControl(TestValues.GENERAL_S_WAY_CONTROL);
+ }
+
+ /**
+ * Tests the expected values of the RPC message.
+ */
+ public void testRpcValues () {
+ // Test Values
+ VehicleDataStatus esc = msg.getEscSystem();
+ VehicleDataStatus sTrailer = msg.getTrailerSwayControl();
+
+ // Valid Tests
+ assertEquals(TestValues.MATCH, TestValues.GENERAL_ESC_SYSTEM, esc);
+ assertEquals(TestValues.MATCH, TestValues.GENERAL_S_WAY_CONTROL, sTrailer);
+ }
+
+ public void testJson() {
+ JSONObject reference = new JSONObject();
+
+ try {
+ reference.put(StabilityControlsStatus.KEY_TRAILER_SWAY_CONTROL, TestValues.GENERAL_S_WAY_CONTROL);
+ reference.put(StabilityControlsStatus.KEY_ESC_SYSTEM, TestValues.GENERAL_ESC_SYSTEM);
+
+ JSONObject underTest = msg.serializeJSON();
+ assertEquals(TestValues.MATCH, reference.length(), underTest.length());
+
+ Iterator<?> iterator = reference.keys();
+ while (iterator.hasNext()) {
+ String key = (String) iterator.next();
+ assertEquals(TestValues.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
+ }
+ } catch (JSONException e) {
+ fail(TestValues.JSON_FAIL);
+ }
+ }
+} \ No newline at end of file
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CapacityUnitTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CapacityUnitTests.java
new file mode 100644
index 000000000..4da32bebf
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/CapacityUnitTests.java
@@ -0,0 +1,71 @@
+package com.smartdevicelink.test.rpc.enums;
+
+import com.smartdevicelink.proxy.rpc.enums.CapacityUnit;
+
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class CapacityUnitTests extends TestCase {
+
+ /**
+ * Verifies that the enum values are not null upon valid assignment.
+ */
+ public void testValidEnums () {
+ String example = "LITERS";
+ CapacityUnit enumLiters = CapacityUnit.valueForString(example);
+ example = "KILOWATTHOURS";
+ CapacityUnit enumKWH = CapacityUnit.valueForString(example);
+ example = "KILOGRAMS";
+ CapacityUnit enumKilograms = CapacityUnit.valueForString(example);
+
+ assertNotNull("LITERS returned null", enumLiters);
+ assertNotNull("KILOWATTHOURS returned null", enumKWH);
+ assertNotNull("KILOGRAMS returned null", enumKilograms);
+ }
+
+ /**
+ * Verifies that an invalid assignment is null.
+ */
+ public void testInvalidEnum () {
+ String example = "lONg";
+ try {
+ CapacityUnit temp = CapacityUnit.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 {
+ CapacityUnit temp = CapacityUnit.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<CapacityUnit> enumValueList = Arrays.asList(CapacityUnit.values());
+
+ List<CapacityUnit> enumTestList = new ArrayList<CapacityUnit>();
+ enumTestList.add(CapacityUnit.KILOGRAMS);
+ enumTestList.add(CapacityUnit.KILOWATTHOURS);
+ enumTestList.add(CapacityUnit.LITERS);
+
+ 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/VehicleDataTypeTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/enums/VehicleDataTypeTests.java
index 37793b489..a337058f9 100644
--- 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
@@ -88,6 +88,8 @@ public class VehicleDataTypeTests extends TestCase {
VehicleDataType enumVehicleDataGearStatus= VehicleDataType.valueForString(example);
example = "VEHICLEDATA_WINDOWSTATUS";
VehicleDataType enumVehicleDataTypeWindowStatus= VehicleDataType.valueForString(example);
+ example = "VEHICLEDATA_STABILITYCONTROLSSTATUS";
+ VehicleDataType enumVehicleDataStabilityControlsStatus = VehicleDataType.valueForString(example);
assertNotNull("VEHICLEDATA_GPS returned null", enumVehicleDataGps);
assertNotNull("VEHICLEDATA_SPEED returned null", enumVehicleDataSpeed);
@@ -124,6 +126,7 @@ public class VehicleDataTypeTests extends TestCase {
assertNotNull("VEHICLEDATA_HANDSOFFSTEERING returned null", enumVehicleDataHandsOffSteeringType);
assertNotNull("VEHICLEDATA_WINDOWSTATUS returned null", enumVehicleDataTypeWindowStatus);
assertNotNull("VEHICLEDATA_GEARSTATUS returned null", enumVehicleDataGearStatus);
+ assertNotNull("VEHICLEDATA_STABILITYCONTROLSSTATUS returned null", enumVehicleDataStabilityControlsStatus);
}
/**
@@ -196,6 +199,7 @@ public class VehicleDataTypeTests extends TestCase {
enumTestList.add(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING);
enumTestList.add(VehicleDataType.VEHICLEDATA_WINDOWSTATUS);
enumTestList.add(VehicleDataType.VEHICLEDATA_GEARSTATUS);
+ enumTestList.add(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS);
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/notifications/OnErrorTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java
deleted file mode 100644
index f0c542894..000000000
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnErrorTests.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import com.smartdevicelink.proxy.callbacks.InternalProxyMessage;
-import com.smartdevicelink.proxy.callbacks.OnError;
-import com.smartdevicelink.test.TestValues;
-
-import junit.framework.TestCase;
-
-import org.junit.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.callbacks.OnError}
- */
-public class OnErrorTests extends TestCase {
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.proxy.callbacks.OnError#OnError()}
- * {@link com.smartdevicelink.proxy.callbacks.OnError#OnError(String, Exception)}
- */
- @Test
- public void testValues () {
- // Valid Tests
- OnError testOnError = new OnError();
- assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyError, testOnError.getFunctionName());
-
- Exception testE = new Exception();
- testOnError = new OnError(TestValues.GENERAL_STRING, testE);
- assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyError, testOnError.getFunctionName());
- assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testOnError.getInfo());
- assertEquals(TestValues.MATCH, testE, testOnError.getException());
-
- // Invalid/Null Tests
- testOnError = new OnError(null, null);
- assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyError, testOnError.getFunctionName());
- assertNull(TestValues.NULL, testOnError.getInfo());
- assertNull(TestValues.NULL, testOnError.getException());
- }
-} \ No newline at end of file
diff --git a/android/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
deleted file mode 100644
index 1ef639029..000000000
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyClosedTests.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import com.smartdevicelink.proxy.callbacks.InternalProxyMessage;
-import com.smartdevicelink.proxy.callbacks.OnProxyClosed;
-import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
-import com.smartdevicelink.test.TestValues;
-
-import junit.framework.TestCase;
-
-import org.junit.Test;
-
-/**
- * This is a unit test class for the SmartDeviceLink library project class :
- * {@link com.smartdevicelink.proxy.callbacks.OnProxyClosed}
- */
-public class OnProxyClosedTests extends TestCase {
-
- /**
- * This is a unit test for the following methods :
- * {@link com.smartdevicelink.proxy.callbacks.OnProxyClosed#OnProxyClosed()}
- * {@link com.smartdevicelink.proxy.callbacks.OnProxyClosed#OnProxyClosed(String, Exception, SdlDisconnectedReason)}
- */
- @Test
- public void testValues () {
- // Valid Tests
- OnProxyClosed testOnProxyClosed = new OnProxyClosed();
- assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyClosed, testOnProxyClosed.getFunctionName());
-
- Exception testE = new Exception();
- SdlDisconnectedReason testReason = SdlDisconnectedReason.DEFAULT;
- testOnProxyClosed = new OnProxyClosed(TestValues.GENERAL_STRING, testE, testReason);
- assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyClosed, testOnProxyClosed.getFunctionName());
- assertEquals(TestValues.MATCH, TestValues.GENERAL_STRING, testOnProxyClosed.getInfo());
- assertEquals(TestValues.MATCH, testE, testOnProxyClosed.getException());
- assertEquals(TestValues.MATCH, testReason, testOnProxyClosed.getReason());
-
- // Invalid/Null Tests
- testOnProxyClosed = new OnProxyClosed(null, null, null);
- assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyClosed, testOnProxyClosed.getFunctionName());
- assertNull(TestValues.NULL, testOnProxyClosed.getInfo());
- assertNull(TestValues.NULL, testOnProxyClosed.getException());
- assertNull(TestValues.NULL, testOnProxyClosed.getReason());
- }
-} \ No newline at end of file
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
deleted file mode 100644
index 3f76fd4cb..000000000
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnProxyOpenedTests.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.smartdevicelink.test.rpc.notifications;
-
-import com.smartdevicelink.proxy.callbacks.InternalProxyMessage;
-import com.smartdevicelink.proxy.callbacks.OnProxyOpened;
-import com.smartdevicelink.test.TestValues;
-
-import junit.framework.TestCase;
-
-import org.junit.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()}
- */
- @Test
- public void testMethods () {
- OnProxyOpened testOnProxyOpened = new OnProxyOpened();
- assertNotNull(TestValues.NOT_NULL, testOnProxyOpened);
- assertEquals(TestValues.MATCH, InternalProxyMessage.OnProxyOpened, testOnProxyOpened.getFunctionName());
- }
-} \ 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
index d333d3b5a..409ad1dd1 100644
--- 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
@@ -13,10 +13,12 @@ import com.smartdevicelink.proxy.rpc.EmergencyEvent;
import com.smartdevicelink.proxy.rpc.FuelRange;
import com.smartdevicelink.proxy.rpc.GPSData;
import com.smartdevicelink.proxy.rpc.GearStatus;
+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.StabilityControlsStatus;
import com.smartdevicelink.proxy.rpc.TireStatus;
import com.smartdevicelink.proxy.rpc.WindowStatus;
import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
@@ -104,6 +106,7 @@ public class OnVehicleDataTests extends BaseRpcTests{
result.put(OnVehicleData.KEY_HANDS_OFF_STEERING, VehicleDataHelper.HANDS_OFF_STEERING);
result.put(OnVehicleData.KEY_GEAR_STATUS, VehicleDataHelper.GEAR_STATUS);
result.put(OnVehicleData.KEY_WINDOW_STATUS, VehicleDataHelper.WINDOW_STATUS_LIST);
+ result.put(OnVehicleData.KEY_STABILITY_CONTROLS_STATUS, VehicleDataHelper.STABILITY_CONTROLS_STATUS);
result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE);
} catch(JSONException e) {
fail(TestValues.JSON_FAIL);
@@ -149,6 +152,7 @@ public class OnVehicleDataTests extends BaseRpcTests{
TurnSignal turnSignal = ( (OnVehicleData) msg).getTurnSignal();
ElectronicParkBrakeStatus electronicParkBrakeStatus = ( (OnVehicleData) msg).getElectronicParkBrakeStatus();
GearStatus gearStatus = ( (OnVehicleData) msg).getGearStatus();
+ StabilityControlsStatus stabilityControlsStatus = ( (OnVehicleData) msg).getStabilityControlsStatus();
Object oemCustomVehicleData = ( (OnVehicleData) msg).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME);
Boolean handsOffSteering = ( (OnVehicleData) msg).getHandsOffSteering();
// Valid Tests
@@ -183,6 +187,7 @@ public class OnVehicleDataTests extends BaseRpcTests{
assertEquals(TestValues.MATCH, VehicleDataHelper.TURN_SIGNAL, turnSignal);
assertEquals(TestValues.MATCH, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
assertEquals(TestValues.MATCH, VehicleDataHelper.GEAR_STATUS, gearStatus);
+ assertEquals(TestValues.MATCH, VehicleDataHelper.STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
assertEquals(TestValues.MATCH, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE, oemCustomVehicleData);
assertEquals(TestValues.MATCH, VehicleDataHelper.HANDS_OFF_STEERING, handsOffSteering);
// Invalid/Null Tests
@@ -222,6 +227,7 @@ public class OnVehicleDataTests extends BaseRpcTests{
assertNull(TestValues.NULL, msg.getHandsOffSteering());
assertNull(TestValues.NULL, msg.getWindowStatus());
assertNull(TestValues.NULL, msg.getGearStatus());
+ assertNull(TestValues.NULL, msg.getStabilityControlsStatus());
assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
}
@@ -244,8 +250,9 @@ public class OnVehicleDataTests extends BaseRpcTests{
JSONObject fuelRangeObj = new JSONObject();
JSONObject windowStatusObj = new JSONObject();
JSONObject gearStatusObj = new JSONObject();
+ JSONObject stabilityControlStatusObj = new JSONObject();
JSONArray fuelRangeArrayObj = new JSONArray();
- JSONArray windowStatusArrayObj = new JSONArray();
+ JSONArray windowStatusArrayObj = new JSONArray();
try {
//Set up the JSONObject to represent OnVehicleData:
@@ -370,8 +377,16 @@ public class OnVehicleDataTests extends BaseRpcTests{
// FUEL_RANGE
fuelRangeObj.put(FuelRange.KEY_TYPE, VehicleDataHelper.FUEL_RANGE_TYPE);
fuelRangeObj.put(FuelRange.KEY_RANGE, VehicleDataHelper.FUEL_RANGE_RANGE);
+ fuelRangeObj.put(FuelRange.KEY_CAPACITY, VehicleDataHelper.FUEL_RANGE_CAPACITY);
+ fuelRangeObj.put(FuelRange.KEY_CAPACITY_UNIT, VehicleDataHelper.FUEL_RANGE_CAPACITY_UNIT);
+ fuelRangeObj.put(FuelRange.KEY_LEVEL, VehicleDataHelper.FUEL_RANGE_LEVEL);
+ fuelRangeObj.put(FuelRange.KEY_LEVEL_STATE, VehicleDataHelper.FUEL_RANGE_LEVEL_STATE);
fuelRangeArrayObj.put(fuelRangeObj);
+ // STABILITY_CONTROLS_STATU
+ stabilityControlStatusObj.put(StabilityControlsStatus.KEY_ESC_SYSTEM, VehicleDataHelper.ESC_SYSTEM);
+ stabilityControlStatusObj.put(StabilityControlsStatus.KEY_TRAILER_SWAY_CONTROL, VehicleDataHelper.S_WAY_TRAILER);
+
// WINDOW_STATUS
windowStatusObj.put(WindowStatus.KEY_LOCATION, VehicleDataHelper.LOCATION_GRID);
windowStatusObj.put(WindowStatus.KEY_STATE, VehicleDataHelper.WINDOW_STATE);
@@ -414,6 +429,7 @@ public class OnVehicleDataTests extends BaseRpcTests{
reference.put(OnVehicleData.KEY_HANDS_OFF_STEERING, VehicleDataHelper.HANDS_OFF_STEERING);
reference.put(OnVehicleData.KEY_WINDOW_STATUS, windowStatusArrayObj);
reference.put(OnVehicleData.KEY_GEAR_STATUS, gearStatusObj);
+ reference.put(OnVehicleData.KEY_STABILITY_CONTROLS_STATUS, stabilityControlStatusObj);
reference.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE);
JSONObject underTest = msg.serializeJSON();
@@ -561,6 +577,20 @@ public class OnVehicleDataTests extends BaseRpcTests{
windowStatusReferenceList,
windowStatusUnderTestList));
}
+ else if (key.equals(GetVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS)) {
+ JSONObject myKeyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject myKeyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ StabilityControlsStatus status1 = new StabilityControlsStatus(JsonRPCMarshaller.deserializeJSONObject(myKeyObjReference));
+ StabilityControlsStatus status2 = new StabilityControlsStatus(JsonRPCMarshaller.deserializeJSONObject(myKeyObjTest));
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateStabilityControlStatus(
+ status1,
+ status2
+ )
+ );
+ }
else {
assertEquals(TestValues.TRUE, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
}
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
index 88d22cd8d..04a77613e 100644
--- 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
@@ -18,6 +18,7 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 74efd59e9..01ebf5f8c 100644
--- 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
@@ -18,12 +18,12 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 2fef7e829..5fce62fe4 100644
--- 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
@@ -21,12 +21,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 2224191dd..525fae442 100644
--- 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
@@ -22,12 +22,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java
index d2e41f85e..26ddbf7b5 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CancelInteractionTests.java
@@ -49,11 +49,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java
index 62a92acfc..02cc2d718 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CloseApplicationTests.java
@@ -49,10 +49,10 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 3e8e533e2..799936921 100644
--- 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
@@ -19,12 +19,12 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java
index 733932efb..8f905ac73 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/CreateWindowTests.java
@@ -16,11 +16,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 20d5fe591..a6defa4b7 100644
--- 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
@@ -15,11 +15,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 5174f9789..e6cba8157 100644
--- 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
@@ -15,11 +15,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 0fb31ba25..32104b281 100644
--- 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
@@ -15,11 +15,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 68adc14fa..4d0358cc6 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java
index c442395bd..e05748b29 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/DeleteWindowTests.java
@@ -14,11 +14,12 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 7b0ecacf9..44c4de760 100644
--- 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
@@ -17,12 +17,12 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
diff --git a/android/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 88e9fbffd..7e6cd3991 100644
--- a/android/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
@@ -14,11 +14,12 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* Created by austinkirk on 6/6/17.
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
index d97bc0f32..b4cd32af7 100644
--- 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
@@ -15,10 +15,10 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index f5e7bba89..02e7fb5ff 100644
--- 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
@@ -15,11 +15,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
public class GetAppServiceDataTests extends BaseRpcTests {
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
index 73d15ad6d..f9b8e528f 100644
--- 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
@@ -15,11 +15,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 450dcba1e..9d358cc8a 100644
--- 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
@@ -16,11 +16,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
public class GetFileTests extends BaseRpcTests {
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java
index 2aa7dc593..6d9bc2283 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetInteriorVehicleDataConsentTests.java
@@ -16,6 +16,7 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
diff --git a/android/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 4c7f5f461..17d500b6f 100644
--- a/android/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
@@ -16,11 +16,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 533ff8c50..6eb55d90f 100644
--- 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
@@ -16,11 +16,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
public class GetSystemCapabilityTests extends BaseRpcTests {
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
index f3b4b564e..637445ac7 100644
--- 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
@@ -15,12 +15,12 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
@@ -64,6 +64,7 @@ public class GetVehicleDataTests extends BaseRpcTests {
msg.setHandsOffSteering(TestValues.GENERAL_BOOLEAN);
msg.setWindowStatus(TestValues.GENERAL_BOOLEAN);
msg.setGearStatus(TestValues.GENERAL_BOOLEAN);
+ msg.setStabilityControlsStatus(TestValues.GENERAL_BOOLEAN);
msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN);
return msg;
@@ -116,6 +117,7 @@ public class GetVehicleDataTests extends BaseRpcTests {
result.put(GetVehicleData.KEY_HANDS_OFF_STEERING, TestValues.GENERAL_BOOLEAN);
result.put(GetVehicleData.KEY_GEAR_STATUS, TestValues.GENERAL_BOOLEAN);
result.put(GetVehicleData.KEY_WINDOW_STATUS, TestValues.GENERAL_BOOLEAN);
+ result.put(GetVehicleData.KEY_STABILITY_CONTROLS_STATUS, TestValues.GENERAL_BOOLEAN);
result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN);
}catch(JSONException e){
fail(TestValues.JSON_FAIL);
@@ -163,6 +165,7 @@ public class GetVehicleDataTests extends BaseRpcTests {
assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getHandsOffSteering());
assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getWindowStatus());
assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getGearStatus());
+ assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getStabilityControlsStatus());
assertTrue(TestValues.TRUE, ( (GetVehicleData) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
// Invalid/Null Tests
@@ -202,6 +205,7 @@ public class GetVehicleDataTests extends BaseRpcTests {
assertNull(TestValues.NULL, msg.getHandsOffSteering());
assertNull(TestValues.NULL, msg.getWindowStatus());
assertNull(TestValues.NULL, msg.getGearStatus());
+ assertNull(TestValues.NULL, msg.getStabilityControlsStatus());
assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
}
@@ -257,6 +261,7 @@ public class GetVehicleDataTests extends BaseRpcTests {
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_HANDS_OFF_STEERING), cmd.getHandsOffSteering());
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_WINDOW_STATUS), cmd.getWindowStatus());
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_GEAR_STATUS), cmd.getGearStatus());
+ assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, GetVehicleData.KEY_STABILITY_CONTROLS_STATUS), cmd.getStabilityControlsStatus());
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
} catch (JSONException e) {
fail(TestValues.JSON_FAIL);
diff --git a/android/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 a52d1a644..8a9586a93 100644
--- a/android/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
@@ -16,11 +16,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* Created by austinkirk on 6/6/17.
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
index 92e7286e4..cc5b542a0 100644
--- 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
@@ -15,10 +15,10 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 9a9b7b375..bdc8bb9ac 100644
--- 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
@@ -15,11 +15,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
public class PerformAppServiceInteractionTests extends BaseRpcTests {
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
index abbe3d644..a1525c773 100644
--- 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
@@ -23,12 +23,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 176cc3ec5..89afaa843 100644
--- 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
@@ -23,12 +23,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 9d0c3ed94..e999cb6d1 100644
--- 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
@@ -17,12 +17,12 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
public class PublishAppServiceTests extends BaseRpcTests {
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
index b70c83794..0e3b39aab 100644
--- 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
@@ -17,11 +17,11 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.zip.CRC32;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 151f5cc3e..0f9319f24 100644
--- 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
@@ -17,12 +17,12 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 665a3dc80..b61687bd7 100644
--- 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
@@ -26,12 +26,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java
index e786d1786..840eb246d 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ReleaseInteriorVehicleDataModuleTests.java
@@ -16,11 +16,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
public class ReleaseInteriorVehicleDataModuleTests extends BaseRpcTests {
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
index 68448c5a6..bbb4f8012 100644
--- 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
@@ -18,11 +18,11 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index e6d8b146d..40d4eb33e 100644
--- 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
@@ -20,12 +20,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 99a74dfae..ad1ad8a2c 100644
--- 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
@@ -18,12 +18,12 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 5878aad7c..01a391518 100644
--- 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
@@ -15,11 +15,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 22118bdb1..f5a080295 100644
--- 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
@@ -17,12 +17,12 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
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
index 379b1c1ee..abf889104 100644
--- 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
@@ -24,12 +24,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
diff --git a/android/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 1285acafd..ad4bb2780 100644
--- a/android/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
@@ -17,12 +17,12 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index a60709dba..c4937aa95 100644
--- 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
@@ -19,12 +19,12 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java
index 3e486bc6a..27d876f14 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/ShowAppMenuTests.java
@@ -50,11 +50,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 85c830214..482c73783 100644
--- 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
@@ -21,12 +21,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 742d23ff4..14585c439 100644
--- 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
@@ -24,12 +24,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 32f60d4e5..def35eae2 100644
--- 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
@@ -17,12 +17,12 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index f0214c78c..b9c89493f 100644
--- 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
@@ -20,12 +20,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
public class SpeakTests extends BaseRpcTests {
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
index 19b192b31..7cc1ca35c 100644
--- 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
@@ -15,6 +15,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index fee5ddd25..341eb73d4 100644
--- 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
@@ -15,12 +15,12 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
@@ -63,6 +63,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests {
msg.setHandsOffSteering(TestValues.GENERAL_BOOLEAN);
msg.setWindowStatus(TestValues.GENERAL_BOOLEAN);
msg.setGearStatus(TestValues.GENERAL_BOOLEAN);
+ msg.setStabilityControlsStatus(TestValues.GENERAL_BOOLEAN);
msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN);
return msg;
@@ -114,6 +115,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests {
result.put(SubscribeVehicleData.KEY_HANDS_OFF_STEERING, TestValues.GENERAL_BOOLEAN);
result.put(SubscribeVehicleData.KEY_WINDOW_STATUS, TestValues.GENERAL_BOOLEAN);
result.put(SubscribeVehicleData.KEY_GEAR_STATUS, TestValues.GENERAL_BOOLEAN);
+ result.put(SubscribeVehicleData.KEY_STABILITY_CONTROLS_STATUS, TestValues.GENERAL_BOOLEAN);
result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN);
} catch (JSONException e) {
fail(TestValues.JSON_FAIL);
@@ -160,6 +162,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests {
assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getHandsOffSteering());
assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getWindowStatus());
assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getGearStatus());
+ assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getStabilityControlsStatus());
assertTrue(TestValues.MATCH,( (SubscribeVehicleData) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
// Invalid/Null Tests
@@ -198,6 +201,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests {
assertNull(TestValues.NULL, msg.getHandsOffSteering());
assertNull(TestValues.NULL, msg.getWindowStatus());
assertNull(TestValues.NULL, msg.getGearStatus());
+ assertNull(TestValues.NULL, msg.getStabilityControlsStatus());
assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
}
@@ -251,6 +255,7 @@ public class SubscribeVehicleDataTests extends BaseRpcTests {
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus());
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_HANDS_OFF_STEERING), cmd.getHandsOffSteering());
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_WINDOW_STATUS), cmd.getWindowStatus());
+ assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, SubscribeVehicleData.KEY_STABILITY_CONTROLS_STATUS), cmd.getStabilityControlsStatus());
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
} catch (JSONException e) {
fail(TestValues.JSON_FAIL);
diff --git a/android/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 2ce400e55..a28d31bbf 100644
--- a/android/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
@@ -15,10 +15,10 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* Created by austinkirk on 6/7/17.
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
index aeb061dc6..dae825cc2 100644
--- 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
@@ -18,12 +18,12 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java
index 796fe2a25..7b57be8ac 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnpublishAppServiceTests.java
@@ -50,11 +50,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index dec7b0376..66bd76bdb 100644
--- 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
@@ -15,10 +15,10 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 97833ce02..74160bf4c 100644
--- 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
@@ -16,11 +16,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 747b61563..2ea0dae9b 100644
--- 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
@@ -16,12 +16,12 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
@@ -66,6 +66,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests {
msg.setGearStatus(TestValues.GENERAL_BOOLEAN);
msg.setHandsOffSteering(TestValues.GENERAL_BOOLEAN);
msg.setWindowStatus(TestValues.GENERAL_BOOLEAN);
+ msg.setStabilityControlsStatus(TestValues.GENERAL_BOOLEAN);
msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN);
return msg;
@@ -118,6 +119,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests {
result.put(UnsubscribeVehicleData.KEY_HANDS_OFF_STEERING, TestValues.GENERAL_BOOLEAN);
result.put(UnsubscribeVehicleData.KEY_WINDOW_STATUS, TestValues.GENERAL_BOOLEAN);
result.put(UnsubscribeVehicleData.KEY_GEAR_STATUS, TestValues.GENERAL_BOOLEAN);
+ result.put(UnsubscribeVehicleData.KEY_STABILITY_CONTROLS_STATUS, TestValues.GENERAL_BOOLEAN);
result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_BOOLEAN);
} catch (JSONException e) {
fail(TestValues.JSON_FAIL);
@@ -164,6 +166,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests {
assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getHandsOffSteering());
assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getWindowStatus());
assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getGearStatus());
+ assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getStabilityControlsStatus());
assertTrue(TestValues.TRUE,( (UnsubscribeVehicleData) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
// Invalid/Null Tests
UnsubscribeVehicleData msg = new UnsubscribeVehicleData();
@@ -202,6 +205,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests {
assertNull(TestValues.NULL, msg.getHandsOffSteering());
assertNull(TestValues.NULL, msg.getWindowStatus());
assertNull(TestValues.NULL, msg.getGearStatus());
+ assertNull(TestValues.NULL, msg.getStabilityControlsStatus());
assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
}
@@ -257,6 +261,7 @@ public class UnsubscribeVehicleDataTests extends BaseRpcTests {
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_HANDS_OFF_STEERING), cmd.getHandsOffSteering());
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_WINDOW_STATUS), cmd.getWindowStatus());
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_GEAR_STATUS), cmd.getGearStatus());
+ assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, UnsubscribeVehicleData.KEY_STABILITY_CONTROLS_STATUS), cmd.getStabilityControlsStatus());
assertEquals(TestValues.MATCH, JsonUtils.readBooleanFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
}
diff --git a/android/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 5d20c8454..fe3aa9ffc 100644
--- a/android/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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 53dc91fc6..905bed6d8 100644
--- 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
@@ -21,12 +21,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index e4d69e79f..618cb9c45 100644
--- 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
@@ -15,6 +15,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 861de0d37..163fec190 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 01805fce6..7ff5cfaef 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index d8f554c53..9a89d8d27 100644
--- 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
@@ -15,11 +15,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
diff --git a/android/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 2c4bfc651..1dcfd95d6 100644
--- a/android/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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java
index a981719e9..fb9374247 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CancelInteractionResponseTests.java
@@ -48,6 +48,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 6888c589d..1c96e774d 100644
--- 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
@@ -15,9 +15,9 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java
index 6eb9a09a5..135155e6e 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CloseApplicationResponseTests.java
@@ -48,6 +48,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java
index a06af985b..b50b34221 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/CreateWindowResponseTest.java
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index b2e6e27a9..74cd75664 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 0e529dc69..42b26d1bd 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 24ce266d1..bb0e428e0 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 8392f915b..0084305ad 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java
index 347db5ea6..2d4486f21 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/DeleteWindowResponseTest.java
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 7bfefbeea..302c01c8e 100644
--- 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
@@ -16,6 +16,7 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
diff --git a/android/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 ff23c5ad7..006e6d050 100644
--- a/android/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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index f68a6837b..c9da248f8 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 3e1d1f136..49de496e4 100644
--- 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
@@ -15,6 +15,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index ea4d48790..3ff630c93 100644
--- 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
@@ -17,12 +17,12 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index a4abf011d..867e91cb2 100644
--- 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
@@ -16,11 +16,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java
index 411691bd0..512d324e3 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetInteriorVehicleDataConsentResponseTests.java
@@ -16,6 +16,7 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
diff --git a/android/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 80185c05c..af6f2cb4b 100644
--- a/android/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
@@ -16,6 +16,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
diff --git a/android/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 ee2b24d1f..827b340e7 100644
--- a/android/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
@@ -16,11 +16,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
public class GetSystemCapabilityResponseTests extends BaseRpcTests {
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
index 6ebc03f80..91e13586a 100644
--- 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
@@ -17,6 +17,7 @@ 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.StabilityControlsStatus;
import com.smartdevicelink.proxy.rpc.TireStatus;
import com.smartdevicelink.proxy.rpc.WindowStatus;
import com.smartdevicelink.proxy.rpc.enums.TurnSignal;
@@ -37,12 +38,12 @@ import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
@@ -100,10 +101,11 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{
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);
- result.put(GetVehicleDataResponse.KEY_WINDOW_STATUS, VehicleDataHelper.WINDOW_STATUS_LIST);
+ result.put(GetVehicleDataResponse.KEY_WINDOW_STATUS, VehicleDataHelper.WINDOW_STATUS_LIST);
result.put(GetVehicleDataResponse.KEY_HANDS_OFF_STEERING, VehicleDataHelper.HANDS_OFF_STEERING);
result.put(GetVehicleDataResponse.KEY_GEAR_STATUS, VehicleDataHelper.GEAR_STATUS);
- result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE);
+ result.put(GetVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS, VehicleDataHelper.STABILITY_CONTROLS_STATUS);
+ result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE);
} catch(JSONException e){
fail(TestValues.JSON_FAIL);
}
@@ -127,6 +129,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{
JSONObject emergencyEventObj = new JSONObject();
JSONObject clusterModeStatusObj = new JSONObject();
JSONObject myKeyObj = new JSONObject();
+ JSONObject stabilityControlsStatusObj = new JSONObject();
JSONObject fuelRangeObj = new JSONObject();
JSONObject windowStatusObj = new JSONObject();
JSONObject gearStatusObj = new JSONObject();
@@ -248,13 +251,21 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{
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);
-
+
+ // STABILITY_CONTROL_STATUS
+ stabilityControlsStatusObj.put(StabilityControlsStatus.KEY_ESC_SYSTEM, VehicleDataHelper.ESC_SYSTEM);
+ stabilityControlsStatusObj.put(StabilityControlsStatus.KEY_TRAILER_SWAY_CONTROL, VehicleDataHelper.S_WAY_TRAILER);
+
//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);
+ fuelRangeObj.put(FuelRange.KEY_CAPACITY, VehicleDataHelper.FUEL_RANGE_CAPACITY);
+ fuelRangeObj.put(FuelRange.KEY_CAPACITY_UNIT, VehicleDataHelper.FUEL_RANGE_CAPACITY_UNIT);
+ fuelRangeObj.put(FuelRange.KEY_LEVEL, VehicleDataHelper.FUEL_RANGE_LEVEL);
+ fuelRangeObj.put(FuelRange.KEY_LEVEL_STATE, VehicleDataHelper.FUEL_RANGE_LEVEL_STATE);
fuelRangeArrayObj.put(fuelRangeObj);
//GEAR_STATUS
@@ -299,6 +310,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{
reference.put(GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, VehicleDataHelper.ELECTRONIC_PARK_BRAKE_STATUS);
reference.put(GetVehicleDataResponse.KEY_WINDOW_STATUS, windowStatusArrayObj);
reference.put(GetVehicleDataResponse.KEY_HANDS_OFF_STEERING, VehicleDataHelper.HANDS_OFF_STEERING);
+ reference.put(GetVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatusObj);
reference.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE);
JSONObject underTest = msg.serializeJSON();
@@ -425,6 +437,20 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{
new GearStatus(JsonRPCMarshaller.deserializeJSONObject(myKeyObjReference)),
new GearStatus(JsonRPCMarshaller.deserializeJSONObject(myKeyObjTest))));
}
+ else if (key.equals(GetVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS)) {
+ JSONObject myKeyObjReference = JsonUtils.readJsonObjectFromJsonObject(reference, key);
+ JSONObject myKeyObjTest = JsonUtils.readJsonObjectFromJsonObject(underTest, key);
+
+ StabilityControlsStatus status1 = new StabilityControlsStatus(JsonRPCMarshaller.deserializeJSONObject(myKeyObjReference));
+ StabilityControlsStatus status2 = new StabilityControlsStatus(JsonRPCMarshaller.deserializeJSONObject(myKeyObjTest));
+
+ assertTrue("JSON value didn't match expected value for key \"" + key + "\".",
+ Validator.validateStabilityControlStatus(
+ status1,
+ status2
+ )
+ );
+ }
else if (key.equals(GetVehicleDataResponse.KEY_FUEL_RANGE)) {
JSONArray fuelRangeArrayObjReference = JsonUtils.readJsonArrayFromJsonObject(reference, key);
List<FuelRange> fuelRangeRefereceList = new ArrayList<FuelRange>();
@@ -514,6 +540,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{
assertEquals(TestValues.MATCH, VehicleDataHelper.WINDOW_STATUS_LIST, ( (GetVehicleDataResponse) msg ).getWindowStatus());
assertEquals(TestValues.MATCH, VehicleDataHelper.GEAR_STATUS, ( (GetVehicleDataResponse) msg ).getGearStatus());
assertEquals(TestValues.MATCH, VehicleDataHelper.HANDS_OFF_STEERING, ( (GetVehicleDataResponse) msg ).getHandsOffSteering());
+ assertEquals(TestValues.MATCH, VehicleDataHelper.STABILITY_CONTROLS_STATUS, ( (GetVehicleDataResponse) msg ).getStabilityControlsStatus());
assertEquals(TestValues.MATCH, VehicleDataHelper.OEM_CUSTOM_VEHICLE_DATA_STATE, ( (GetVehicleDataResponse) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
// Invalid/Null Tests
@@ -550,6 +577,7 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{
assertNull(TestValues.NULL, msg.getElectronicParkBrakeStatus());
assertNull(TestValues.NULL, msg.getGearStatus());
assertNull(TestValues.NULL, msg.getHandsOffSteering());
+ assertNull(TestValues.NULL, msg.getStabilityControlsStatus());
assertNull(TestValues.NULL, msg.getWindowStatus());
assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
}
@@ -656,6 +684,10 @@ public class GetVehicleDataResponseTests extends BaseRpcTests{
assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_TURN_SIGNAL), cmd.getTurnSignal().toString());
assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, GetVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS), cmd.getElectronicParkBrakeStatus().toString());
assertEquals(TestValues.MATCH, JsonUtils.readStringFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME), cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
+
+ JSONObject stabilityControlStatusObj = JsonUtils.readJsonObjectFromJsonObject(parameters, GetVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS);
+ StabilityControlsStatus stabilityControlsStatus = new StabilityControlsStatus(JsonRPCMarshaller.deserializeJSONObject(stabilityControlStatusObj));
+ assertTrue(TestValues.TRUE, Validator.validateStabilityControlStatus(stabilityControlsStatus, cmd.getStabilityControlsStatus()));
} catch (JSONException e) {
e.printStackTrace();
}
diff --git a/android/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 fb123bef4..131aba5fa 100644
--- a/android/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
@@ -18,6 +18,7 @@ import org.junit.Test;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 7b7bd20ec..67b23ef2b 100644
--- 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
@@ -17,12 +17,12 @@ import org.junit.Test;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
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
index 4280902e2..2278a61a1 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 7cff8e766..78f9d258b 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 32c42c16c..83f4bd734 100644
--- 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
@@ -15,6 +15,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 5bb6f923a..197aa13d4 100644
--- 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
@@ -17,12 +17,12 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index e95285db8..6c34c9df4 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index aec63227d..b18bea1c7 100644
--- 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
@@ -19,6 +19,7 @@ import org.junit.Test;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 862ed5342..4e790a758 100644
--- 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
@@ -31,12 +31,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java
index 965980a0d..b2ba952b8 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ReleaseInteriorVehicleDataModuleResponseTests.java
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index e8d3576e6..b6394fa0a 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 4e12cb78c..286cb9ad2 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 7208eeff4..938d8dbc6 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index e6f0bf140..5203bb1e8 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 63d63dab9..6985ad238 100644
--- 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
@@ -23,12 +23,12 @@ import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index 9765dcfba..825c358cf 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
diff --git a/android/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 7abcdcecc..9e7fd8129 100644
--- a/android/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
@@ -17,12 +17,12 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
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
index d8f699b5a..4c4ae89ce 100644
--- 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
@@ -15,9 +15,9 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java
index 1cfafd319..28cf0b436 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/ShowAppMenuResponseTests.java
@@ -49,6 +49,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index aa44a190b..a11e31881 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index ebd5f41b6..2062c5fe1 100644
--- 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
@@ -15,9 +15,9 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
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
index f454af9eb..4ea612e2b 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index f2880d3eb..b8f8573cb 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 1c58b13bc..ed607231f 100644
--- 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
@@ -15,9 +15,9 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
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
index 643935a02..408a0af28 100644
--- 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
@@ -18,11 +18,11 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.fail;
/**
@@ -68,6 +68,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests {
msg.setGearStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GEARSTATUS.ordinal()));
msg.setHandsOffSteering(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING.ordinal()));
msg.setWindowStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WINDOWSTATUS.ordinal()));
+ msg.setStabilityControlsStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS.ordinal()));
msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA);
return msg;
@@ -122,6 +123,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests {
result.put(SubscribeVehicleDataResponse.KEY_TURN_SIGNAL, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()).serializeJSON());
result.put(SubscribeVehicleDataResponse.KEY_WINDOW_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WINDOWSTATUS.ordinal()).serializeJSON());
result.put(SubscribeVehicleDataResponse.KEY_GEAR_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GEARSTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS.ordinal()).serializeJSON());
result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON());
result.put(SubscribeVehicleDataResponse.KEY_HANDS_OFF_STEERING, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING.ordinal()).serializeJSON());
result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA.serializeJSON());
@@ -169,6 +171,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests {
VehicleDataResult testHOffSteering = ( (SubscribeVehicleDataResponse) msg ).getHandsOffSteering();
VehicleDataResult testWindowStatus = ( (SubscribeVehicleDataResponse) msg ).getWindowStatus();
VehicleDataResult testGearStatus = ( (SubscribeVehicleDataResponse) msg ).getGearStatus();
+ VehicleDataResult testStabilityControlStatus = ( (SubscribeVehicleDataResponse) msg ).getStabilityControlsStatus();
VehicleDataResult testOEMCustomVehicleData = ( (SubscribeVehicleDataResponse) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME);
// Valid Tests
@@ -203,6 +206,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests {
assertTrue(TestValues.TRUE, testHOffSteering.getDataType().equals(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING));
assertTrue(TestValues.TRUE, testGearStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_GEARSTATUS));
assertTrue(TestValues.TRUE, testWindowStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WINDOWSTATUS));
+ assertTrue(TestValues.TRUE, testStabilityControlStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS));
assertTrue(TestValues.TRUE, testOEMCustomVehicleData.getOEMCustomVehicleDataType().equals(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
// Invalid/Null Tests
@@ -241,6 +245,7 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests {
assertNull(TestValues.NULL, msg.getHandsOffSteering());
assertNull(TestValues.NULL, msg.getWindowStatus());
assertNull(TestValues.NULL, msg.getGearStatus());
+ assertNull(TestValues.NULL, msg.getStabilityControlsStatus());
assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
}
@@ -389,6 +394,10 @@ public class SubscribeVehicleDataResponseTest extends BaseRpcTests {
VehicleDataResult referenceGearStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(gearStatus));
assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceGearStatus, cmd.getGearStatus()));
+ JSONObject stabilityControlStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, SubscribeVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS);
+ VehicleDataResult referenceStabilityControlStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(stabilityControlStatus));
+ assertTrue(TestValues.TRUE, Validator.validateStabilityControlStatus(referenceStabilityControlStatus, cmd.getStabilityControlsStatus()));
+
JSONObject oemCustomVehicleDataName = JsonUtils.readJsonObjectFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME);
VehicleDataResult referenceOemCustomData = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(oemCustomVehicleDataName));
assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceOemCustomData, cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)));
diff --git a/android/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 239702805..8a156d12f 100644
--- a/android/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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 9f4e464f4..a52ff7c21 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java
index 7536dd2a7..474c05cd6 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnpublishAppServiceResponseTests.java
@@ -49,6 +49,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 01aad979c..14c276504 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 3cf7d6491..de29a5288 100644
--- 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
@@ -15,9 +15,9 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
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
index dc69b66ae..80c61c284 100644
--- 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
@@ -20,12 +20,12 @@ import org.junit.Test;
import java.util.Hashtable;
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
import static junit.framework.TestCase.fail;
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
/**
* This is a unit test class for the SmartDeviceLink library project class :
@@ -70,6 +70,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests {
msg.setWindowStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WINDOWSTATUS.ordinal()));
msg.setHandsOffSteering(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING.ordinal()));
msg.setGearStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GEARSTATUS.ordinal()));
+ msg.setStabilityControlsStatus(TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS.ordinal()));
msg.setOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA);
return msg;
@@ -124,6 +125,8 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests {
result.put(SubscribeVehicleDataResponse.KEY_TURN_SIGNAL, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_TURNSIGNAL.ordinal()).serializeJSON());
result.put(SubscribeVehicleDataResponse.KEY_GEAR_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_GEARSTATUS.ordinal()).serializeJSON());
result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS.ordinal()).serializeJSON());
+ result.put(SubscribeVehicleDataResponse.KEY_ELECTRONIC_PARK_BRAKE_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS.ordinal()).serializeJSON());
result.put(SubscribeVehicleDataResponse.KEY_HANDS_OFF_STEERING, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING.ordinal()).serializeJSON());
result.put(SubscribeVehicleDataResponse.KEY_WINDOW_STATUS, TestValues.GENERAL_VEHICLEDATARESULT_LIST.get(VehicleDataType.VEHICLEDATA_WINDOWSTATUS.ordinal()).serializeJSON());
result.put(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA.serializeJSON());
@@ -171,6 +174,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests {
VehicleDataResult testHOffSteering = ( (UnsubscribeVehicleDataResponse) msg ).getHandsOffSteering();
VehicleDataResult testGearStatus = ( (UnsubscribeVehicleDataResponse) msg ).getGearStatus();
VehicleDataResult testWindowStatus = ( (UnsubscribeVehicleDataResponse) msg ).getWindowStatus();
+ VehicleDataResult testStabilityControlStatus = ( (UnsubscribeVehicleDataResponse) msg ).getStabilityControlsStatus();
VehicleDataResult testOemCustomData = ( (UnsubscribeVehicleDataResponse) msg ).getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME);
// Valid Tests
@@ -204,6 +208,7 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests {
assertTrue(TestValues.TRUE, testEBrakeStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_ELECTRONICPARKBRAKESTATUS));
assertTrue(TestValues.TRUE, testHOffSteering.getDataType().equals(VehicleDataType.VEHICLEDATA_HANDSOFFSTEERING));
assertTrue(TestValues.TRUE, testWindowStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_WINDOWSTATUS));
+ assertTrue(TestValues.TRUE, testStabilityControlStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_STABILITYCONTROLSSTATUS));
assertTrue(TestValues.TRUE, testOemCustomData.getOEMCustomVehicleDataType().equals(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
assertTrue(TestValues.TRUE, testGearStatus.getDataType().equals(VehicleDataType.VEHICLEDATA_GEARSTATUS));
@@ -243,6 +248,8 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests {
assertNull(TestValues.NULL, msg.getGearStatus());
assertNull(TestValues.NULL, msg.getHandsOffSteering());
assertNull(TestValues.NULL, msg.getWindowStatus());
+ assertNull(TestValues.NULL, msg.getHandsOffSteering());
+ assertNull(TestValues.NULL, msg.getStabilityControlsStatus());
assertNull(TestValues.NULL, msg.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME));
}
@@ -394,6 +401,10 @@ public class UnsubscribeVehicleDataResponseTest extends BaseRpcTests {
JSONObject oemCustomData = JsonUtils.readJsonObjectFromJsonObject(parameters, TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME);
VehicleDataResult referenceOemCustomData = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(oemCustomData));
assertTrue(TestValues.TRUE, Validator.validateVehicleDataResult(referenceOemCustomData, cmd.getOEMCustomVehicleData(TestValues.GENERAL_OEM_CUSTOM_VEHICLE_DATA_NAME)));
+
+ JSONObject stabilityControlsStatus = JsonUtils.readJsonObjectFromJsonObject(parameters, UnsubscribeVehicleDataResponse.KEY_STABILITY_CONTROLS_STATUS);
+ VehicleDataResult referenceStabilityControlStatus = new VehicleDataResult(JsonRPCMarshaller.deserializeJSONObject(stabilityControlsStatus));
+ assertTrue(TestValues.TRUE, Validator.validateStabilityControlStatus(referenceStabilityControlStatus, cmd.getStabilityControlsStatus()));
} catch (JSONException e) {
e.printStackTrace();
}
diff --git a/android/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 5360c023c..bd962f474 100644
--- a/android/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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index 47951d34c..eaaebf1bd 100644
--- 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
@@ -14,6 +14,7 @@ import org.json.JSONObject;
import org.junit.Test;
import java.util.Hashtable;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
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
index aeb73e3de..f2648c7e2 100644
--- 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
@@ -2,7 +2,7 @@ package com.smartdevicelink.test.security;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.security.SdlSecurityBase;
import com.smartdevicelink.test.TestValues;
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
index e5e47f3a5..dbec1301e 100644
--- 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
@@ -1,12 +1,10 @@
package com.smartdevicelink.test.streaming;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.streaming.IStreamListener;
import com.smartdevicelink.test.TestValues;
-import com.smartdevicelink.transport.BTTransportConfig;
-import com.smartdevicelink.transport.BaseTransportConfig;
import com.smartdevicelink.transport.MultiplexTransportConfig;
import com.smartdevicelink.util.Version;
@@ -34,14 +32,11 @@ public class AbstractPacketizerTests extends TestCase {
// 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()));
@@ -50,31 +45,15 @@ public class AbstractPacketizerTests extends TestCase {
testSdlSession = new SdlSession(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(TestValues.NOT_NULL, testPacketizer1);
assertNotNull(TestValues.NOT_NULL, testPacketizer2);
- assertNotNull(TestValues.NOT_NULL, testPacketizer3);
-
+
assertEquals(TestValues.MATCH, testListener, testPacketizer1.getListener());
assertEquals(TestValues.MATCH, testInputStream, testPacketizer1.getInputStream());
assertEquals(TestValues.MATCH, testSessionType, testPacketizer1.getSessionType());
assertEquals(TestValues.MATCH, testSessionId, testPacketizer1.getSessionId());
- assertEquals(TestValues.MATCH, testListener, testPacketizer3.getListener());
- assertEquals(TestValues.MATCH, testInputStream, testPacketizer3.getInputStream());
- assertEquals(TestValues.MATCH, testSessionType, testPacketizer3.getSessionType());
- assertEquals(TestValues.MATCH, testSessionId, testPacketizer3.getSessionId());
- assertEquals(TestValues.MATCH, testWiproVersion, testPacketizer3.getWiproVersion());
- assertEquals(TestValues.MATCH, testRpcRequest.getFunctionName(), testPacketizer3.getRPCRequest().getFunctionName());
- assertEquals(TestValues.MATCH, testSdlSession, testPacketizer3.getSdlSession());
// Invalid/Null Tests
assertNull(TestValues.NULL, testPacketizer2.getListener());
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
index 1c7005012..14905fa7d 100644
--- 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
@@ -1,6 +1,6 @@
package com.smartdevicelink.test.streaming;
-import com.smartdevicelink.SdlConnection.ISdlSessionListener;
+import com.smartdevicelink.session.ISdlSessionListener;
import com.smartdevicelink.proxy.RPCMessage;
import com.smartdevicelink.transport.BaseTransportConfig;
import com.smartdevicelink.util.Version;
diff --git a/android/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..77eae6cba 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java
@@ -1,11 +1,9 @@
package com.smartdevicelink.test.streaming;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.streaming.AbstractPacketizer;
import com.smartdevicelink.streaming.IStreamListener;
-import com.smartdevicelink.util.Version;
import java.io.IOException;
import java.io.InputStream;
@@ -16,8 +14,6 @@ import java.io.InputStream;
*/
public class MockPacketizer extends AbstractPacketizer {
public MockPacketizer (IStreamListener l, InputStream i, SessionType s, byte sid, SdlSession sdlsession) throws IOException { super (l, i, s, sid, sdlsession); }
- public MockPacketizer (IStreamListener l, InputStream i, RPCRequest r, SessionType s, byte sid, Version protocolVersion,SdlSession sdlsession) throws IOException { super (l, i, r, s, sid, protocolVersion, sdlsession); }
- public MockPacketizer (IStreamListener l, InputStream i, RPCRequest r, SessionType s, byte sid, byte w, SdlSession sdlsession) throws IOException { super (l, i, r, s, sid, w, sdlsession); }
@Override public void start() throws IOException { }
@Override public void stop() { }
@@ -25,12 +21,7 @@ public class MockPacketizer extends AbstractPacketizer {
public IStreamListener getListener () { return _streamListener; }
public InputStream getInputStream () { return is; }
public SessionType getSessionType () { return _serviceType; }
- public SdlSession getSdlSession () { return _session; }
public byte getSessionId () { return _rpcSessionID; }
- public RPCRequest getRPCRequest () { return _request; }
- @Deprecated
- public byte getWiproVersion () { if(_wiproVersion != null){return (byte)_wiproVersion.getMajor(); }else{return 5;}}
- public Version getProtocolVersion () { return _wiproVersion; }
@Override public void pause() { }
@Override public void resume() { }
diff --git a/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
index 736798d67..7791a1c79 100644
--- 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
@@ -1,14 +1,12 @@
package com.smartdevicelink.test.streaming;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.protocol.ProtocolMessage;
import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+import com.smartdevicelink.streaming.video.IVideoStreamListener;
import com.smartdevicelink.streaming.IStreamListener;
import com.smartdevicelink.streaming.StreamPacketizer;
import com.smartdevicelink.test.TestValues;
-import com.smartdevicelink.transport.BTTransportConfig;
-import com.smartdevicelink.transport.BaseTransportConfig;
import com.smartdevicelink.transport.MultiplexTransportConfig;
import junit.framework.TestCase;
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
deleted file mode 100644
index 561cc1ef7..000000000
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamRPCPacketizerTests.java
+++ /dev/null
@@ -1,57 +0,0 @@
-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.TestValues;
-import com.smartdevicelink.transport.BTTransportConfig;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.MultiplexTransportConfig;
-
-import junit.framework.TestCase;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
-
-/**
- * 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();
-
- MockInterfaceBroker interfaceBroker = new MockInterfaceBroker();
- MultiplexTransportConfig transportConfig = new MultiplexTransportConfig(getInstrumentation().getTargetContext(),"19216801");
- SdlSession testSdlSession = new SdlSession(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(TestValues.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/android/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 60fa6fb80..5dfe36e19 100644
--- a/android/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
@@ -33,10 +33,10 @@ package com.smartdevicelink.test.streaming.video;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.protocol.ProtocolMessage;
import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+import com.smartdevicelink.streaming.video.IVideoStreamListener;
import com.smartdevicelink.streaming.IStreamListener;
import com.smartdevicelink.streaming.video.RTPH264Packetizer;
import com.smartdevicelink.test.streaming.MockInterfaceBroker;
diff --git a/android/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 e5b07930e..4a0d7b87f 100644
--- a/android/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
@@ -4,13 +4,14 @@ import android.annotation.TargetApi;
import android.content.Context;
import android.os.Bundle;
import android.os.Looper;
-import androidx.test.platform.app.InstrumentationRegistry;
import android.view.Display;
import android.view.MotionEvent;
import android.widget.RelativeLayout;
+import androidx.test.platform.app.InstrumentationRegistry;
+
import com.smartdevicelink.encoder.VirtualDisplayEncoder;
-import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+import com.smartdevicelink.streaming.video.IVideoStreamListener;
import com.smartdevicelink.streaming.video.SdlRemoteDisplay;
import com.smartdevicelink.streaming.video.VideoStreamingParameters;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/VideoStreamingParametersTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/VideoStreamingParametersTest.java
index 5867fee7f..a297a9626 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/VideoStreamingParametersTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/video/VideoStreamingParametersTest.java
@@ -25,6 +25,7 @@ public class VideoStreamingParametersTest {
private VideoStreamingParameters params;
private VideoStreamingCapability capability;
private ImageResolution preferredResolution;
+ private final String vehicleMake = "SDL";
@Before
public void setUp() {
@@ -39,7 +40,7 @@ public class VideoStreamingParametersTest {
capability.setScale(null);
capability.setPreferredResolution(preferredResolution);
- params.update(capability);
+ params.update(capability, vehicleMake);
int width = params.getResolution().getResolutionWidth();
int height = params.getResolution().getResolutionHeight();
@@ -55,7 +56,7 @@ public class VideoStreamingParametersTest {
capability.setScale(1.0);
capability.setPreferredResolution(preferredResolution);
- params.update(capability);
+ params.update(capability, vehicleMake);
int width = params.getResolution().getResolutionWidth();
int height = params.getResolution().getResolutionHeight();
@@ -71,7 +72,7 @@ public class VideoStreamingParametersTest {
capability.setScale(1.25);
capability.setPreferredResolution(preferredResolution);
- params.update(capability);
+ params.update(capability, vehicleMake);
int width = params.getResolution().getResolutionWidth();
int height = params.getResolution().getResolutionHeight();
@@ -87,7 +88,7 @@ public class VideoStreamingParametersTest {
capability.setScale(1.5);
capability.setPreferredResolution(preferredResolution);
- params.update(capability);
+ params.update(capability, vehicleMake);
int width = params.getResolution().getResolutionWidth();
int height = params.getResolution().getResolutionHeight();
@@ -175,23 +176,23 @@ public class VideoStreamingParametersTest {
assertNull(params.getFormat());
- params.update(capability);
+ params.update(capability, vehicleMake);
assertEquals(params.getFormat(), format);
format = new VideoStreamingFormat(VideoStreamingProtocol.RTP, VideoStreamingCodec.H264);
capability.setSupportedFormats(Collections.singletonList(format));
- params.update(capability);
+ params.update(capability, vehicleMake);
assertEquals(params.getFormat(), format);
format = new VideoStreamingFormat(VideoStreamingProtocol.RTP, VideoStreamingCodec.H265);
capability.setSupportedFormats(Collections.singletonList(format));
- params.update(capability);
+ params.update(capability, vehicleMake);
assertFalse(params.getFormat().equals(format));
format = new VideoStreamingFormat(VideoStreamingProtocol.RAW, VideoStreamingCodec.VP8);
capability.setSupportedFormats(Collections.singletonList(format));
- params.update(capability);
+ params.update(capability, vehicleMake);
assertFalse(params.getFormat().equals(format));
}
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
deleted file mode 100644
index edb932f62..000000000
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/BTTransportConfigTests.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.smartdevicelink.test.transport;
-
-import com.smartdevicelink.test.TestValues;
-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(TestValues.MATCH, expectedTransportType, actualTransportType);
- assertTrue(TestValues.TRUE, actualShareConnection);
-
-
- testConfig1.setKeepSocketActive(true);
- assertTrue(TestValues.TRUE, testConfig1.getKeepSocketActive());
- testConfig1.setKeepSocketActive(false);
- assertFalse(TestValues.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
index d5f6629bd..8fcde0456 100644
--- 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
@@ -15,7 +15,6 @@ 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)}
*/
@@ -27,14 +26,12 @@ public class BaseTransportConfigTests extends TestCase {
// Comparison Values
int expectedMaxValue = Integer.MAX_VALUE;
- boolean actualShareConnection = testBaseTransportConfig.shareConnection();
int actualMaxValue = testBaseTransportConfig.getHeartBeatTimeout();
// Valid Tests
assertNotNull(TestValues.NOT_NULL, testBaseTransportConfig);
assertEquals(TestValues.MATCH, expectedMaxValue, actualMaxValue);
- assertTrue(TestValues.TRUE, actualShareConnection);
-
+
testBaseTransportConfig.setHeartBeatTimeout(testInt);
assertEquals(TestValues.MATCH, testInt, testBaseTransportConfig.getHeartBeatTimeout());
}
diff --git a/android/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..51916ea16 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexBluetoothTransportTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/transport/MultiplexBluetoothTransportTest.java
@@ -47,11 +47,7 @@ public class MultiplexBluetoothTransportTest extends TestCase {
};
- //TODO test for more than the two states
- bluetooth = MultiplexBluetoothTransport.getBluetoothSerialServerInstance();
- assertNull(bluetooth);
-
- bluetooth = MultiplexBluetoothTransport.getBluetoothSerialServerInstance(stateChangeHandler);
+ bluetooth = new MultiplexBluetoothTransport(stateChangeHandler);
assertEquals(bluetooth.getState(), MultiplexBluetoothTransport.STATE_NONE);
bluetooth.start();
diff --git a/android/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 35ad87cce..64c2d7b7b 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/util/SdlAppInfoTests.java
@@ -38,6 +38,7 @@ import android.content.pm.PackageInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.os.Bundle;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.smartdevicelink.R;
@@ -50,6 +51,7 @@ import org.junit.runner.RunWith;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
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
index 601895b1c..9deff1ec8 100644
--- 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
@@ -1,6 +1,7 @@
package com.smartdevicelink.test.utl;
import android.content.ComponentName;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.smartdevicelink.util.AndroidTools;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java
index e3070cd70..a816d6d87 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/LocalRouterServiceTests.java
@@ -3,6 +3,7 @@ package com.smartdevicelink.transport;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Parcel;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java
index 6f4f0231b..03c71264a 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java
@@ -1,12 +1,12 @@
package com.smartdevicelink.transport;
+import android.content.ComponentName;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import com.smartdevicelink.protocol.SdlPacket;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Before;
import org.junit.Test;
@@ -15,40 +15,24 @@ import org.junit.runner.RunWith;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
-import static junit.framework.TestCase.assertTrue;
@RunWith(AndroidJUnit4.class)
public class MultiplexTransportTest {
RouterServiceValidator rsvp;
- ITransportListener transportListener;
@Before
public void setUp() throws Exception {
rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext());
rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_NONE);
- rsvp.validate();
-
- transportListener = new ITransportListener(){
-
- @Override
- public void onTransportPacketReceived(SdlPacket packet) {
- }
-
+ rsvp.validateAsync(new RouterServiceValidator.ValidationStatusCallback() {
@Override
- public void onTransportConnected() {
- }
+ public void onFinishedValidation(boolean valid, ComponentName name) {
- @Override
- public void onTransportDisconnected(String info) {
}
+ });
- @Override
- public void onTransportError(String info, Exception e) {
- }
-
- };
}
// test for setting error state.
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
index 91aea6432..812556f2c 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java
@@ -5,9 +5,10 @@ import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.ConditionVariable;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
import android.util.Log;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
import com.smartdevicelink.transport.RouterServiceValidator.TrustedAppStore;
import com.smartdevicelink.util.HttpRequestTask.HttpRequestTaskCallback;
@@ -86,7 +87,12 @@ public class RSVTestCase {
public void testInstalledFrom(){
if(liveTest){
rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
- assertTrue(rsvp.validate());
+ rsvp.validateAsync(new RouterServiceValidator.ValidationStatusCallback() {
+ @Override
+ public void onFinishedValidation(boolean valid, ComponentName name) {
+ assertTrue(valid);
+ }
+ });
}
}
@@ -94,7 +100,12 @@ public class RSVTestCase {
public void testPackageCheck(){
if(liveTest){
rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_PACKAGE_CHECK);
- assertTrue(rsvp.validate());
+ rsvp.validateAsync(new RouterServiceValidator.ValidationStatusCallback() {
+ @Override
+ public void onFinishedValidation(boolean valid, ComponentName name) {
+ assertTrue(valid);
+ }
+ });
}
}
@@ -102,7 +113,12 @@ public class RSVTestCase {
public void testVersionCheck(){
if(liveTest){
rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_VERSION_CHECK);
- assertTrue(rsvp.validate());
+ rsvp.validateAsync(new RouterServiceValidator.ValidationStatusCallback() {
+ @Override
+ public void onFinishedValidation(boolean valid, ComponentName name) {
+ assertTrue(valid);
+ }
+ });
}
}
@@ -110,7 +126,12 @@ public class RSVTestCase {
public void testNoFlags(){
if(liveTest){
rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_NONE);
- assertTrue(rsvp.validate());
+ rsvp.validateAsync(new RouterServiceValidator.ValidationStatusCallback() {
+ @Override
+ public void onFinishedValidation(boolean valid, ComponentName name) {
+ assertTrue(valid);
+ }
+ });
}
}
@@ -118,7 +139,12 @@ public class RSVTestCase {
public void testAllFlags(){
if(liveTest){
rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_PERFORM_ALL_CHECKS);
- assertTrue(rsvp.validate());
+ rsvp.validateAsync(new RouterServiceValidator.ValidationStatusCallback() {
+ @Override
+ public void onFinishedValidation(boolean valid, ComponentName name) {
+ assertTrue(valid);
+ }
+ });
}
}
@@ -192,7 +218,12 @@ public class RSVTestCase {
public void testNoSecurity(){
requestTListLock();
- RouterServiceValidator rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext()); //Use a locally scoped instance
+ RouterServiceValidator rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext(), new ComponentName("anything", getInstrumentation().getTargetContext().getClass().getSimpleName())) {
+ @Override
+ protected boolean isServiceRunning(Context context, ComponentName service) {
+ return true;
+ }
+ };
rsvp.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_OFF);
rsvp.setFlags(RouterServiceValidator.FLAG_DEBUG_INSTALLED_FROM_CHECK);
@@ -203,7 +234,12 @@ public class RSVTestCase {
assertFalse(RouterServiceValidator.createTrustedListRequest(getInstrumentation().getTargetContext(), true, null, trustedListCallback));
//This should always return true
- assertTrue(rsvp.validate());
+ rsvp.validateAsync(new RouterServiceValidator.ValidationStatusCallback() {
+ @Override
+ public void onFinishedValidation(boolean valid, ComponentName name) {
+ assertTrue(valid);
+ }
+ });
}
@@ -371,7 +407,7 @@ public class RSVTestCase {
}
};
- assertTrue(RouterServiceValidator.createTrustedListRequest(getInstrumentation().getTargetContext(),true, cb));
+ assertTrue(RouterServiceValidator.createTrustedListRequest(getInstrumentation().getTargetContext(),true, cb, null));
//Now wait for call to finish
synchronized(REQUEST_LOCK){
try {
@@ -451,12 +487,22 @@ public class RSVTestCase {
// 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(getInstrumentation().getTargetContext(), new ComponentName("anything", getInstrumentation().getTargetContext().getClass().getSimpleName()));
rsvpFail.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
- assertFalse(rsvpFail.validate());
+ rsvpFail.validateAsync(new RouterServiceValidator.ValidationStatusCallback() {
+ @Override
+ public void onFinishedValidation(boolean valid, ComponentName name) {
+ assertFalse(valid);
+ }
+ });
// Success, same package name for context and service
RouterServiceValidatorTest rsvpPass = new RouterServiceValidatorTest(getInstrumentation().getTargetContext(), new ComponentName(getInstrumentation().getTargetContext().getPackageName(), getInstrumentation().getTargetContext().getClass().getSimpleName()));
rsvpPass.setSecurityLevel(MultiplexTransportConfig.FLAG_MULTI_SECURITY_HIGH);
- assertTrue(rsvpPass.validate());
+ rsvpPass.validateAsync(new RouterServiceValidator.ValidationStatusCallback() {
+ @Override
+ public void onFinishedValidation(boolean valid, ComponentName name) {
+ assertTrue(valid);
+ }
+ });
}
/**
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java
index f2164e498..d9af0faed 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RegisteredAppTests.java
@@ -2,8 +2,11 @@ package com.smartdevicelink.transport;
import android.os.Looper;
import android.os.Messenger;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
+import com.smartdevicelink.transport.enums.TransportType;
+
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,10 +33,10 @@ public class RegisteredAppTests {
// Instantiate SdlRouterService and Registered App class
SdlRouterService router = new SdlRouterService();
- SdlRouterService.RegisteredApp app = router.new RegisteredApp(APP_ID, messenger);
+ SdlRouterService.RegisteredApp app = router.new RegisteredApp(APP_ID, 1, messenger);
// Call Handle Message
- app.handleMessage(TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_START,bytes);
+ app.handleMessage(TransportConstants.BYTES_TO_SEND_FLAG_LARGE_PACKET_START,bytes, TransportType.BLUETOOTH);
// Insure that the buffer is not null, if it is the test will fail
assertNotNull(app.buffer);
@@ -50,13 +53,13 @@ public class RegisteredAppTests {
// Instantiate SdlRouterService and Registered App class
SdlRouterService router = new SdlRouterService();
- SdlRouterService.RegisteredApp app = router.new RegisteredApp(APP_ID, messenger);
+ SdlRouterService.RegisteredApp app = router.new RegisteredApp(APP_ID, 1, messenger);
// Force Null Buffer
app.buffer = null;
// Call Handle Message - Making sure it doesn't init buffer
- app.handleMessage(TransportConstants.BYTES_TO_SEND_FLAG_NONE,bytes);
+ app.handleMessage(TransportConstants.BYTES_TO_SEND_FLAG_NONE, bytes, TransportType.BLUETOOTH);
// Insure that the buffer is null. and no NPE
assertNull(app.buffer);
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
index 5815911e7..2ab12e51a 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/SdlRouterServiceTests.java
@@ -5,11 +5,12 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
import android.util.Log;
import android.util.SparseArray;
import android.util.SparseIntArray;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
import com.smartdevicelink.marshal.JsonRPCMarshaller;
import com.smartdevicelink.protocol.BinaryFrameHeader;
import com.smartdevicelink.protocol.ProtocolMessage;
@@ -187,8 +188,8 @@ public class SdlRouterServiceTests {
// 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);
+ SdlRouterService.RegisteredApp app1 = sdlRouterService.new RegisteredApp("12345", 1, message.replyTo);
+ SdlRouterService.RegisteredApp app2 = sdlRouterService.new RegisteredApp("12344", 1, message.replyTo);
HashMap<String,SdlRouterService.RegisteredApp> registeredApps = new HashMap<>();
registeredApps.put(app1.getAppId(),app1);
registeredApps.put(app2.getAppId(),app2);
@@ -280,8 +281,8 @@ public class SdlRouterServiceTests {
// 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);
+ SdlRouterService.RegisteredApp app1 = sdlRouterService.new RegisteredApp("12345", 1, message.replyTo);
+ SdlRouterService.RegisteredApp app2 = sdlRouterService.new RegisteredApp("12344", 1, message.replyTo);
HashMap<String,SdlRouterService.RegisteredApp> registeredApps = new HashMap<>();
registeredApps.put(app1.getAppId(),app1);
registeredApps.put(app2.getAppId(),app2);
@@ -688,7 +689,7 @@ public class SdlRouterServiceTests {
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);
+ SdlRouterService.RegisteredApp app = routerService.new RegisteredApp(appId, 1, message.replyTo);
Field raf = routerService.getClass().getDeclaredField("registeredApps");
raf.setAccessible(true);
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java
index 22837f77d..811fd8307 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java
@@ -1,10 +1,12 @@
package com.smartdevicelink.transport;
import android.bluetooth.BluetoothAdapter;
+import android.content.ComponentName;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.Messenger;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.smartdevicelink.test.SdlUnitTestContants;
@@ -27,7 +29,12 @@ public class TransportBrokerTest { //FIXME this test class needs to be fixed. At
@Before
public void setUp() throws Exception {
rsvp = new RouterServiceValidator(getInstrumentation().getTargetContext());
- rsvp.validate();
+ rsvp.validateAsync(new RouterServiceValidator.ValidationStatusCallback() {
+ @Override
+ public void onFinishedValidation(boolean valid, ComponentName name) {
+
+ }
+ });
}
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
index b1d3263b2..a808ba936 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportManagerTests.java
@@ -2,6 +2,7 @@ package com.smartdevicelink.transport;
import android.content.ComponentName;
import android.os.Looper;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.smartdevicelink.protocol.SdlPacket;
diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java
index 5f7f06f59..4a80343ad 100644
--- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/util/MediaStreamingStatusTests.java
@@ -4,6 +4,7 @@ import android.content.Context;
import android.media.AudioDeviceInfo;
import android.media.AudioManager;
import android.os.Build;
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.smartdevicelink.managers.SdlManager;
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/encoder/EncoderUtils.java b/android/sdl_android/src/main/java/com/smartdevicelink/encoder/EncoderUtils.java
index 8f3001294..5fd3f417d 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/encoder/EncoderUtils.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/encoder/EncoderUtils.java
@@ -87,14 +87,18 @@ public final class EncoderUtils {
}
ByteBuffer sps = format.getByteBuffer("csd-0");
- int spsLen = sps.remaining();
+ int spsLen = sps != null ? sps.remaining() : 0;
ByteBuffer pps = format.getByteBuffer("csd-1");
- int ppsLen = pps.remaining();
+ int ppsLen = pps != null ? pps.remaining() : 0;
byte[] output = new byte[spsLen + ppsLen];
try {
- sps.get(output, 0, spsLen);
- pps.get(output, spsLen, ppsLen);
+ if (sps != null) {
+ sps.get(output, 0, spsLen);
+ }
+ if (pps != null) {
+ pps.get(output, spsLen, ppsLen);
+ }
} catch (Exception e) {
// should not happen
DebugTool.logWarning(TAG, "Error while copying H264 codec specific data: " + e);
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
index 7172b0225..251c3ad3a 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/encoder/SdlEncoder.java
@@ -38,7 +38,7 @@ import android.media.MediaFormat;
import android.os.Build;
import android.view.Surface;
-import com.smartdevicelink.proxy.interfaces.IVideoStreamListener;
+import com.smartdevicelink.streaming.video.IVideoStreamListener;
import com.smartdevicelink.util.DebugTool;
import java.io.IOException;
@@ -214,7 +214,7 @@ public class SdlEncoder {
if (mBufferInfo.size != 0) {
ByteBuffer encoderOutputBuffer = encoderOutputBuffers[encoderStatus];
- byte[] dataToWrite = null;
+ byte[] dataToWrite;
int dataOffset = 0;
// append SPS and PPS in front of every IDR NAL unit
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
index 201c7e5ca..46503536a 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/encoder/VirtualDisplayEncoder.java
@@ -54,10 +54,10 @@ import com.android.grafika.gles.FullFrameRect;
import com.android.grafika.gles.OffscreenSurface;
import com.android.grafika.gles.Texture2dProgram;
import com.android.grafika.gles.WindowSurface;
-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.IVideoStreamListener;
import com.smartdevicelink.streaming.video.VideoStreamingParameters;
import com.smartdevicelink.util.DebugTool;
@@ -120,7 +120,6 @@ public class VirtualDisplayEncoder {
initPassed = true;
}
- @SuppressWarnings("unused")
public VideoStreamingParameters getStreamingParams(){
return this.streamingParams;
}
@@ -588,7 +587,6 @@ public class VirtualDisplayEncoder {
}
}
- @SuppressWarnings("deprecation")
void drainEncoder(boolean endOfStream) {
if (mVideoEncoder == null || mOutputListener == null) {
return;
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
deleted file mode 100644
index 69180d255..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/ProxyBridge.java
+++ /dev/null
@@ -1,686 +0,0 @@
-/*
- * 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.CancelInteractionResponse;
-import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse;
-import com.smartdevicelink.proxy.rpc.CloseApplicationResponse;
-import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse;
-import com.smartdevicelink.proxy.rpc.CreateWindowResponse;
-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.DeleteWindowResponse;
-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.GetInteriorVehicleDataConsentResponse;
-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.OnPermissionsChange;
-import com.smartdevicelink.proxy.rpc.OnRCStatus;
-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.ReleaseInteriorVehicleDataModuleResponse;
-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.ShowAppMenuResponse;
-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.SubscribeButtonResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeWayPointsResponse;
-import com.smartdevicelink.proxy.rpc.SystemRequestResponse;
-import com.smartdevicelink.proxy.rpc.UnpublishAppServiceResponse;
-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;
-
-@Deprecated
-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 onCreateWindowResponse(CreateWindowResponse response) {
- onRPCReceived(response);
- }
-
- @Override
- public void onDeleteWindowResponse(DeleteWindowResponse 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 onGetInteriorVehicleDataConsentResponse(GetInteriorVehicleDataConsentResponse response) {
- onRPCReceived(response);
- }
-
- @Override
- public void onReleaseInteriorVehicleDataModuleResponse(ReleaseInteriorVehicleDataModuleResponse response) {
- onRPCReceived(response);
- }
-
- @Override
- public void onOnSystemCapabilityUpdated(OnSystemCapabilityUpdated notification){
- onRPCReceived(notification);
- }
-
- @Override
- public void onCloseApplicationResponse(CloseApplicationResponse response) {
- onRPCReceived(response);
- }
-
- @Override
- public void onCancelInteractionResponse(CancelInteractionResponse response) {
- onRPCReceived(response);
- }
-
- @Override
- public void onShowAppMenuResponse(ShowAppMenuResponse response) {
- onRPCReceived(response);
- }
-
- @Override
- public void onUnpublishAppServiceResponse(UnpublishAppServiceResponse response) {
- onRPCReceived(response);
- }
-}
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
index 42dc6a165..09adbbaa6 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManager.java
@@ -36,6 +36,7 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
+
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -90,7 +91,7 @@ public class SdlManager extends BaseSdlManager {
@Override
public void onTransportEvent(List<TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail) {
- //Pass to submanagers that need it
+ //Pass to sub managers that need it
if (videoStreamManager != null) {
videoStreamManager.handleTransportUpdated(connectedTransports, audioStreamTransportAvail, videoStreamTransportAvail);
}
@@ -124,7 +125,7 @@ public class SdlManager extends BaseSdlManager {
// Instantiate sub managers
this.permissionManager = new PermissionManager(_internalInterface);
this.fileManager = new FileManager(_internalInterface, context, fileManagerConfig);
- if (lockScreenConfig.isEnabled()) {
+ if (lockScreenConfig.getDisplayMode() != LockScreenConfig.DISPLAY_MODE_NEVER) {
this.lockScreenManager = new LockScreenManager(lockScreenConfig, context, _internalInterface);
}
this.screenManager = new ScreenManager(_internalInterface, this.fileManager);
@@ -142,7 +143,7 @@ public class SdlManager extends BaseSdlManager {
// Start sub managers
this.permissionManager.start(subManagerListener);
this.fileManager.start(subManagerListener);
- if (lockScreenConfig.isEnabled()) {
+ if (lockScreenConfig.getDisplayMode() != LockScreenConfig.DISPLAY_MODE_NEVER) {
this.lockScreenManager.start(subManagerListener);
}
this.screenManager.start(subManagerListener);
@@ -150,19 +151,19 @@ public class SdlManager extends BaseSdlManager {
@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)) {
+ if (permissionManager != null && fileManager != null && screenManager != null && (lockScreenConfig.getDisplayMode() == LockScreenConfig.DISPLAY_MODE_NEVER || lockScreenManager != null)) {
+ if (permissionManager.getState() == BaseSubManager.READY && fileManager.getState() == BaseSubManager.READY && screenManager.getState() == BaseSubManager.READY && (lockScreenConfig.getDisplayMode() == LockScreenConfig.DISPLAY_MODE_NEVER || lockScreenManager.getState() == BaseSubManager.READY)) {
DebugTool.logInfo(TAG, "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)) {
+ } else if (permissionManager.getState() == BaseSubManager.ERROR && fileManager.getState() == BaseSubManager.ERROR && screenManager.getState() == BaseSubManager.ERROR && (lockScreenConfig.getDisplayMode() == LockScreenConfig.DISPLAY_MODE_NEVER || lockScreenManager.getState() == BaseSubManager.ERROR)) {
String info = "ERROR starting sdl manager, all sub managers are in error state";
DebugTool.logError(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)) {
+ } else if (permissionManager.getState() == BaseSubManager.SETTING_UP || fileManager.getState() == BaseSubManager.SETTING_UP || screenManager.getState() == BaseSubManager.SETTING_UP || (lockScreenConfig.getDisplayMode() != LockScreenConfig.DISPLAY_MODE_NEVER && lockScreenManager != null && lockScreenManager.getState() == BaseSubManager.SETTING_UP)) {
DebugTool.logInfo(TAG, "SETTING UP sdl manager, some sub managers are still setting up");
transitionToState(BaseSubManager.SETTING_UP);
// No need to notify developer here!
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
index aa0e4f84a..8bd1f6259 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
@@ -61,21 +61,6 @@ public interface SdlManagerListener extends BaseSdlManagerListener{
* of LifecycleConfigurationUpdate, otherwise it should return null to indicate that the language
* is not supported.
*
- * @param language The language of the connected head unit the manager is trying to update the configuration.
- * @return An object of LifecycleConfigurationUpdate if the head unit language is supported,
- * otherwise null to indicate that the language is not supported.
- * @deprecated use {@link #managerShouldUpdateLifecycle(Language language, Language hmiLanguage)} instead
- */
- @Deprecated
- LifecycleConfigurationUpdate managerShouldUpdateLifecycle(Language language);
-
- /**
- * Called when the SDL manager detected a language mismatch. In case of a language mismatch the
- * manager should change the apps registration by updating the lifecycle configuration to the
- * specified language. If the app can support the specified language it should return an Object
- * of LifecycleConfigurationUpdate, otherwise it should return null to indicate that the language
- * is not supported.
- *
* @param language The VR+TTS language of the connected head unit the manager is trying to update the configuration.
* @param hmiLanguage The HMI display language of the connected head unit the manager is trying to update the configuration.
* @return An object of LifecycleConfigurationUpdate if the head unit language is supported,
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
index 04fe41c97..141a2b020 100644
--- 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
@@ -36,6 +36,7 @@ import android.media.MediaCodec;
import android.media.MediaFormat;
import android.net.Uri;
import android.os.Build;
+
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
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
index ce2d3c49e..7e32d3261 100644
--- 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
@@ -35,6 +35,7 @@ import android.content.Context;
import android.media.MediaCodec;
import android.media.MediaFormat;
import android.net.Uri;
+
import androidx.annotation.NonNull;
import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
@@ -90,7 +91,7 @@ public class AudioDecoderCompat extends BaseAudioDecoder {
* Runnable to decode audio data
*/
private static class DecoderRunnable implements Runnable {
- WeakReference<AudioDecoderCompat> weakReference;
+ final WeakReference<AudioDecoderCompat> weakReference;
/**
* Decodes all audio data from source
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
index 2656b4b58..0e4a2ed2c 100644
--- 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
@@ -38,29 +38,35 @@ import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
+
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.managers.CompletionListener;
import com.smartdevicelink.managers.StreamingStateMachine;
+import com.smartdevicelink.managers.lifecycle.OnSystemCapabilityListener;
+import com.smartdevicelink.protocol.ProtocolMessage;
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.managers.ISdl;
+import com.smartdevicelink.protocol.ISdlServiceListener;
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.PredefinedWindows;
import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.streaming.IStreamListener;
+import com.smartdevicelink.streaming.StreamPacketizer;
+import com.smartdevicelink.streaming.audio.IAudioStreamListener;
import com.smartdevicelink.transport.utl.TransportRecord;
import com.smartdevicelink.util.DebugTool;
import com.smartdevicelink.util.Version;
+import java.io.IOException;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.ref.WeakReference;
@@ -91,6 +97,9 @@ public class AudioStreamManager extends BaseAudioStreamManager {
private CompletionListener serviceCompletionListener;
// As the internal interface does not provide timeout we need to use a future task
private final Handler serviceCompletionHandler;
+ private StreamPacketizer audioPacketizer;
+ private SdlSession sdlSession = null;
+ private SessionType sessionType = null;
private final Runnable serviceCompletionTimeoutCallback = new Runnable() {
@Override
@@ -106,10 +115,12 @@ public class AudioStreamManager extends BaseAudioStreamManager {
private final ISdlServiceListener serviceListener = new ISdlServiceListener() {
@Override
public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted) {
+ sdlSession = session;
+ sessionType = type;
if (SessionType.PCM.equals(type)) {
serviceCompletionHandler.removeCallbacks(serviceCompletionTimeoutCallback);
- sdlAudioStream = session.startAudioStream();
+ sdlAudioStream = startAudioStream(session);
streamingStateMachine.transitionToState(StreamingStateMachine.STARTED);
if (serviceCompletionListener != null) {
@@ -125,7 +136,7 @@ public class AudioStreamManager extends BaseAudioStreamManager {
if (SessionType.PCM.equals(type)) {
serviceCompletionHandler.removeCallbacks(serviceCompletionTimeoutCallback);
- session.stopAudioStream();
+ stopAudioStream();
sdlAudioStream = null;
streamingStateMachine.transitionToState(StreamingStateMachine.NONE);
@@ -142,6 +153,7 @@ public class AudioStreamManager extends BaseAudioStreamManager {
if (SessionType.PCM.equals(type)) {
serviceCompletionHandler.removeCallbacks(serviceCompletionTimeoutCallback);
+ stopAudioStream();
streamingStateMachine.transitionToState(StreamingStateMachine.ERROR);
DebugTool.logError(TAG, "OnServiceError: " + reason);
streamingStateMachine.transitionToState(StreamingStateMachine.NONE);
@@ -175,6 +187,7 @@ public class AudioStreamManager extends BaseAudioStreamManager {
* Creates a new object of AudioStreamManager
* @param internalInterface The internal interface to the connected device.
*/
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public AudioStreamManager(@NonNull ISdl internalInterface, @NonNull Context context) {
super(internalInterface);
this.queue = new LinkedList<>();
@@ -208,25 +221,28 @@ public class AudioStreamManager extends BaseAudioStreamManager {
}
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();
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ internalInterface.getSystemCapabilityManager().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) {
- DebugTool.logError(TAG, "Error retrieving audio streaming capability: " + info);
- streamingStateMachine.transitionToState(StreamingStateMachine.ERROR);
- transitionToState(ERROR);
- }
- });
+ @Override
+ public void onError(String info) {
+ DebugTool.logError(TAG, "Error retrieving audio streaming capability: " + info);
+ streamingStateMachine.transitionToState(StreamingStateMachine.ERROR);
+ transitionToState(ERROR);
+ }
+ }, false);
+ }
}
@Override
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public void dispose() {
stopAudioStream(new CompletionListener() {
@Override
@@ -258,7 +274,10 @@ public class AudioStreamManager extends BaseAudioStreamManager {
return;
}
- AudioPassThruCapabilities capabilities = (AudioPassThruCapabilities) internalInterface.getCapability(SystemCapabilityType.PCM_STREAMING);
+ AudioPassThruCapabilities capabilities = null;
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ capabilities = (AudioPassThruCapabilities) internalInterface.getSystemCapabilityManager().getCapability(SystemCapabilityType.PCM_STREAMING, null, false);
+ }
if (capabilities != null) {
switch (capabilities.getSamplingRate()) {
@@ -338,7 +357,8 @@ public class AudioStreamManager extends BaseAudioStreamManager {
streamingStateMachine.transitionToState(StreamingStateMachine.STOPPED);
serviceCompletionListener = completionListener;
serviceCompletionHandler.postDelayed(serviceCompletionTimeoutCallback, COMPLETION_TIMEOUT);
- internalInterface.stopAudioService();
+ stopAudioStream();
+ serviceListener.onServiceEnded(sdlSession, sessionType);
}
/**
@@ -490,4 +510,30 @@ public class AudioStreamManager extends BaseAudioStreamManager {
// range of ENCODING_PCM_FLOAT audio data is [-1.0, 1.0].
int FLOAT = Float.SIZE >> 3;
}
+
+ protected IAudioStreamListener startAudioStream(final SdlSession session) {
+
+ IStreamListener streamListener = new IStreamListener() {
+ @Override
+ public void sendStreamPacket(ProtocolMessage pm) {
+ session.sendMessage(pm);
+ }
+ };
+
+ try {
+ audioPacketizer = new StreamPacketizer(streamListener, null, SessionType.PCM, (byte) session.getSessionId(), session);
+ audioPacketizer.start();
+ return audioPacketizer;
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ protected boolean stopAudioStream() {
+ if (audioPacketizer != null) {
+ audioPacketizer.stop();
+ return true;
+ }
+ return false;
+ }
}
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
index 53e3d64f0..d7f4f3a7c 100644
--- 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
@@ -38,6 +38,7 @@ import android.media.MediaExtractor;
import android.media.MediaFormat;
import android.net.Uri;
import android.os.Build;
+
import androidx.annotation.NonNull;
import com.smartdevicelink.managers.audio.AudioStreamManager.SampleType;
@@ -109,7 +110,7 @@ public abstract class BaseAudioDecoder {
for (int i = 0; i < numTracks; ++i) {
MediaFormat f = extractor.getTrackFormat(i);
String m = f.getString(MediaFormat.KEY_MIME);
- if (m.startsWith("audio/")) {
+ if (m != null && m.startsWith("audio/")) {
format = f;
mime = m;
extractor.selectTrack(i);
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
index 05a9cc285..0993b2ec2 100644
--- 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
@@ -44,7 +44,6 @@ import java.nio.ByteOrder;
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;
@@ -94,7 +93,6 @@ public class SampleBuffer {
* @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);
}
@@ -117,7 +115,6 @@ public class SampleBuffer {
/**
* Returns the capacity of the buffer per channel.
*/
- @SuppressWarnings("unused")
public int capacity() {
return byteBuffer.capacity() / sampleType / channelCount;
}
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
index bdd21ba45..6b98e9b58 100644
--- 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
@@ -35,10 +35,12 @@ package com.smartdevicelink.managers.file;
import android.content.Context;
import android.content.res.Resources;
import android.net.Uri;
+
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.file.filetypes.SdlFile;
-import com.smartdevicelink.proxy.interfaces.ISdl;
import com.smartdevicelink.proxy.rpc.PutFile;
import com.smartdevicelink.util.DebugTool;
@@ -65,20 +67,13 @@ public class FileManager extends BaseFileManager {
private final WeakReference<Context> context;
- @Deprecated
- public FileManager(ISdl internalInterface, Context context) {
-
- // setup
- super(internalInterface);
- this.context = new WeakReference<>(context);
- }
-
/**
* Constructor for FileManager
* @param internalInterface an instance of the ISdl interface that can be used for common SDL operations (sendRpc, addRpcListener, etc)
* @param context an instances of Context interface to global information for application
* @param fileManagerConfig an instance of the FileManagerConfig gives access to artworkRetryCount and fileRetryCount to let us if those file types can be re-upload if they fail
*/
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public FileManager(ISdl internalInterface, Context context, FileManagerConfig fileManagerConfig) {
// setup
super(internalInterface, fileManagerConfig);
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
index d0e46f7e5..afceb04a1 100644
--- 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
@@ -33,6 +33,7 @@
package com.smartdevicelink.managers.file.filetypes;
import android.net.Uri;
+
import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.rpc.Image;
@@ -111,7 +112,7 @@ public class SdlArtwork extends SdlFile implements Cloneable{
}
@Override
- public void setType(FileType fileType) {
+ public void setType(@NonNull FileType fileType) {
if(fileType == null || fileType.equals(FileType.GRAPHIC_JPEG) || fileType.equals(FileType.GRAPHIC_PNG)
|| fileType.equals(FileType.GRAPHIC_BMP)){
super.setType(fileType);
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
index 4fe5e3898..2b978c790 100644
--- 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
@@ -33,6 +33,7 @@
package com.smartdevicelink.managers.file.filetypes;
import android.net.Uri;
+
import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.rpc.enums.FileType;
@@ -40,6 +41,7 @@ import com.smartdevicelink.proxy.rpc.enums.StaticIconName;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
/**
* A class representing data to be uploaded to core
@@ -317,7 +319,7 @@ public class SdlFile{
int result = 1;
result += ((getName() == null) ? 0 : Integer.rotateLeft(getName().hashCode(), 1));
result += ((getUri() == null) ? 0 : Integer.rotateLeft(getUri().hashCode(), 2));
- result += ((getFileData() == null) ? 0 : Integer.rotateLeft(getFileData().hashCode(), 3));
+ result += ((getFileData() == null) ? 0 : Integer.rotateLeft(Arrays.hashCode(getFileData()), 3));
result += ((getType() == null) ? 0 : Integer.rotateLeft(getType().hashCode(), 4));
result += Integer.rotateLeft(Boolean.valueOf(isStaticIcon()).hashCode(), 5);
result += Integer.rotateLeft(Boolean.valueOf(isPersistent()).hashCode(), 6);
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java
index ae7a0886e..b2749212e 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java
@@ -34,9 +34,9 @@ package com.smartdevicelink.managers.lifecycle;
import androidx.annotation.NonNull;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.ServiceEncryptionListener;
import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.interfaces.ISdl;
class EncryptionLifecycleManager extends BaseEncryptionLifecycleManager {
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java
index 73757292b..e5aee6c3e 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java
@@ -32,15 +32,15 @@
package com.smartdevicelink.managers.lifecycle;
-import android.app.Service;
import android.content.Context;
+
import androidx.annotation.RestrictTo;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.exception.SdlException;
import com.smartdevicelink.exception.SdlExceptionCause;
+import com.smartdevicelink.protocol.ISdlServiceListener;
import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
import com.smartdevicelink.security.SdlSecurityBase;
@@ -48,13 +48,10 @@ import com.smartdevicelink.streaming.video.VideoStreamingParameters;
import com.smartdevicelink.transport.BaseTransportConfig;
import com.smartdevicelink.transport.MultiplexTransportConfig;
import com.smartdevicelink.transport.TCPTransportConfig;
-import com.smartdevicelink.transport.USBTransportConfig;
import com.smartdevicelink.transport.enums.TransportType;
import com.smartdevicelink.util.DebugTool;
import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Collections;
/**
* The lifecycle manager creates a central point for all SDL session logic to converge. It should only be used by
@@ -76,22 +73,6 @@ public class LifecycleManager extends BaseLifecycleManager {
void initialize() {
super.initialize();
- //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(TAG,"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(), appConfig.getAppID());
- 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 != null && _transportConfig.getTransportType().equals(TransportType.MULTIPLEX)) {
this.session = new SdlSession(sdlSessionListener, (MultiplexTransportConfig) _transportConfig);
} else if (_transportConfig != null && _transportConfig.getTransportType().equals(TransportType.TCP)) {
@@ -128,15 +109,9 @@ public class LifecycleManager extends BaseLifecycleManager {
super.setSdlSecurityStaticVars();
Context context = null;
- Service service = null;
-
if(this.contextWeakReference != null){
context = contextWeakReference.get();
}
- if (context != null && context instanceof Service) {
- service = (Service) context;
- }
- SdlSecurityBase.setAppService(service);
SdlSecurityBase.setContext(context);
}
@@ -180,10 +155,6 @@ public class LifecycleManager extends BaseLifecycleManager {
*
* @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.
*/
private void tryStartVideoStream(boolean isEncrypted, VideoStreamingParameters parameters) {
if (session == null) {
@@ -242,25 +213,6 @@ public class LifecycleManager extends BaseLifecycleManager {
}
}
- /**
- * Closes the opened video service (serviceType 11)
- *
- * @return true if the video service is closed successfully, return false otherwise
- */
- @Override
- void endVideoStream() {
- if (session == null) {
- DebugTool.logWarning(TAG, "SdlSession is not created yet.");
- return;
- }
- if (!session.getIsConnected()) {
- DebugTool.logWarning(TAG, "Connection is not available.");
- return;
- }
-
- session.stopVideoStream();
- }
-
@Override
void startAudioService(boolean isEncrypted) {
if (session == null) {
@@ -273,23 +225,4 @@ public class LifecycleManager extends BaseLifecycleManager {
}
session.startService(SessionType.PCM, isEncrypted);
}
-
- /**
- * Closes the opened audio service (serviceType 10)
- *
- * @return true if the audio service is closed successfully, return false otherwise
- */
- @Override
- void endAudioStream() {
- if (session == null) {
- DebugTool.logWarning(TAG, "SdlSession is not created yet.");
- return;
- }
- if (!session.getIsConnected()) {
- DebugTool.logWarning(TAG, "Connection is not available.");
- return;
- }
-
- session.stopAudioStream();
- }
}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java
index e4e635883..e10693770 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java
@@ -31,7 +31,7 @@
*/
package com.smartdevicelink.managers.lifecycle;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
/**
* <strong>SystemCapabilityManager</strong> <br>
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
index 8fe3286ba..df1db5475 100644
--- 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
@@ -60,7 +60,9 @@ import java.lang.annotation.RetentionPolicy;
*/
public class LockScreenConfig {
- private boolean enable, deviceLogo, enableDismissGesture;
+ private final boolean enable;
+ private boolean deviceLogo;
+ private boolean enableDismissGesture;
private int backgroundColor, appIconInt, customViewInt;
private @DisplayMode int displayMode;
@@ -88,30 +90,6 @@ public class LockScreenConfig {
}
/**
- * 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
- *
- * @deprecated to disable the lockscreen, use setDisplayMode with DISPLAY_MODE_NEVER instead
- */
- @Deprecated
- public void setEnabled(boolean enable){
- this.enable = enable;
- }
-
- /**
- * Gets whether the lock screen is being managed for you
- * @return boolean
- *
- * @deprecated to disable the lockscreen, use setDisplayMode with DISPLAY_MODE_NEVER instead
- */
- @Deprecated
- 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
*/
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManager.java
index 711afcc72..603435800 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenDeviceIconManager.java
@@ -24,7 +24,7 @@ import java.security.NoSuchAlgorithmException;
*/
class LockScreenDeviceIconManager {
- private Context context;
+ private final Context context;
private static final String SDL_DEVICE_STATUS_SHARED_PREFS = "sdl.lockScreenIcon";
private static final String STORED_ICON_DIRECTORY_PATH = "sdl/lock_screen_icon/";
private static final String TAG = "LockScreenDeviceIconManager";
@@ -47,7 +47,7 @@ class LockScreenDeviceIconManager {
* @param iconRetrievedListener an interface that will implement onIconReceived and OnError methods
*/
void retrieveIcon(String iconURL, OnIconRetrievedListener iconRetrievedListener) {
- Bitmap icon = null;
+ Bitmap icon;
try {
if (isIconCachedAndValid(iconURL)) {
DebugTool.logInfo(TAG, "Icon Is Up To Date");
@@ -127,7 +127,7 @@ class LockScreenDeviceIconManager {
icon.compress(Bitmap.CompressFormat.PNG, 0 /*ignored for PNG*/, bos);
byte[] bitmapData = bos.toByteArray();
- FileOutputStream fos = null;
+ FileOutputStream fos;
try {
fos = new FileOutputStream(f);
fos.write(bitmapData);
@@ -189,11 +189,11 @@ class LockScreenDeviceIconManager {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] messageDigest = md.digest(iconUrl.getBytes());
BigInteger no = new BigInteger(1, messageDigest);
- String hashtext = no.toString(16);
- while (hashtext.length() < 32) {
- hashtext = "0" + hashtext;
+ StringBuilder hashText = new StringBuilder(no.toString(16));
+ while (hashText.length() < 32) {
+ hashText.insert(0, "0");
}
- iconHash = hashtext;
+ iconHash = hashText.toString();
} catch (NoSuchAlgorithmException e) {
DebugTool.logError(TAG, "Unable to hash icon url");
e.printStackTrace();
@@ -208,7 +208,9 @@ class LockScreenDeviceIconManager {
File iconDir = new File(context.getCacheDir() + "/" + STORED_ICON_DIRECTORY_PATH);
if (iconDir.listFiles() != null) {
for (File child : iconDir.listFiles()) {
- child.delete();
+ if (child != null) {
+ child.delete();
+ }
}
}
}
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
index c5d567e56..56975a390 100644
--- 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
@@ -38,11 +38,13 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Bitmap;
+import androidx.annotation.RestrictTo;
+
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.managers.ISdl;
import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
import com.smartdevicelink.proxy.rpc.OnSystemRequest;
@@ -64,22 +66,30 @@ import java.lang.ref.WeakReference;
* The LockscreenManager handles the logic of showing and hiding the lock screen. <br>
*
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class LockScreenManager extends BaseSubManager {
private static final String TAG = "LockScreenManager";
- private WeakReference<Context> context;
+ private final WeakReference<Context> context;
HMILevel hmiLevel;
private OnRPCNotificationListener systemRequestListener, ddListener, hmiListener;
private String deviceIconUrl;
- boolean driverDistStatus, mIsLockscreenDismissible, enableDismissGesture, lockScreenEnabled, deviceLogoEnabled;
+ boolean driverDistStatus;
+ boolean mIsLockscreenDismissible;
+ boolean enableDismissGesture;
+ final boolean lockScreenEnabled;
+ final boolean deviceLogoEnabled;
private volatile boolean isApplicationForegrounded;
private androidx.lifecycle.LifecycleObserver lifecycleObserver;
- int lockScreenIcon, lockScreenColor, customView, displayMode;
+ final int lockScreenIcon;
+ final int lockScreenColor;
+ final int customView;
+ int displayMode;
Bitmap deviceLogo;
private boolean mLockScreenHasBeenDismissed, lockscreenDismissReceiverRegistered, receivedFirstDDNotification;
private String mLockscreenWarningMsg;
private BroadcastReceiver mLockscreenDismissedReceiver;
- private LockScreenDeviceIconManager mLockScreenDeviceIconManager;
+ private final LockScreenDeviceIconManager mLockScreenDeviceIconManager;
public LockScreenManager(LockScreenConfig lockScreenConfig, Context context, ISdl internalInterface){
@@ -96,7 +106,7 @@ public class LockScreenManager extends BaseSubManager {
lockScreenIcon = lockScreenConfig.getAppIcon();
lockScreenColor = lockScreenConfig.getBackgroundColor();
customView = lockScreenConfig.getCustomView();
- lockScreenEnabled = lockScreenConfig.isEnabled();
+ lockScreenEnabled = lockScreenConfig.getDisplayMode() != LockScreenConfig.DISPLAY_MODE_NEVER;
deviceLogoEnabled = lockScreenConfig.isDeviceLogoEnabled();
displayMode = lockScreenConfig.getDisplayMode();
enableDismissGesture = lockScreenConfig.enableDismissGesture();
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
index a1af673a2..3007d081a 100644
--- 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
@@ -55,7 +55,6 @@ 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";
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
index e3a85bb1b..540cbbf20 100644
--- 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
@@ -33,8 +33,9 @@
package com.smartdevicelink.managers.permission;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
/**
PermissionManager gives the developer information about what permissions are permitted in specific HMI level
@@ -51,6 +52,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl;
*
* @param internalInterface
*/
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
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
index 5065294a9..00bb57628 100644
--- 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
@@ -33,9 +33,10 @@
package com.smartdevicelink.managers.screen;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
/**
* <strong>ScreenManager</strong> <br>
@@ -44,6 +45,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl;
*/
public class ScreenManager extends BaseScreenManager {
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
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
index b7a2e2958..8e30bb446 100644
--- 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
@@ -33,15 +33,17 @@
package com.smartdevicelink.managers.screen;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+import com.smartdevicelink.managers.ISdl;
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>
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
class SoftButtonManager extends BaseSoftButtonManager {
/**
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java
index b5dafa5fd..eba3c9b2f 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java
@@ -1,7 +1,9 @@
package com.smartdevicelink.managers.screen;
import androidx.annotation.NonNull;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import androidx.annotation.RestrictTo;
+
+import com.smartdevicelink.managers.ISdl;
/**
* <strong>SubscribeButtonManager</strong> <br>
@@ -9,6 +11,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl;
* Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
*
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
class SubscribeButtonManager extends BaseSubscribeButtonManager {
SubscribeButtonManager(@NonNull ISdl internalInterface) {
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
index 82e9a5e01..b4154cdf0 100644
--- 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
@@ -33,11 +33,12 @@
package com.smartdevicelink.managers.screen;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
import com.smartdevicelink.R;
+import com.smartdevicelink.managers.ISdl;
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;
/**
@@ -46,6 +47,7 @@ import com.smartdevicelink.proxy.rpc.enums.FileType;
* Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
*
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
class TextAndGraphicManager extends BaseTextAndGraphicManager {
TextAndGraphicManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager, @NonNull SoftButtonManager softButtonManager) {
@@ -53,8 +55,8 @@ class TextAndGraphicManager extends BaseTextAndGraphicManager {
}
@Override
- SdlArtwork getBlankArtwork(){
- if (blankArtwork == null){
+ SdlArtwork getBlankArtwork() {
+ if (blankArtwork == null) {
blankArtwork = new SdlArtwork();
blankArtwork.setType(FileType.GRAPHIC_PNG);
blankArtwork.setName("blankArtwork");
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java
index 32ff8c0eb..887d40e94 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java
@@ -33,15 +33,17 @@
package com.smartdevicelink.managers.screen.choiceset;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
/**
* <strong>ChoiceSetManager</strong> <br>
* ChoiceSetManager gives the developer the ability to control how soft choice sets are displayed on the head unit.<br>
* Note: This class must be accessed through the SdlManager->ScreenManager. Do not instantiate it by itself.<br>
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class ChoiceSetManager extends BaseChoiceSetManager {
/**
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java
index 4a28a2792..b2055c976 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java
@@ -32,8 +32,10 @@
package com.smartdevicelink.managers.screen.menu;
+import androidx.annotation.RestrictTo;
+
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
/**
* <strong>MenuManager</strong> <br>
@@ -42,6 +44,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl;
*
* The MenuManager takes MenuCell objects and creates and sends all necessary RPCs to build out a menu
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class MenuManager extends BaseMenuManager {
public MenuManager(ISdl internalInterface, FileManager fileManager) {
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java
index a892d3a2c..641ab189e 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java
@@ -32,7 +32,9 @@
package com.smartdevicelink.managers.screen.menu;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import androidx.annotation.RestrictTo;
+
+import com.smartdevicelink.managers.ISdl;
/**
* <strong>VoiceCommandManager</strong> <br>
@@ -41,6 +43,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl;
*
* The VoiceCommandManager takes a List of VoiceCommand objects and sets them on the Head unit for you.
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class VoiceCommandManager extends BaseVoiceCommandManager {
public VoiceCommandManager(ISdl internalInterface) {
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/managers/video/HapticInterfaceManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/video/HapticInterfaceManager.java
index f1b9fd4f3..36863bc99 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/managers/video/HapticInterfaceManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/managers/video/HapticInterfaceManager.java
@@ -1,30 +1,30 @@
-/***************************************************************************************************
- * 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.
- **************************************************************************************************/
+/**************************************************************************************************
+ 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.managers.video;
import android.view.View;
import android.view.ViewGroup;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.HapticRect;
import com.smartdevicelink.proxy.rpc.Rectangle;
import com.smartdevicelink.proxy.rpc.SendHapticData;
@@ -45,7 +45,7 @@ import java.util.List;
class HapticInterfaceManager extends BaseHapticInterfaceManager {
private static final String TAG = "Haptic";
- private WeakReference<ISdl> proxyHolder;
+ private final WeakReference<ISdl> proxyHolder;
private List<HapticRect> userHapticData;
HapticInterfaceManager(ISdl proxy) {
@@ -65,12 +65,12 @@ class HapticInterfaceManager extends BaseHapticInterfaceManager {
ISdl proxy = proxyHolder.get();
SendHapticData msg = new SendHapticData();
msg.setHapticRectData(userHapticData);
- proxy.sendRPCRequest(msg);
+ proxy.sendRPC(msg);
}
}
/**
- * Sends haptic data found by searching for focusable and clickable Views in the view heirarchy
+ * Sends haptic data found by searching for focusable and clickable Views in the view hierarchy
* to the HU. Should be called by Presentation's OnShowListener.
*
* @param root
@@ -99,8 +99,10 @@ class HapticInterfaceManager extends BaseHapticInterfaceManager {
if (proxyHolder.get() != null) {
ISdl proxy = proxyHolder.get();
- VideoStreamingCapability videoStreamingCapability = (VideoStreamingCapability)
- proxy.getCapability(SystemCapabilityType.VIDEO_STREAMING);
+ VideoStreamingCapability videoStreamingCapability = null;
+ if (proxy.getSystemCapabilityManager() != null) {
+ videoStreamingCapability = (VideoStreamingCapability) proxy.getSystemCapabilityManager().getCapability(SystemCapabilityType.VIDEO_STREAMING, null, false);
+ }
if (videoStreamingCapability != null && videoStreamingCapability.getScale() != null) {
scale = videoStreamingCapability.getScale();
}
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
index fb5ccdb07..a8c3a74be 100644
--- 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
@@ -40,18 +40,20 @@ import android.view.Display;
import android.view.InputDevice;
import android.view.MotionEvent;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import androidx.annotation.RestrictTo;
+
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.encoder.VirtualDisplayEncoder;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.StreamingStateMachine;
+import com.smartdevicelink.managers.lifecycle.OnSystemCapabilityListener;
+import com.smartdevicelink.protocol.ISdlServiceListener;
+import com.smartdevicelink.protocol.ProtocolMessage;
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;
@@ -59,18 +61,26 @@ 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.VideoStreamingFormat;
import com.smartdevicelink.proxy.rpc.enums.HMILevel;
import com.smartdevicelink.proxy.rpc.enums.PredefinedWindows;
import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
import com.smartdevicelink.proxy.rpc.enums.TouchType;
+import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
import com.smartdevicelink.proxy.rpc.enums.VideoStreamingState;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
+import com.smartdevicelink.streaming.AbstractPacketizer;
+import com.smartdevicelink.streaming.IStreamListener;
+import com.smartdevicelink.streaming.StreamPacketizer;
+import com.smartdevicelink.streaming.video.IVideoStreamListener;
+import com.smartdevicelink.streaming.video.RTPH264Packetizer;
import com.smartdevicelink.streaming.video.SdlRemoteDisplay;
import com.smartdevicelink.streaming.video.VideoStreamingParameters;
import com.smartdevicelink.transport.utl.TransportRecord;
import com.smartdevicelink.util.DebugTool;
import com.smartdevicelink.util.Version;
+import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
@@ -79,22 +89,23 @@ import java.util.concurrent.FutureTask;
@TargetApi(19)
public class VideoStreamManager extends BaseVideoStreamManager {
- private static String TAG = "VideoStreamManager";
+ private static final 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 final float[] touchScalar = {1.0f,1.0f}; //x, y
private HapticInterfaceManager hapticManager;
private SdlMotionEvent sdlMotionEvent = null;
private OnHMIStatus currentOnHMIStatus;
- private StreamingStateMachine stateMachine;
+ private final StreamingStateMachine stateMachine;
private VideoStreamingParameters parameters;
private IVideoStreamListener streamListener;
private boolean isTransportAvailable = false;
private boolean hasStarted;
private String vehicleMake = null;
+ private AbstractPacketizer videoPacketizer;
// INTERNAL INTERFACES
@@ -104,7 +115,7 @@ public class VideoStreamManager extends BaseVideoStreamManager {
if(SessionType.NAV.equals(type)){
if (session != null && session.getAcceptedVideoParams() != null) {
parameters = session.getAcceptedVideoParams();
- VideoStreamManager.this.streamListener = session.startVideoStream();
+ VideoStreamManager.this.streamListener = startVideoStream(session.getAcceptedVideoParams(), session);
}
if (VideoStreamManager.this.streamListener == null) {
@@ -112,7 +123,10 @@ public class VideoStreamManager extends BaseVideoStreamManager {
stateMachine.transitionToState(StreamingStateMachine.ERROR);
return;
}
- VideoStreamingCapability capability = (VideoStreamingCapability) internalInterface.getCapability(SystemCapabilityType.VIDEO_STREAMING);
+ VideoStreamingCapability capability = null;
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ capability = (VideoStreamingCapability) internalInterface.getSystemCapabilityManager().getCapability(SystemCapabilityType.VIDEO_STREAMING, null, false);
+ }
if(capability != null && Boolean.TRUE.equals(capability.getIsHapticSpatialDataSupported())){
hapticManager = new HapticInterfaceManager(internalInterface);
}
@@ -125,6 +139,7 @@ public class VideoStreamManager extends BaseVideoStreamManager {
@Override
public void onServiceEnded(SdlSession session, SessionType type) {
if(SessionType.NAV.equals(type)){
+ stopVideoStream();
if(remoteDisplay!=null){
stopStreaming();
}
@@ -136,6 +151,7 @@ public class VideoStreamManager extends BaseVideoStreamManager {
@Override
public void onServiceError(SdlSession session, SessionType type, String reason) {
DebugTool.logError(TAG, "Unable to start video service: " + reason);
+ stopVideoStream();
stateMachine.transitionToState(StreamingStateMachine.ERROR);
transitionToState(BaseSubManager.ERROR);
}
@@ -156,7 +172,7 @@ public class VideoStreamManager extends BaseVideoStreamManager {
}
checkState();
if (hasStarted && (isHMIStateVideoStreamCapable(prevOnHMIStatus)) && (!isHMIStateVideoStreamCapable(currentOnHMIStatus))) {
- internalInterface.stopVideoService();
+ stopVideoStream();
}
}
}
@@ -177,6 +193,7 @@ public class VideoStreamManager extends BaseVideoStreamManager {
};
// MANAGER APIs
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public VideoStreamManager(ISdl internalInterface){
super(internalInterface);
@@ -221,28 +238,33 @@ public class VideoStreamManager extends BaseVideoStreamManager {
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, vehicleMake); //Streaming parameters are ready time to stream
- VideoStreamManager.this.parameters = params;
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ internalInterface.getSystemCapabilityManager().getCapability(SystemCapabilityType.VIDEO_STREAMING, new OnSystemCapabilityListener() {
+ @Override
+ public void onCapabilityRetrieved(Object capability) {
+ VideoStreamingParameters params = new VideoStreamingParameters();
+ params.update((VideoStreamingCapability) capability, vehicleMake); //Streaming parameters are ready time to stream
+ VideoStreamManager.this.parameters = params;
- checkState();
+ checkState();
- }
+ }
- @Override
- public void onError(String info) {
- DebugTool.logError(TAG, "Error retrieving video streaming capability: " + info);
- stateMachine.transitionToState(StreamingStateMachine.ERROR);
- transitionToState(ERROR);
- }
- });
+ @Override
+ public void onError(String info) {
+ DebugTool.logError(TAG, "Error retrieving video streaming capability: " + info);
+ stateMachine.transitionToState(StreamingStateMachine.ERROR);
+ transitionToState(ERROR);
+ }
+ }, false);
+ }
}else{
//We just use default video streaming params
VideoStreamingParameters params = new VideoStreamingParameters();
- DisplayCapabilities dispCap = (DisplayCapabilities)internalInterface.getCapability(SystemCapabilityType.DISPLAY);
+ DisplayCapabilities dispCap = null;
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ dispCap = (DisplayCapabilities) internalInterface.getSystemCapabilityManager().getCapability(SystemCapabilityType.DISPLAY, null, false);
+ }
if(dispCap !=null){
params.setResolution(dispCap.getScreenParams().getImageResolution());
}
@@ -266,31 +288,37 @@ public class VideoStreamManager extends BaseVideoStreamManager {
this.context = new WeakReference<>(context);
this.remoteDisplayClass = remoteDisplayClass;
int majorProtocolVersion = internalInterface.getProtocolVersion().getMajor();
- if(majorProtocolVersion >= 5 && !internalInterface.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)){
+ boolean isCapabilitySupported = internalInterface.getSystemCapabilityManager() != null && internalInterface.getSystemCapabilityManager().isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING);
+ if(majorProtocolVersion >= 5 && !isCapabilitySupported){
DebugTool.logError(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, vehicleMake); //Streaming parameters are ready time to stream
- startStreaming(params, encrypted);
- }
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ internalInterface.getSystemCapabilityManager().getCapability(SystemCapabilityType.VIDEO_STREAMING, new OnSystemCapabilityListener() {
+ @Override
+ public void onCapabilityRetrieved(Object capability) {
+ VideoStreamingParameters params = new VideoStreamingParameters();
+ params.update((VideoStreamingCapability) capability, vehicleMake); //Streaming parameters are ready time to stream
+ startStreaming(params, encrypted);
+ }
- @Override
- public void onError(String info) {
- stateMachine.transitionToState(StreamingStateMachine.ERROR);
- DebugTool.logError(TAG, "Error retrieving video streaming capability: " + info);
- }
- });
+ @Override
+ public void onError(String info) {
+ stateMachine.transitionToState(StreamingStateMachine.ERROR);
+ DebugTool.logError(TAG, "Error retrieving video streaming capability: " + info);
+ }
+ }, false);
+ }
}else{
//We just use default video streaming params
VideoStreamingParameters params = new VideoStreamingParameters();
- DisplayCapabilities dispCap = (DisplayCapabilities)internalInterface.getCapability(SystemCapabilityType.DISPLAY);
+ DisplayCapabilities dispCap = null;
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ dispCap = (DisplayCapabilities) internalInterface.getSystemCapabilityManager().getCapability(SystemCapabilityType.DISPLAY, null, false);
+ }
if(dispCap !=null){
params.setResolution(dispCap.getScreenParams().getImageResolution());
}
@@ -367,6 +395,7 @@ public class VideoStreamManager extends BaseVideoStreamManager {
* Stops streaming, ends video streaming service and removes service listeners.
*/
@Override
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public void dispose(){
stopStreaming();
@@ -375,13 +404,13 @@ public class VideoStreamManager extends BaseVideoStreamManager {
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);
}
+ stopVideoStream();
stateMachine.transitionToState(StreamingStateMachine.NONE);
@@ -437,13 +466,13 @@ public class VideoStreamManager extends BaseVideoStreamManager {
remoteDisplay.dismissPresentation();
}
- FutureTask<Boolean> fTask = new FutureTask<Boolean>( new SdlRemoteDisplay.Creator(context.get(), disp, remoteDisplay, remoteDisplayClass, new SdlRemoteDisplay.Callback(){
+ FutureTask<Boolean> fTask = new FutureTask<>(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) {
+ if (hapticManager != null) {
remoteDisplay.getMainView().post(new Runnable() {
@Override
public void run() {
@@ -453,25 +482,31 @@ public class VideoStreamManager extends BaseVideoStreamManager {
}
//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){
+ if (internalInterface.getProtocolVersion().getMajor() >= 5) { //At this point we should already have the capability
+ VideoStreamingCapability capability = null;
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ capability = (VideoStreamingCapability) internalInterface.getSystemCapabilityManager().getCapability(SystemCapabilityType.VIDEO_STREAMING, null, false);
+ }
+ 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 (resolution == null) { //Either the protocol version is too low to access video streaming caps, or they were null
+ DisplayCapabilities dispCap = null;
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ dispCap = (DisplayCapabilities) internalInterface.getSystemCapabilityManager().getCapability(SystemCapabilityType.DISPLAY, null, false);
+ }
if (dispCap != null) {
resolution = (dispCap.getScreenParams().getImageResolution());
}
}
- if(resolution != null){
+ if (resolution != null) {
DisplayMetrics displayMetrics = new DisplayMetrics();
disp.getMetrics(displayMetrics);
createTouchScalar(resolution, displayMetrics);
- }
+ }
}
@@ -479,7 +514,7 @@ public class VideoStreamManager extends BaseVideoStreamManager {
public void onInvalidated(final SdlRemoteDisplay remoteDisplay) {
//Our view has been invalidated
//A good time to refresh spatial data
- if(hapticManager != null) {
+ if (hapticManager != null) {
remoteDisplay.getMainView().post(new Runnable() {
@Override
public void run() {
@@ -488,7 +523,7 @@ public class VideoStreamManager extends BaseVideoStreamManager {
});
}
}
- } ));
+ }));
Thread showPresentation = new Thread(fTask);
showPresentation.setName("RmtDispThread");
@@ -527,7 +562,7 @@ public class VideoStreamManager extends BaseVideoStreamManager {
}
List<MotionEvent> convertTouchEvent(OnTouchEvent onTouchEvent){
- List<MotionEvent> motionEventList = new ArrayList<MotionEvent>();
+ List<MotionEvent> motionEventList = new ArrayList<>();
List<TouchEvent> touchEventList = onTouchEvent.getEvent();
if (touchEventList == null || touchEventList.size() == 0) return null;
@@ -608,7 +643,7 @@ public class VideoStreamManager extends BaseVideoStreamManager {
*/
private static class SdlMotionEvent {
class Pointer {
- int id;
+ final int id;
float x;
float y;
Pointer (int id) {
@@ -622,7 +657,7 @@ public class VideoStreamManager extends BaseVideoStreamManager {
}
}
- private CopyOnWriteArrayList<Pointer> pointers = new CopyOnWriteArrayList<>();
+ private final CopyOnWriteArrayList<Pointer> pointers = new CopyOnWriteArrayList<>();
private long downTime;
private long downTimeOnHMI;
private long eventTime;
@@ -704,4 +739,57 @@ public class VideoStreamManager extends BaseVideoStreamManager {
}
}
+ private VideoStreamingProtocol getAcceptedProtocol(VideoStreamingParameters params) {
+ if (params != null) {
+ VideoStreamingFormat format = params.getFormat();
+ if (format != null && format.getProtocol() != null) {
+ return format.getProtocol();
+ }
+ }
+ //Returns default protocol if none are found
+ return new VideoStreamingParameters().getFormat().getProtocol();
+
+ }
+
+ protected IVideoStreamListener startVideoStream(VideoStreamingParameters params, final SdlSession session) {
+ VideoStreamingProtocol protocol = getAcceptedProtocol(params);
+
+ IStreamListener iStreamListener = new IStreamListener() {
+ @Override
+ public void sendStreamPacket(ProtocolMessage pm) {
+ session.sendMessage(pm);
+ }
+ };
+
+ try {
+ switch (protocol) {
+ case RAW: {
+ videoPacketizer = new StreamPacketizer(iStreamListener, null, SessionType.NAV, (byte) session.getSessionId(), session);
+ videoPacketizer.start();
+ return (IVideoStreamListener) videoPacketizer;
+ }
+ case RTP: {
+ //FIXME why is this not an extension of StreamPacketizer?
+ videoPacketizer = new RTPH264Packetizer(iStreamListener, SessionType.NAV, (byte) session.getSessionId(), session);
+ videoPacketizer.start();
+ return (IVideoStreamListener) videoPacketizer;
+ }
+ default:
+ DebugTool.logError(TAG, "Protocol " + protocol + " is not supported.");
+ return null;
+ }
+ } catch (IOException e) {
+ return null;
+ }
+
+ }
+
+ protected boolean stopVideoStream() {
+ if (videoPacketizer != null) {
+ videoPacketizer.stop();
+ return true;
+ }
+ return false;
+ }
+
}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacket.java b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
index 21a34c695..707f55c01 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
@@ -3,9 +3,12 @@ package com.smartdevicelink.protocol;
import android.os.Parcel;
import android.os.Parcelable;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.transport.utl.TransportRecord;
import com.smartdevicelink.util.DebugTool;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class SdlPacket extends BaseSdlPacket implements Parcelable {
private static final String TAG = "SdlPacket";
private static final int EXTRA_PARCEL_DATA_LENGTH = 24;
@@ -31,7 +34,7 @@ public class SdlPacket extends BaseSdlPacket implements Parcelable {
}
/* ***************************************************************************************************************************************************
- * *********************************************************** Parceable Overrides *****************************************************************
+ * *********************************************************** Parcelable Overrides *****************************************************************
*****************************************************************************************************************************************************/
@@ -39,7 +42,7 @@ public class SdlPacket extends BaseSdlPacket implements Parcelable {
//I think this is FIFO...right?
public SdlPacket(Parcel p) {
this.version = p.readInt();
- this.encryption = (p.readInt() == 0) ? false : true;
+ this.encryption = p.readInt() != 0;
this.frameType = p.readInt();
this.serviceType = p.readInt();
this.frameInfo = p.readInt();
@@ -58,7 +61,7 @@ public class SdlPacket extends BaseSdlPacket implements Parcelable {
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());
+ this.transportRecord = p.readParcelable(TransportRecord.class.getClassLoader());
}
}
}catch (RuntimeException e){
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
index 9825900e9..2f5771548 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
@@ -33,6 +33,7 @@
package com.smartdevicelink.protocol;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.transport.MultiplexTransportConfig;
@@ -45,11 +46,11 @@ import java.util.Collections;
@SuppressWarnings("WeakerAccess")
+@RestrictTo(RestrictTo.Scope.LIBRARY)
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();
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
index ce314595d..b0fcc73f3 100644
--- 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
@@ -1,41 +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.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
+import androidx.annotation.RestrictTo;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class HeartbeatMonitor implements IHeartbeatMonitor {
public static final int HEARTBEAT_INTERVAL = 5000;
@@ -45,7 +47,7 @@ public class HeartbeatMonitor implements IHeartbeatMonitor {
private final Object listenerLock = new Object();
private int mHeartBeatInterval = HEARTBEAT_INTERVAL;
- private boolean mHeartBeatAck = true;
+ private final boolean mHeartBeatAck = true;
private IHeartbeatMonitorListener mListener;
private volatile boolean mIsAckReceived;
@@ -62,7 +64,7 @@ public class HeartbeatMonitor implements IHeartbeatMonitor {
public Runnable getHeartbeatRunnable () { return heartbeatTimeoutRunnable; }
public boolean isHeartbeatReceived () { return isHeartbeatReceived; }
- private Runnable heartbeatTimeoutRunnable = new Runnable() {
+ private final Runnable heartbeatTimeoutRunnable = new Runnable() {
@Override
public void run() {
@@ -89,7 +91,7 @@ public class HeartbeatMonitor implements IHeartbeatMonitor {
}
};
- private Runnable heartbeatAckTimeoutRunnable = new Runnable() {
+ private final Runnable heartbeatAckTimeoutRunnable = new Runnable() {
@Override
public void run() {
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
index 2c98413d7..68e8709f4 100644
--- 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
@@ -1,54 +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.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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 androidx.annotation.RestrictTo;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public interface IHeartbeatMonitor {
/**
* Starts the monitor. If the monitor is already started, nothing happens.
*/
- public void start();
+ void start();
/**
* Stops the monitor. Does nothing if it is already stopped.
*/
- public void stop();
+ void stop();
/**
* Returns the heartbeat messages interval.
*
* @return interval in milliseconds
*/
- public int getInterval();
+ int getInterval();
/**
* Sets the interval for sending heartbeat messages if nothing is sent over
@@ -57,34 +59,34 @@ public interface IHeartbeatMonitor {
* @param interval interval in milliseconds (min/max values depend on
* concrete implementations)
*/
- public void setInterval(int interval);
+ void setInterval(int interval);
/**
* Returns the listener.
*
* @return the listener
*/
- public IHeartbeatMonitorListener getListener();
+ IHeartbeatMonitorListener getListener();
/**
* Sets the heartbeat's listener.
*
* @param listener the new listener
*/
- public void setListener(IHeartbeatMonitorListener listener);
+ void setListener(IHeartbeatMonitorListener listener);
/**
* Notifies the monitor about sent/received messages.
*/
- public void notifyTransportActivity();
+ void notifyTransportActivity();
/**
* Notifies the monitor about a received heartbeat ACK message.
*/
- public void heartbeatACKReceived();
+ void heartbeatACKReceived();
/**
* Notifies the monitor about a received heartbeat message.
*/
- public void heartbeatReceived();
+ 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
index da814f3ee..e95a6a5ec 100644
--- 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
@@ -29,24 +29,28 @@
* 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);
-}
+package com.smartdevicelink.protocol.heartbeat;
+
+import androidx.annotation.RestrictTo;
+
+/**
+ * Listener (aka delegate) that actually knows how to work with the outside
+ * world.
+ */
+
+@RestrictTo(RestrictTo.Scope.LIBRARY)
+public interface IHeartbeatMonitorListener {
+ /**
+ * The listener should create and send a heartbeat message.
+ *
+ * @param monitor the caller
+ */
+ void sendHeartbeat(IHeartbeatMonitor monitor);
+
+ /**
+ * Notifies the listener that the heartbeat timed out.
+ *
+ * @param monitor the caller
+ */
+ 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
deleted file mode 100644
index 6cb19000e..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/LockScreenManager.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.LockScreenStatus;
-import com.smartdevicelink.util.AndroidTools;
-
-import java.io.IOException;
-
-@Deprecated
-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
deleted file mode 100644
index 1d1216b40..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCRequestFactory.java
+++ /dev/null
@@ -1,1030 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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.setFuelLevelState(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.setFuelLevelState(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.setFuelLevelState(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("Android");
- 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
deleted file mode 100644
index 28f1989e1..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/RPCStreamController.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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
deleted file mode 100644
index 066c78b37..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyALM.java
+++ /dev/null
@@ -1,2074 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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.managers.lifecycle.SystemCapabilityManager.convertToList;
-
-/**
- * @deprecated use {@link com.smartdevicelink.managers.SdlManager} instead.
- *
- * The guide created for the initial transition of SdlProxyBase/ALM to SdlManager can be found at
- * <a href="https://smartdevicelink.com/en/guides/android/migrating-to-newer-sdl-versions/updating-to-v47/">Migrating to SDL Manager</a>
- */
-@Deprecated
-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
deleted file mode 100644
index 332cb696f..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
+++ /dev/null
@@ -1,8542 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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 androidx.annotation.NonNull;
-import android.telephony.TelephonyManager;
-import android.util.DisplayMetrics;
-import android.util.SparseArray;
-import android.view.Display;
-import android.view.InputDevice;
-import android.view.MotionEvent;
-import android.view.Surface;
-
-import com.livio.taskmaster.Taskmaster;
-import com.smartdevicelink.BuildConfig;
-import com.smartdevicelink.Dispatcher.IDispatchingStrategy;
-import com.smartdevicelink.Dispatcher.ProxyMessageDispatcher;
-import com.smartdevicelink.SdlConnection.ISdlSessionListener;
-import com.smartdevicelink.SdlConnection.SdlSession;
-import com.smartdevicelink.encoder.VirtualDisplayEncoder;
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.exception.SdlExceptionCause;
-//import com.smartdevicelink.managers.video.HapticInterfaceManager;
-import com.smartdevicelink.managers.ServiceEncryptionListener;
-import com.smartdevicelink.managers.lifecycle.RpcConverter;
-import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
-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.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.TCPTransportConfig;
-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.HashSet;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Set;
-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;
-
-
-/**
- * @deprecated use {@link com.smartdevicelink.managers.SdlManager} instead.
- *
- * The guide created for the initial transition of SdlProxyBase to SdlManager can be found at
- * <a href="https://smartdevicelink.com/en/guides/android/migrating-to-newer-sdl-versions/updating-to-v47/">Migrating to SDL Manager</a>
- */
-@SuppressWarnings({"WeakerAccess", "Convert2Diamond"})
-@Deprecated
-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("6.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(),
- 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;
- private ISdlServiceListener navServiceListener;
-
- /**
- * 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;
-
- private Set<String> encryptionRequiredRPCs = new HashSet<>();
- private boolean rpcSecuredServiceStarted;
- private ServiceEncryptionListener serviceEncryptionListener;
- private Taskmaster taskmaster;
-
- // 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,encrypted);
- addNavListener();
- }
- }
-
- @Override
- public void stopVideoService() {
- if(isConnected()){
- sdlSession.endService(SessionType.NAV);
- }
- }
-
- @Override public void stopAudioService() {
- if(isConnected()){
- sdlSession.endService(SessionType.PCM);
- }
- }
-
- @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 sendRPCs(List<? extends RPCMessage> 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(TAG, "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 RegisterAppInterfaceResponse getRegisterAppInterfaceResponse() {
- return SdlProxyBase.this.getRegisterAppInterfaceResponse();
- }
-
- @Override
- public void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener) {
- SdlProxyBase.this.getCapability(systemCapabilityType, scListener);
- }
-
- @Override
- public Object getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener, boolean forceUpdate) {
- if (_systemCapabilityManager != null) {
- return _systemCapabilityManager.getCapability(systemCapabilityType, scListener, forceUpdate);
- }
- return null;
- }
-
- @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,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);
- }
-
- @Override
- public void startRPCEncryption() {
- SdlProxyBase.this.startProtectedRPCService();
- }
-
- @Override
- public Taskmaster getTaskmaster() {
- return SdlProxyBase.this.getTaskmaster();
- }
- };
-
- Taskmaster getTaskmaster() {
- if (taskmaster == null) {
- Taskmaster.Builder builder = new Taskmaster.Builder();
- builder.setThreadCount(2);
- builder.shouldBeDaemon(false);
- taskmaster = builder.build();
- taskmaster.start();
- }
- return taskmaster;
- }
-
- 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 ISdlSessionListener {
-
- @Override
- public void onTransportDisconnected(String info, boolean altTransportAvailable, BaseTransportConfig transportConfig) {
-
- notifyPutFileStreamError(null, info);
-
- if (altTransportAvailable){
- SdlProxyBase.this._transportConfig = transportConfig;
- DebugTool.logInfo(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 onRPCMessageReceived(RPCMessage rpcMessage) {
-
- }
-
- @Override
- public void onSessionStarted(int sessionID, Version version) {
-
- }
-
- @Override
- public void onSessionEnded(int sessionID) {
-
- }
-
- @Override
- public void onAuthTokenReceived(String authToken, int sessionID) {
-
- }
-
-
- 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);
- }
- }
-
- }
-
- protected SdlProxyBase(){}
-
- /**
- * 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
- {
- DebugTool.logInfo(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;
- }
-
- addOnRPCNotificationListener(FunctionID.ON_PERMISSIONS_CHANGE, onPermissionsChangeListener);
- this._internalInterface.addServiceListener(SessionType.RPC, securedServiceListener);
- this._internalInterface.addServiceListener(SessionType.NAV, securedServiceListener);
- this._internalInterface.addServiceListener(SessionType.PCM, securedServiceListener);
-
-
- // 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();
- }
- sURLString = sURLString.replaceFirst("http://", "https://");
-
- 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)
- {
- DebugTool.logInfo(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)
- {
- DebugTool.logInfo(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);
- DebugTool.logInfo(TAG, "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(TAG, "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);
- DebugTool.logInfo(TAG, "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(TAG, "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(TAG, "sendSystemRequestToUrl: JSONException: ", e);
- updateBroadcastIntent(sendIntent, "COMMENT3", " JSONException encountered sendOnSystemRequestToUrl: "+ e);
- //Log.i("pt", "sendSystemRequestToUrl: JSONException: "+ e);
- }
- catch (UnsupportedEncodingException e)
- {
- DebugTool.logError(TAG, "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(TAG, "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(TAG, "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(TAG, "sendSystemRequestToUrl: IOException: ", e);
- updateBroadcastIntent(sendIntent, "COMMENT3", " IOException while sending to cloud: IOException: "+ e);
- //Log.i("pt", "sendSystemRequestToUrl: IOException: "+ e);
- }
- catch (Exception e)
- {
- DebugTool.logError(TAG, "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(TAG, "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 != null && _transportConfig.getTransportType().equals(TransportType.MULTIPLEX)) {
- this.sdlSession = new SdlSession(_interfaceBroker, (MultiplexTransportConfig) _transportConfig);
- }else if(_transportConfig != null &&_transportConfig.getTransportType().equals(TransportType.TCP)){
- this.sdlSession = new SdlSession(_interfaceBroker, (TCPTransportConfig) _transportConfig);
- }else {
- throw new SdlException(new UnsupportedOperationException("Unable to create session with supplied transport config"));
- }
- }
-
- 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) {
- DebugTool.logInfo(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 = "no";//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);
- }
- }
-
- /**
- * Check to see if the proxy has already been disposed
- * @return if the proxy has been disposed
- */
- public synchronized boolean isDisposed(){
- return _proxyDisposed;
- }
-
- /**
- * 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 {
- SdlTrace.logProxyEvent("Application called dispose() method.", SDL_LIB_TRACE_KEY);
- disposeInternal(SdlDisconnectedReason.APPLICATION_REQUESTED_DISCONNECT);
- if (taskmaster != null) {
- taskmaster.shutdown();
- }
- }
- /**
- * Terminates the App's Interface Registration, closes the transport connection, ends the protocol session, and frees any resources used by the proxy.
- * @param sdlDisconnectedReason the reason the proxy should be disposed.
- */
- private synchronized void disposeInternal(SdlDisconnectedReason sdlDisconnectedReason) 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;
- rpcSecuredServiceStarted = false;
- encryptionRequiredRPCs.clear();
- serviceEncryptionListener = null;
-
- try{
- // Clean the proxy
- cleanProxy(sdlDisconnectedReason);
-
- if (sdlDisconnectedReason == SdlDisconnectedReason.MINIMUM_PROTOCOL_VERSION_HIGHER_THAN_SUPPORTED
- || sdlDisconnectedReason == SdlDisconnectedReason.MINIMUM_RPC_VERSION_HIGHER_THAN_SUPPORTED){
- //We want to notify listeners for this case before disposing the dispatchers
- notifyProxyClosed(sdlDisconnectedReason.toString(), null, sdlDisconnectedReason);
- }
-
- // 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(TAG, "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(TAG, "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(TAG, "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(TAG, "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(TAG, "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(TAG, "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(TAG, 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(TAG, "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 OnRPCNotificationListener onPermissionsChangeListener = new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- List<PermissionItem> permissionItems = ((OnPermissionsChange) notification).getPermissionItem();
- Boolean requireEncryptionAppLevel = ((OnPermissionsChange) notification).getRequireEncryption();
- encryptionRequiredRPCs.clear();
- if (requireEncryptionAppLevel == null || requireEncryptionAppLevel) {
- if (permissionItems != null && !permissionItems.isEmpty()) {
- for (PermissionItem permissionItem : permissionItems) {
- if (permissionItem != null && Boolean.TRUE.equals(permissionItem.getRequireEncryption())) {
- String rpcName = permissionItem.getRpcName();
- if (rpcName != null) {
- encryptionRequiredRPCs.add(rpcName);
- }
- }
- }
- }
- checkStatusAndInitSecuredService();
- }
- }
- };
-
- private ISdlServiceListener securedServiceListener = new ISdlServiceListener() {
- @Override
- public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted) {
- if(_proxyDisposed){
- DebugTool.logInfo(TAG, "Ignoring start service packet, proxy is disposed");
- return;
- }
- if(SessionType.RPC.equals(type)){
- rpcSecuredServiceStarted = isEncrypted;
- }
- if (serviceEncryptionListener != null) {
- serviceEncryptionListener.onEncryptionServiceUpdated(type, isEncrypted, null);
- }
- DebugTool.logInfo(TAG, "onServiceStarted, session Type: " + type.getName() + ", isEncrypted: " + isEncrypted);
- }
-
- @Override
- public void onServiceEnded(SdlSession session, SessionType type) {
- if(_proxyDisposed){
- DebugTool.logInfo(TAG, "Ignoring end service packet, proxy is disposed");
- return;
- }
- if (SessionType.RPC.equals(type)) {
- rpcSecuredServiceStarted = false;
- }
- if (serviceEncryptionListener != null) {
- serviceEncryptionListener.onEncryptionServiceUpdated(type, false, null);
- }
- DebugTool.logInfo(TAG, "onServiceEnded, session Type: " + type.getName());
- }
-
- @Override
- public void onServiceError(SdlSession session, SessionType type, String reason) {
- if(_proxyDisposed){
- DebugTool.logInfo(TAG, "Ignoring start service error, proxy is disposed");
- return;
- }
- if (SessionType.RPC.equals(type)) {
- rpcSecuredServiceStarted = false;
- }
- if (serviceEncryptionListener != null) {
- serviceEncryptionListener.onEncryptionServiceUpdated(type, false, "onServiceError: " + reason);
- }
- DebugTool.logError(TAG, "onServiceError, session Type: " + type.getName() + ", reason: " + reason);
- }
- };
-
- /**
- * Checks if an RPC requires encryption
- *
- * @param rpcName the rpc name (FunctionID) to check
- * @return true if the given RPC requires encryption; false, otherwise
- */
- public boolean getRPCRequiresEncryption(@NonNull FunctionID rpcName) {
- return encryptionRequiredRPCs.contains(rpcName.toString());
- }
-
- /**
- * Gets the encryption requirement
- * @return true if encryption is required; false otherwise
- */
- public boolean getRequiresEncryption() {
- return !encryptionRequiredRPCs.isEmpty();
- }
-
- private void checkStatusAndInitSecuredService() {
- if ((_hmiLevel != null && _hmiLevel != HMILevel.HMI_NONE) && getRequiresEncryption() && !rpcSecuredServiceStarted) {
- startProtectedRPCService();
- }
- }
-
- // Private sendRPCMessagePrivate method. All RPCMessages are funneled through this method after error checking.
- protected 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()));
- if (rpcSecuredServiceStarted && getRPCRequiresEncryption(message.getFunctionID())) {
- pm.setPayloadProtected(true);
- } else {
- pm.setPayloadProtected(message.isPayloadProtected());
- }
- if (pm.getPayloadProtected() && (!rpcSecuredServiceStarted || !rpcProtectedStartResponse)){
- String errorInfo = "Trying to send an encrypted message and there is no secured service";
- if (message.getMessageType().equals((RPCMessage.KEY_REQUEST))) {
- RPCRequest request = (RPCRequest) message;
- OnRPCResponseListener listener = ((RPCRequest) message).getOnRPCResponseListener();
- if (listener != null) {
- listener.onError(request.getCorrelationID(), Result.ABORTED, errorInfo);
- }
- }
- DebugTool.logWarning(TAG, errorInfo);
- return;
- }
-
- if (sdlSession != null) {
- pm.setSessionID((byte)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(TAG, "handleRPCMessage: hash is null, returning.");
- return;
- }
-
- RPCMessage rpcMsg = RpcConverter.convertTableToRpc(hash);
-
- if (rpcMsg == null){
- DebugTool.logError(TAG, "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;
- }
- DebugTool.logInfo(TAG, "Negotiated RPC Spec version = " + rpcSpecVersion);
-
- _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(TAG, sVersionInfo, false);
- disableDebugTool();
- }
- else
- DebugTool.logInfo(TAG, 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 the RPC version is too low we should simply dispose this proxy
- if (minimumRPCVersion != null && minimumRPCVersion.isNewerThan(rpcSpecVersion) == 1) {
- DebugTool.logWarning(TAG, String.format("Disconnecting from head unit, the configured minimum RPC version %s is greater than the supported RPC version %s", minimumRPCVersion, rpcSpecVersion));
- try {
- disposeInternal(SdlDisconnectedReason.MINIMUM_RPC_VERSION_HIGHER_THAN_SUPPORTED);
- } catch (SdlException e) {
- e.printStackTrace();
- }
- return;
- }
-
-
- 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())) {
-
- DebugTool.logInfo(TAG, "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())) {
-
- DebugTool.logInfo(TAG, "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();
- if(_sdlMsgVersion != null){
- rpcSpecVersion = new com.smartdevicelink.util.Version(_sdlMsgVersion.getMajorVersion(),_sdlMsgVersion.getMinorVersion(), _sdlMsgVersion.getPatchVersion());
- } else {
- rpcSpecVersion = MAX_SUPPORTED_RPC_VERSION;
- }
- DebugTool.logInfo(TAG, "Negotiated RPC Spec version = " + rpcSpecVersion);
-
- _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(TAG, "SDL Proxy Version: " + _proxyVersionInfo);
- disableDebugTool();
- }
- else
- DebugTool.logInfo(TAG, "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);
- }
- //If the RPC version is too low we should simply dispose this proxy
- if (minimumRPCVersion != null && minimumRPCVersion.isNewerThan(rpcSpecVersion) == 1) {
- DebugTool.logWarning(TAG, String.format("Disconnecting from head unit, the configured minimum RPC version %s is greater than the supported RPC version %s", minimumRPCVersion, rpcSpecVersion));
- try {
- disposeInternal(SdlDisconnectedReason.MINIMUM_RPC_VERSION_HIGHER_THAN_SUPPORTED);
- } catch (SdlException e) {
- e.printStackTrace();
- }
- return;
- }
- } 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.CREATE_WINDOW.toString())) {
- final CreateWindowResponse msg = new CreateWindowResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onCreateWindowResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onCreateWindowResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.DELETE_WINDOW.toString())) {
- final DeleteWindowResponse msg = new DeleteWindowResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onDeleteWindowResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onDeleteWindowResponse(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 (functionName.equals(FunctionID.CLOSE_APPLICATION.toString())) {
- final CloseApplicationResponse msg = new CloseApplicationResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onCloseApplicationResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onCloseApplicationResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.CANCEL_INTERACTION.toString())) {
- final CancelInteractionResponse msg = new CancelInteractionResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onCancelInteractionResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onCancelInteractionResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.UNPUBLISH_APP_SERVICE.toString())) {
- final UnpublishAppServiceResponse msg = new UnpublishAppServiceResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onUnpublishAppServiceResponse( msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onUnpublishAppServiceResponse( msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.SHOW_APP_MENU.toString())) {
- final ShowAppMenuResponse msg = new ShowAppMenuResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- // Run in UI thread
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onShowAppMenuResponse( msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onShowAppMenuResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.GET_INTERIOR_VEHICLE_DATA_CONSENT.toString())) {
- final GetInteriorVehicleDataConsentResponse msg = new GetInteriorVehicleDataConsentResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onGetInteriorVehicleDataConsentResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onGetInteriorVehicleDataConsentResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else if (functionName.equals(FunctionID.RELEASE_INTERIOR_VEHICLE_MODULE.toString())) {
- final ReleaseInteriorVehicleDataModuleResponse msg = new ReleaseInteriorVehicleDataModuleResponse(hash);
- msg.format(rpcSpecVersion, true);
- if (_callbackToUIThread) {
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- _proxyListener.onReleaseInteriorVehicleDataModuleResponse(msg);
- onRPCResponseReceived(msg);
- }
- });
- } else {
- _proxyListener.onReleaseInteriorVehicleDataModuleResponse(msg);
- onRPCResponseReceived(msg);
- }
- } else {
- if (_sdlMsgVersion != null) {
- DebugTool.logError(TAG, "Unrecognized response Message: " + functionName +
- " SDL Message Version = " + _sdlMsgVersion);
- } else {
- DebugTool.logError(TAG, "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();
- if (_hmiLevel != HMILevel.HMI_NONE) {
- checkStatusAndInitSecuredService();
- }
- _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);
-
- DebugTool.logInfo(TAG, "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) {
- if (msg.getUrl() != null) {
- //Download the icon file and send SystemRequest RPC
- Thread handleOffBoardTransmissionThread = new Thread() {
- @Override
- public void run() {
- String urlHttps = msg.getUrl().replaceFirst("http://", "https://");
- byte[] file = FileUtls.downloadFile(urlHttps);
- 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(TAG, "File was null at: " + urlHttps);
- }
- }
- };
- 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
-
- if(_mainUIHandler == null){
- _mainUIHandler = new Handler(Looper.getMainLooper());
- }
-
- //This needs to be ran on the main thread
-
- _mainUIHandler.post(new Runnable() {
- @Override
- public void run() {
- 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(TAG, "Unrecognized notification Message: " + functionName +
- " connected to SDL using message version: " + _sdlMsgVersion.getMajorVersion() + "." + _sdlMsgVersion.getMinorVersion());
- } else {
- DebugTool.logInfo(TAG, "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.setCustomButtonID(((OnButtonPress) notification).getCustomButtonID());
- 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);
- }
-
- // Break out of recursion, we have finished the requests
- if (rpcs.size() == 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());
-
- final OnRPCResponseListener devOnRPCResponseListener = request.getOnRPCResponseListener();
-
- request.setOnRPCResponseListener(new OnRPCResponseListener() {
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- if (devOnRPCResponseListener != null){
- devOnRPCResponseListener.onResponse(correlationId, response);
- }
- if (listener != null) {
- listener.onResponse(correlationId, response);
- listener.onUpdate(rpcs.size());
-
- }
- try {
- // recurse after onResponse
- 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 (devOnRPCResponseListener != null){
- devOnRPCResponseListener.onError(correlationId, resultCode, info);
- }
- if (listener != null) {
- listener.onError(correlationId, resultCode, info);
- listener.onUpdate(rpcs.size());
- }
- try {
- // recurse after onError
- sendSequentialRequests(rpcs, listener);
- } catch (SdlException e) {
- e.printStackTrace();
- if (listener != null) {
- listener.onError(correlationId, Result.GENERIC_ERROR, e.toString());
- }
- }
- }
- });
- sendRPCMessagePrivate(request);
- } else {
- // Notifications and Responses
- sendRPCMessagePrivate(rpc);
- if (listener != null) {
- listener.onUpdate(rpcs.size());
- }
- // recurse after sending a notification or response as there is no response.
- try {
- sendSequentialRequests(rpcs, listener);
- } catch (SdlException e) {
- e.printStackTrace();
- if (listener != null) {
- listener.onError(0, Result.GENERIC_ERROR, e.toString());
- }
- }
- }
-
-
- }
-
- /**
- * 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;
- final OnRPCResponseListener devOnRPCResponseListener = request.getOnRPCResponseListener();
- request.setCorrelationID(CorrelationIdGenerator.generateId());
- if (listener != null) {
- listener.addCorrelationId(request.getCorrelationID());
- request.setOnRPCResponseListener(new OnRPCResponseListener() {
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- if (devOnRPCResponseListener != null){
- devOnRPCResponseListener.onResponse(correlationId, response);
- }
- if (listener.getSingleRpcResponseListener() != null) {
- listener.getSingleRpcResponseListener().onResponse(correlationId, response);
- }
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- super.onError(correlationId, resultCode, info);
- if (devOnRPCResponseListener != null){
- devOnRPCResponseListener.onError(correlationId, resultCode, info);
- }
- if (listener.getSingleRpcResponseListener() != null) {
- listener.getSingleRpcResponseListener().onError(correlationId, resultCode, info);
- }
- }
- });
- }
- sendRPCMessagePrivate(request);
- }else {
- // Notifications and Responses
- sendRPCMessagePrivate(rpc);
- if (listener != null){
- listener.onUpdate(rpcs.size());
- if (rpcs.size() == 0){
- listener.onFinished();
- }
- }
- }
- }
- }
-
- 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);
- DebugTool.logInfo(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 = null;//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) {
- DebugTool.logError(TAG, "SyncConnectionUnable to start streaming:", e);
- 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 = null;//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) {
- DebugTool.logError(TAG, "SyncConnection Unable to start streaming:", e);
- return null;
- }
- }
-
- private RPCStreamController startPutFileStream(String sPath, PutFile msg) {
- if (sdlSession == null) return null;
- return startRPCStream(sPath, msg, SessionType.RPC, (byte)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, (byte)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 null;//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, isEncrypted);
- }
-
- @SuppressWarnings("unused")
- public void endService(SessionType serviceType){
- sdlSession.endService(serviceType);
- }
-
-
-
- /**
- * @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, isEncrypted);
- addNavListener();
- 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, isEncrypted);
- addNavListener();
- 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 null;//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, 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, 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 null;
- //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(TAG, "StartService for nav failed. Rejected params: " + builder.toString());
-
- } else {
- DebugTool.logWarning(TAG, "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(TAG, "SdlSession is not created yet.");
- return null;
- }
- if (!sdlSession.getIsConnected()) {
- DebugTool.logWarning(TAG, "Connection is not available.");
- return null;
- }
-
- sdlSession.setDesiredVideoParams(parameters);
-
- VideoStreamingParameters acceptedParams = tryStartVideoStream(isEncrypted, parameters);
- if (acceptedParams != null) {
- return null;// sdlSession.startVideoStream();
- } else {
- return null;
- }
- }
-
- /**
- * This method will try to start the video service with the requested parameters.
- * When it returns it will attempt to store the accepted parameters if available.
- * @param isEncrypted if the service should be encrypted
- * @param parameters the desiered video streaming parameters
- */
- public void startVideoService(boolean isEncrypted, VideoStreamingParameters parameters) {
- if (sdlSession == null) {
- DebugTool.logWarning(TAG, "SdlSession is not created yet.");
- return;
- }
- if (!sdlSession.getIsConnected()) {
- DebugTool.logWarning(TAG, "Connection is not available.");
- return;
- }
-
- sdlSession.setDesiredVideoParams(parameters);
-
- tryStartVideoStream(isEncrypted, parameters);
- }
-
- /**
- *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 false;//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 false;//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 null;//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)){
- DebugTool.logError(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) {
- DebugTool.logError(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(TAG, "SdlSession is not created yet.");
- return null;
- }
- if(protocolVersion!= null && protocolVersion.getMajor() >= 5 && !_systemCapabilityManager.isCapabilitySupported(SystemCapabilityType.VIDEO_STREAMING)){
- DebugTool.logWarning(TAG, "Module doesn't support video streaming.");
- return null;
- }
- if (parameters == null) {
- DebugTool.logWarning(TAG, "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, isEncrypted);
- addNavListener();
- 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(TAG, "StartService for nav failed. Rejected params: " + builder.toString());
-
- } else {
- DebugTool.logWarning(TAG, "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);
- }
-
- private void addNavListener(){
-
- // videos may be started and stopped. Only add this once
- if (navServiceListener == null){
-
- navServiceListener = new ISdlServiceListener() {
- @Override
- public void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted) { }
-
- @Override
- public void onServiceEnded(SdlSession session, SessionType type) {
- // reset nav flags so nav can start upon the next transport connection
- resetNavStartFlags();
- // propagate notification up to proxy listener so the developer will know that the service is ended
- if (_proxyListener != null) {
- _proxyListener.onServiceEnded(new OnServiceEnded(type));
- }
- }
-
- @Override
- public void onServiceError(SdlSession session, SessionType type, String reason) {
- // if there is an error reset the flags so that there is a chance to restart streaming
- resetNavStartFlags();
- }
- };
- this.sdlSession.addServiceListener(SessionType.NAV, navServiceListener);
- }
- }
-
- /**
- * 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(TAG, "SdlSession is not created yet.");
- return null;
- }
- if (!sdlSession.getIsConnected()) {
- DebugTool.logWarning(TAG, "Connection is not available.");
- return null;
- }
- if (codec != AudioStreamingCodec.LPCM) {
- DebugTool.logWarning(TAG, "Audio codec " + codec + " is not supported.");
- return null;
- }
-
- pcmServiceStartResponseReceived = false;
- pcmServiceStartResponse = false;
- sdlSession.startService(SessionType.PCM, 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(TAG, "StartService for audio succeeded");
- return null;//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(TAG, "StartService for audio failed. Rejected params: " + builder.toString());
- } else {
- DebugTool.logWarning(TAG, "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 false;//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 false;//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;
- }
-
- private void resetNavStartFlags() {
- navServiceStartResponseReceived = false;
- navServiceStartResponse = false;
- navServiceStartRejectedParams = null;
- }
-
- public void setAppService(Service mService)
- {
- _appService = mService;
- }
-
- @SuppressWarnings("unused")
- public boolean startProtectedRPCService() {
- rpcProtectedResponseReceived = false;
- rpcProtectedStartResponse = false;
- sdlSession.startService(SessionType.RPC, 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 = null;//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().replaceFirst("http://", "https://");
- //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("Android");
- deviceInfo.setOsVersion(Build.VERSION.RELEASE);
- deviceInfo.setCarrier(carrierName);
-
- if (sdlMsgVersion == null) {
- sdlMsgVersion = new SdlMsgVersion();
- if(protocolVersion.getMajor() == 1) {
- DebugTool.logInfo(TAG, "Connected to an older module, must send 1.0.0 as RPC spec");
- sdlMsgVersion.setMajorVersion(1);
- sdlMsgVersion.setMinorVersion(0);
- }else {
- 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.setFuelLevelState(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.setFuelLevelState(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.setFuelLevelState(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.setFuelLevelState(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.setFuelLevelState(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.setFuelLevelState(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(Long.valueOf(iOffset));
- msg.setLength(Long.valueOf(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();
- }
-
- @Deprecated
- public void setSdlSecurityClassList(List<Class<? extends SdlSecurityBase>> list) {
- _secList = list;
- }
-
- /**
- * Sets the security libraries and a callback to notify caller when there is update to encryption service
- * @param secList The list of security class(es)
- * @param listener The callback object
- */
- public void setSdlSecurity(@NonNull List<Class<? extends SdlSecurityBase>> secList, ServiceEncryptionListener listener) {
- _secList = secList;
- serviceEncryptionListener = listener;
- }
-
- 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) {
- List<MotionEvent> events = convertTouchEvent((OnTouchEvent) notification);
- if (events != null && !events.isEmpty()) {
- for (MotionEvent ev : events) {
- remoteDisplay.handleMotionEvent(ev);
- }
- }
- }
- }
- });
- }
-
- /**
- * 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){
- DebugTool.logError(TAG, "Error starting video service");
- return;
- }
- VideoStreamingCapability capability = (VideoStreamingCapability)_systemCapabilityManager.getCapability(SystemCapabilityType.VIDEO_STREAMING);
- if(capability != null && Boolean.TRUE.equals(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();
- }
- DebugTool.logInfo(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) {
- DebugTool.logError(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(TAG, "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 List<MotionEvent> convertTouchEvent(OnTouchEvent onTouchEvent) {
- List<MotionEvent> motionEventList = new ArrayList<MotionEvent>();
-
- List<TouchEvent> touchEventList = onTouchEvent.getEvent();
- if (touchEventList == null || touchEventList.size() == 0) return null;
-
- TouchType touchType = onTouchEvent.getType();
- if (touchType == null) {
- return null;
- }
-
- if (sdlMotionEvent == null) {
- if (touchType == TouchType.BEGIN) {
- sdlMotionEvent = new SdlMotionEvent();
- } else {
- return null;
- }
- }
-
- SdlMotionEvent.Pointer pointer;
- MotionEvent motionEvent;
-
- for (TouchEvent touchEvent : touchEventList) {
- if (touchEvent == null || touchEvent.getId() == null) {
- continue;
- }
-
- List<TouchCoord> touchCoordList = touchEvent.getTouchCoordinates();
- if (touchCoordList == null || touchCoordList.size() == 0) {
- continue;
- }
-
- TouchCoord touchCoord = touchCoordList.get(touchCoordList.size() - 1);
- if (touchCoord == null) {
- continue;
- }
-
- int motionEventAction = sdlMotionEvent.getMotionEventAction(touchType, touchEvent);
- long downTime = sdlMotionEvent.downTime;
- long eventTime = sdlMotionEvent.eventTime;
- pointer = sdlMotionEvent.getPointerById(touchEvent.getId());
- if (pointer != null) {
- pointer.setCoords(touchCoord.getX() * touchScalar[0], touchCoord.getY() * touchScalar[1]);
- }
-
- MotionEvent.PointerProperties[] pointerProperties = new MotionEvent.PointerProperties[sdlMotionEvent.pointers.size()];
- MotionEvent.PointerCoords[] pointerCoords = new MotionEvent.PointerCoords[sdlMotionEvent.pointers.size()];
-
- for (int i = 0; i < sdlMotionEvent.pointers.size(); i++) {
- pointerProperties[i] = new MotionEvent.PointerProperties();
- pointerProperties[i].id = sdlMotionEvent.getPointerByIndex(i).id;
- pointerProperties[i].toolType = MotionEvent.TOOL_TYPE_FINGER;
-
- pointerCoords[i] = new MotionEvent.PointerCoords();
- pointerCoords[i].x = sdlMotionEvent.getPointerByIndex(i).x;
- pointerCoords[i].y = sdlMotionEvent.getPointerByIndex(i).y;
- pointerCoords[i].orientation = 0;
- pointerCoords[i].pressure = 1.0f;
- pointerCoords[i].size = 1;
- }
-
- motionEvent = MotionEvent.obtain(downTime, eventTime, motionEventAction,
- sdlMotionEvent.pointers.size(), pointerProperties, pointerCoords, 0, 0, 1,
- 1, 0, 0, InputDevice.SOURCE_TOUCHSCREEN, 0);
- motionEventList.add(motionEvent);
-
- if (motionEventAction == MotionEvent.ACTION_UP || motionEventAction == MotionEvent.ACTION_CANCEL) {
- //If the motion event should be finished we should clear our reference
- sdlMotionEvent.pointers.clear();
- sdlMotionEvent = null;
- break;
- } else if ((motionEventAction & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_POINTER_UP) {
- sdlMotionEvent.removePointerById(touchEvent.getId());
- }
- }
-
- return motionEventList;
- }
- }
-
- /**
- * Keeps track of the current motion event for VPM
- */
- private static class SdlMotionEvent {
- class Pointer {
- int id;
- float x;
- float y;
-
- Pointer(int id) {
- this.id = id;
- this.x = 0.0f;
- this.y = 0.0f;
- }
-
- void setCoords(float x, float y) {
- this.x = x;
- this.y = y;
- }
- }
-
- private CopyOnWriteArrayList<Pointer> pointers = new CopyOnWriteArrayList<>();
- private long downTime;
- private long downTimeOnHMI;
- private long eventTime;
-
- SdlMotionEvent() {
- downTimeOnHMI = 0;
- }
-
- /**
- * Handles the SDL Touch Event to keep track of pointer status and returns the appropriate
- * Android MotionEvent according to this events status
- *
- * @param touchType The SDL TouchType that was received from the module
- * @param touchEvent The SDL TouchEvent that was received from the module
- * @return the correct native Android MotionEvent action to dispatch
- */
- synchronized int getMotionEventAction(TouchType touchType, TouchEvent touchEvent) {
- eventTime = 0;
- int motionEventAction = -1;
- switch (touchType) {
- case BEGIN:
- if (pointers.size() == 0) {
- //The motion event has just begun
- motionEventAction = MotionEvent.ACTION_DOWN;
- downTime = SystemClock.uptimeMillis();
- downTimeOnHMI = touchEvent.getTimestamps().get(touchEvent.getTimestamps().size() - 1);
- eventTime = downTime;
- } else {
- motionEventAction = MotionEvent.ACTION_POINTER_DOWN | pointers.size() << MotionEvent.ACTION_POINTER_INDEX_SHIFT;
- eventTime = downTime + touchEvent.getTimestamps().get(touchEvent.getTimestamps().size() - 1) - downTimeOnHMI;
- }
- pointers.add(new Pointer(touchEvent.getId()));
- break;
- case MOVE:
- motionEventAction = MotionEvent.ACTION_MOVE;
- eventTime = downTime + touchEvent.getTimestamps().get(touchEvent.getTimestamps().size() - 1) - downTimeOnHMI;
- break;
- case END:
- if(pointers.size() <= 1){
- //The motion event has just ended
- motionEventAction = MotionEvent.ACTION_UP;
- } else {
- int pointerIndex = pointers.indexOf(getPointerById(touchEvent.getId()));
- if (pointerIndex != -1) {
- motionEventAction = MotionEvent.ACTION_POINTER_UP | pointerIndex << MotionEvent.ACTION_POINTER_INDEX_SHIFT;
- } else {
- motionEventAction = MotionEvent.ACTION_UP;
- }
- }
- eventTime = downTime + touchEvent.getTimestamps().get(touchEvent.getTimestamps().size() - 1) - downTimeOnHMI;
- break;
- case CANCEL:
- //Assuming this cancels the entire event
- motionEventAction = MotionEvent.ACTION_CANCEL;
- eventTime = downTime + touchEvent.getTimestamps().get(touchEvent.getTimestamps().size() - 1) - downTimeOnHMI;
- break;
- default:
- break;
- }
- return motionEventAction;
- }
-
- Pointer getPointerById(int id) {
- if (pointers != null && !pointers.isEmpty()) {
- for (Pointer pointer : pointers) {
- if (pointer.id == id) {
- return pointer;
- }
- }
- }
- return null;
- }
-
- Pointer getPointerByIndex(int index) {
- return pointers.get(index);
- }
-
- void removePointerById(int id) {
- pointers.remove(getPointerById(id));
- }
- }
-
-} // 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
deleted file mode 100644
index 5240c4813..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBuilder.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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
deleted file mode 100644
index 6e76db82a..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyConfigurationResources.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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
deleted file mode 100644
index 9b6f0d971..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/Version.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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
index 0323beb21..2e1ac540c 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
@@ -1,57 +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.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java b/android/sdl_android/src/main/java/com/smartdevicelink/session/SdlSession.java
index f4bdb7136..f7c1e18d6 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/session/SdlSession.java
@@ -30,26 +30,18 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-package com.smartdevicelink.SdlConnection;
+package com.smartdevicelink.session;
import android.content.Context;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.protocol.ProtocolMessage;
+import com.smartdevicelink.protocol.ISdlServiceListener;
import com.smartdevicelink.protocol.SdlPacket;
import com.smartdevicelink.protocol.SdlProtocol;
import com.smartdevicelink.protocol.SdlProtocolBase;
import com.smartdevicelink.protocol.enums.SessionType;
-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.streaming.AbstractPacketizer;
-import com.smartdevicelink.streaming.IStreamListener;
-import com.smartdevicelink.streaming.StreamPacketizer;
-import com.smartdevicelink.streaming.video.RTPH264Packetizer;
-import com.smartdevicelink.streaming.video.VideoStreamingParameters;
import com.smartdevicelink.transport.MultiplexTransportConfig;
import com.smartdevicelink.transport.TCPTransportConfig;
import com.smartdevicelink.transport.enums.TransportType;
@@ -57,10 +49,10 @@ import com.smartdevicelink.util.DebugTool;
import com.smartdevicelink.util.MediaStreamingStatus;
import com.smartdevicelink.util.Version;
-import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.concurrent.CopyOnWriteArrayList;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class SdlSession extends BaseSdlSession {
private static final String TAG = "SdlSession";
@@ -106,7 +98,8 @@ public class SdlSession extends BaseSdlSession {
}
// If requiresAudioSupport is false, or a supported audio output device is available
- return !requiresAudioSupport || mediaStreamingStatus.isAudioOutputAvailable();
+ boolean isAudioOutputAvailable = mediaStreamingStatus != null && mediaStreamingStatus.isAudioOutputAvailable();
+ return !requiresAudioSupport || isAudioOutputAvailable;
}
@@ -178,13 +171,8 @@ public class SdlSession extends BaseSdlSession {
@Override
public void onServiceEnded(SdlPacket packet, SessionType serviceType, int sessionID) {
-
if (SessionType.RPC.equals(serviceType)) {
this.sessionListener.onSessionEnded(sessionID);
- } else if (SessionType.NAV.equals(serviceType)) {
- stopVideoStream();
- } else if (SessionType.PCM.equals(serviceType)) {
- stopAudioStream();
}
if (serviceListeners != null && serviceListeners.containsKey(serviceType)) {
@@ -198,12 +186,6 @@ public class SdlSession extends BaseSdlSession {
@Override
public void onServiceError(SdlPacket packet, SessionType serviceType, int sessionID, String error) {
- if (SessionType.NAV.equals(serviceType)) {
- stopVideoStream();
- } else if (SessionType.PCM.equals(serviceType)) {
- stopAudioStream();
- }
-
if (serviceListeners != null && serviceListeners.containsKey(serviceType)) {
CopyOnWriteArrayList<ISdlServiceListener> listeners = serviceListeners.get(serviceType);
for (ISdlServiceListener listener : listeners) {
@@ -215,86 +197,4 @@ public class SdlSession extends BaseSdlSession {
@Override
public void onAuthTokenReceived(String authToken) {/* Do nothing */ }
- /* ***********************************************************************************************************************************************************************
- * ***************************************************************** Fix after initial refactor *********************************************************************************
- *************************************************************************************************************************************************************************/
- //FIXME there is a lot of spaghetti code here that needs to be addressed. For first refactor the
- // the goal is to only refactor SdlSession. Another PR should be opened to fix all the packetizer
- // classes and method calls.
-
- //FIXME Move this logic to the related streaming manager
- private AbstractPacketizer videoPacketizer;
- private StreamPacketizer audioPacketizer;
-
- IStreamListener streamListener = new IStreamListener() {
- @Override
- public void sendStreamPacket(ProtocolMessage pm) {
- sendMessage(pm);
- }
- };
-
- private VideoStreamingProtocol getAcceptedProtocol() {
- if (acceptedVideoParams != null) {
- VideoStreamingFormat format = acceptedVideoParams.getFormat();
- if (format != null && format.getProtocol() != null) {
- return format.getProtocol();
- }
- }
- //Returns default protocol if none are found
- return new VideoStreamingParameters().getFormat().getProtocol();
-
- }
-
- public IVideoStreamListener startVideoStream() {
- VideoStreamingProtocol protocol = getAcceptedProtocol();
- try {
- switch (protocol) {
- case RAW: {
- videoPacketizer = new StreamPacketizer(streamListener, null, SessionType.NAV, (byte) this.sessionId, this);
- videoPacketizer.start();
- return (IVideoStreamListener) videoPacketizer;
- }
- case RTP: {
- //FIXME why is this not an extension of StreamPacketizer?
- videoPacketizer = new RTPH264Packetizer(streamListener, SessionType.NAV, (byte) this.sessionId, this);
- videoPacketizer.start();
- return (IVideoStreamListener) videoPacketizer;
- }
- default:
- DebugTool.logError(TAG, "Protocol " + protocol + " is not supported.");
- return null;
- }
- } catch (IOException e) {
- return null;
- }
- }
-
- public IAudioStreamListener startAudioStream() {
- try {
- audioPacketizer = new StreamPacketizer(streamListener, null, SessionType.PCM, (byte) this.sessionId, this);
- audioPacketizer.start();
- return audioPacketizer;
- } catch (IOException e) {
- return null;
- }
-
- }
-
-
- public boolean stopVideoStream() {
- if (videoPacketizer != null) {
- videoPacketizer.stop();
- return true;
- }
- return false;
- }
-
- public boolean stopAudioStream() {
- if (audioPacketizer != null) {
- audioPacketizer.stop();
- return true;
- }
- return false;
- }
-
}
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
index accb59948..7bd091596 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java
@@ -31,12 +31,14 @@
*/
package com.smartdevicelink.streaming;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import androidx.annotation.RestrictTo;
+
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.managers.CompletionListener;
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.streaming.audio.IAudioStreamListener;
+import com.smartdevicelink.streaming.video.IVideoStreamListener;
import com.smartdevicelink.util.DebugTool;
import java.io.IOException;
@@ -45,6 +47,7 @@ import java.nio.ByteBuffer;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class StreamPacketizer extends AbstractPacketizer implements IVideoStreamListener, IAudioStreamListener, Runnable{
public final static String TAG = "StreamPacketizer";
@@ -65,14 +68,13 @@ public class StreamPacketizer extends AbstractPacketizer implements IVideoStream
// 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 final Object mPauseLock = new Object();
private boolean mPaused;
private boolean isServiceProtected = false;
private BlockingQueue<ByteBufferWithListener> 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) {
@@ -84,7 +86,7 @@ public class StreamPacketizer extends AbstractPacketizer implements IVideoStream
bufferSize = BUFF_READ_SIZE;
buffer = new byte[bufferSize];
}
- mOutputQueue = new LinkedBlockingQueue<ByteBufferWithListener>(MAX_QUEUE_SIZE / bufferSize);
+ mOutputQueue = new LinkedBlockingQueue<>(MAX_QUEUE_SIZE / bufferSize);
}
public void start() throws IOException {
@@ -155,7 +157,7 @@ public class StreamPacketizer extends AbstractPacketizer implements IVideoStream
}
while (frame.hasRemaining()) {
- int len = frame.remaining() > bufferSize ? bufferSize : frame.remaining();
+ int len = Math.min(frame.remaining(), bufferSize);
ProtocolMessage pm = new ProtocolMessage();
pm.setSessionID(_rpcSessionID);
@@ -237,17 +239,6 @@ public class StreamPacketizer extends AbstractPacketizer implements IVideoStream
/**
* Called by the app.
*
- * @see IAudioStreamListener#sendAudio(ByteBuffer, long)
- */
- @Deprecated
- @Override
- public void sendAudio(ByteBuffer data, long presentationTimeUs) {
- sendByteBufferData(data, null);
- }
-
- /**
- * Called by the app.
- *
* @see IAudioStreamListener#sendAudio(ByteBuffer, long, CompletionListener)
*/
@Override
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
deleted file mode 100644
index 5d32aa391..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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.PutFile;
-import com.smartdevicelink.proxy.rpc.PutFileResponse;
-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;
-
-@Deprecated
-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/android/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 cdb80ef1e..e22fbb9c6 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/streaming/video/SdlRemoteDisplay.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/streaming/video/SdlRemoteDisplay.java
@@ -51,7 +51,7 @@ import java.lang.reflect.Constructor;
import java.util.concurrent.Callable;
/**
- * SdlRemoteDisplay is an abstract class that should be extended by developers to creat their remote displays.
+ * SdlRemoteDisplay is an abstract class that should be extended by developers to create their remote displays.
* All logic for UI events can be stored in their extension.
*
* <br><br> <b>NOTE:</b> When the UI changes (buttons appear, layouts change, etc) the developer should call {@link #invalidate()} to alert any
@@ -64,8 +64,8 @@ public abstract class SdlRemoteDisplay extends Presentation {
protected Window w;
protected View mainView;
- protected Handler handler = new Handler();
- protected Handler uiHandler = new Handler(Looper.getMainLooper());
+ protected final Handler handler = new Handler();
+ protected final Handler uiHandler = new Handler(Looper.getMainLooper());
protected Callback callback;
public SdlRemoteDisplay(Context context, Display display) {
@@ -95,7 +95,7 @@ public abstract class SdlRemoteDisplay extends Presentation {
handler.removeCallbacks(mStartRefreshTaskCallback);
}
- protected Runnable mStartRefreshTaskCallback = new Runnable() {
+ protected final Runnable mStartRefreshTaskCallback = new Runnable() {
public void run() {
if(mainView == null){
mainView = w.getDecorView().findViewById(android.R.id.content);
@@ -108,7 +108,6 @@ public abstract class SdlRemoteDisplay extends Presentation {
}
};
- @SuppressWarnings("unused")
public View getMainView(){
if(mainView == null){
mainView = w.getDecorView().findViewById(android.R.id.content);
@@ -116,7 +115,6 @@ public abstract class SdlRemoteDisplay extends Presentation {
return this.mainView;
}
- @SuppressWarnings("unused")
public void invalidate(){
// let listeners know the view has been invalidated
if(callback != null){
@@ -152,13 +150,13 @@ public abstract class SdlRemoteDisplay extends Presentation {
}
public static class Creator implements Callable<Boolean> {
- private Context context;
- private Display mDisplay;
+ private final Context context;
+ private final Display mDisplay;
boolean presentationShowError = false;
SdlRemoteDisplay remoteDisplay;
- Class<? extends SdlRemoteDisplay> remoteDisplayClass;
- private Handler uiHandler = new Handler(Looper.getMainLooper());
- private Callback callback;
+ final Class<? extends SdlRemoteDisplay> remoteDisplayClass;
+ private final Handler uiHandler = new Handler(Looper.getMainLooper());
+ private final Callback callback;
public Creator(Context context, Display display, SdlRemoteDisplay remoteDisplay, Class<? extends SdlRemoteDisplay> remoteDisplayClass, Callback callback){
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
index 584b388ef..5f2452125 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/trace/TraceDeviceInfo.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/trace/TraceDeviceInfo.java
@@ -29,9 +29,6 @@
* 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;
@@ -145,9 +142,8 @@ public class TraceDeviceInfo {
.getBondedDevices();
StringBuilder write = new StringBuilder("<btpairs>");
- Iterator<BluetoothDevice> iter = btDevices.iterator();
- while (iter.hasNext()) {
- write.append(SdlTrace.getBTDeviceInfo(iter.next()));
+ for (BluetoothDevice btDevice : btDevices) {
+ write.append(SdlTrace.getBTDeviceInfo(btDevice));
}
write.append("</btpairs>");
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
deleted file mode 100644
index 3b4123b3a..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/BTTransportConfig.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBaseTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBaseTransport.java
index 10c1c9880..a8eecd484 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBaseTransport.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBaseTransport.java
@@ -61,8 +61,6 @@ public abstract class MultiplexBaseTransport {
protected final TransportType transportType;
protected TransportRecord transportRecord;
- @Deprecated
- public static String currentlyConnectedDevice = null;
protected String connectedDeviceName = null;
public String connectedDeviceAddress = null;
@@ -126,7 +124,7 @@ public abstract class MultiplexBaseTransport {
}
protected abstract void stop(int state);
- protected void stop(int state, byte error) {};
+ protected void stop(int state, byte error) {}
public abstract void write(byte[] out, int offset, int count);
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
index 01251f61f..7995b7bde 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java
@@ -29,6 +29,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
+
import androidx.annotation.RequiresPermission;
import com.smartdevicelink.protocol.SdlPacket;
@@ -63,7 +64,7 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
// 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();;
+ private final Object THREAD_LOCK = new Object();
protected static final String SHARED_PREFS = "sdl.bluetoothprefs";
@@ -74,9 +75,8 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
private ConnectThread mConnectThread;
private ConnectedThread mConnectedThread;
private ConnectedWriteThread mConnectedWriteThread;
- private int mBluetoothLevel = 0;
Handler timeOutHandler;
- Runnable socketRunable;
+ Runnable socketRunnable;
boolean keepSocketAlive = true;
/**
@@ -85,43 +85,6 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
*/
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)
@@ -348,7 +311,7 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
private void timerDelayRemoveDialog(final BluetoothSocket sock){
timeOutHandler = new Handler();
- socketRunable = new Runnable() {
+ socketRunnable = new Runnable() {
public void run() {
//Log.e(TAG, "BLUETOOTH SOCKET CONNECT TIMEOUT - ATTEMPT TO CLOSE SOCKET");
try {
@@ -358,7 +321,7 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
}
}
};
- timeOutHandler.postDelayed(socketRunable, MS_TILL_TIMEOUT);
+ timeOutHandler.postDelayed(socketRunnable, MS_TILL_TIMEOUT);
}
@@ -370,7 +333,7 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
*/
private class AcceptThread extends Thread {
// The local server socket
- private String mSocketType;
+ private final String mSocketType;
final BluetoothServerSocket mmServerSocket;
@SuppressLint("NewApi")
@@ -388,7 +351,7 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
} catch (IOException e) {
//Log.e(TAG, "Socket Type: " + mSocketType + "listen() failed", e);
MultiplexBluetoothTransport.this.stop(STATE_ERROR, REASON_SPP_ERROR);
- //Let's try to shut down this thead
+ //Let's try to shut down this thread
}catch(SecurityException e2){
//Log.e(TAG, "<LIVIO> Security Exception in Accept Thread - "+e2.toString());
interrupt();
@@ -407,7 +370,7 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
" BEGIN mAcceptThread" + this);
setName("AcceptThread" + mSocketType);
- BluetoothSocket socket = null;
+ BluetoothSocket socket;
int listenAttempts = 0;
// Listen to the server socket if we're not connected
@@ -491,8 +454,8 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
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());
+ //Log.d(TAG, "Attempting to connect to " + device.getName());
+ //Log.d(TAG, "UUID to connect to " + SERVER_UUID.toString());
}
@@ -501,7 +464,7 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
try{
mAdapter.cancelDiscovery();
}catch(SecurityException e2){
- DebugTool.logError(TAG, "Don't have required permision to cancel discovery. Moving on");
+ DebugTool.logError(TAG, "Don't have required permission to cancel discovery. Moving on");
}
}
@@ -515,169 +478,148 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
boolean success = false;
Looper.prepare();
- while(attemptCount < 5)
- {
+ 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);
- if(Looper.myLooper() != null){
- 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);
- if(Looper.myLooper() != null){
- Looper.myLooper().quit();
- }
- success=true;
- SdlRouterService.setBluetoothPrefs(2,SHARED_PREFS);
- break;
- }else{tryInsecure = true;}
- } catch (IOException io) {
- tryInsecure = true;
- DebugTool.logError(TAG, "createRfcommSocketToServiceRecord exception - " + io.toString());
- SdlRouterService.setBluetoothPrefs(0,SHARED_PREFS);
+ attemptCount++;
+ try {
+ // This is a blocking call and will only return on a
+ // successful connection or an exception
+ 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...");
+
+ try {
+ Method m = mmDevice.getClass().getMethod("createRfcommSocket", new Class[]{int.class});
+ //Log.i(TAG,"connecting using createRfcommSocket");
+ mmSocket = (BluetoothSocket) m.invoke(mmDevice, 1);
+ if (mmSocket != null) {
+ //Looper.prepare();
+ timerDelayRemoveDialog(mmSocket);
+ //Looper.loop();
+ mmSocket.connect();
+ timeOutHandler.removeCallbacks(socketRunnable);
+ if (Looper.myLooper() != null) {
+ Looper.myLooper().quit();
+ }
+ success = true;
+ break;
+ } else {
+ trySecure = true;
+ }
- } catch (Exception e){
+ } catch (Exception e) {
+ //Log.e(TAG,"createRfcommSocket exception - " + e.toString());
+ trySecure = true;
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e2) {
+ e2.printStackTrace();
+ }
+ }
+ if (trySecure) {
+ try {
+ //Log.i(TAG, "connecting using createRfcommSocketToServiceRecord ");
+ mmSocket = mmDevice.createRfcommSocketToServiceRecord(SERVER_UUID);
+ if (mmSocket != null) {
+ //Looper.prepare();
+ timerDelayRemoveDialog(mmSocket);
+ //Looper.loop();
+ mmSocket.connect();
+ timeOutHandler.removeCallbacks(socketRunnable);
+ if (Looper.myLooper() != null) {
+ Looper.myLooper().quit();
+ }
+ success = true;
+ break;
+ } else {
+ tryInsecure = true;
+ }
+ } catch (IOException io) {
+ tryInsecure = true;
+ DebugTool.logError(TAG, "createRfcommSocketToServiceRecord exception - " + io.toString());
+ } catch (Exception e) {
DebugTool.logError(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);
- if(Looper.myLooper() != null){
- 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);
- if(Looper.myLooper() != null){
- 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();
- DebugTool.logError(TAG,e.getClass().getSimpleName()
- + " caught connecting to the bluetooth socket: "
- + e.toString());
- try {
- mmSocket.close();
- } catch (IOException e2) {
- DebugTool.logError(TAG, "unable to close() socket during connection failure" + e2);
- }
- return;
- }
+ }
+ } else {
+ tryInsecure = true;
+ }
+
+ if (tryInsecure) {
+ // try again using insecure comm if available
+ try {
+ //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(socketRunnable);
+ if (Looper.myLooper() != null) {
+ Looper.myLooper().quit();
+ }
+ success = true;
+ tryInsecure = false;
+ break;
+ } catch (NoSuchMethodException ie) {
+ } catch (IllegalAccessException ie) {
+ } catch (InvocationTargetException ie) {
+ }
+ }
+ if (tryInsecure) {
+ // try again using insecure comm if available
+ try {
+ //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(socketRunnable);
+ if (Looper.myLooper() != null) {
+ Looper.myLooper().quit();
+ }
+ success = true;
+ break;
+ } catch (NoSuchMethodException ie) {
+ } catch (IllegalAccessException ie) {
+ } catch (InvocationTargetException ie) {
+ }
+ }
+ } catch (IOException e) {
+ connectionFailed();
+ DebugTool.logError(TAG, e.getClass().getSimpleName()
+ + " caught connecting to the bluetooth socket: "
+ + e.toString());
+ try {
+ mmSocket.close();
+ } catch (IOException e2) {
+ DebugTool.logError(TAG, "unable to close() socket during connection failure" + e2);
+ }
+ return;
+ }
}
// Reset the ConnectThread because we're done
- if(success)
- {
- synchronized (MultiplexBluetoothTransport.this) {
- mConnectThread = null;
- }
-
+ if (success) {
+ synchronized (MultiplexBluetoothTransport.this) {
+ mConnectThread = null;
+ }
- // Start the connected thread
-
- connected(mmSocket, mmDevice);
- }
- else
- {
+
+ // Start the connected thread
+
+ connected(mmSocket, mmDevice);
+ } else {
DebugTool.logError(TAG, "There was a problem opening up RFCOMM");
}
}
@@ -688,9 +630,8 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
mmSocket.close();
} catch (IOException e) {
// close() of connect socket failed
- }
- catch(NullPointerException e){
- //mSocket was pry never initialized
+ } catch (NullPointerException e) {
+ //mSocket was pry never initialized
}
}
}
@@ -761,7 +702,7 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
private class ConnectedThread extends Thread {
private final BluetoothSocket mmSocket;
private final InputStream mmInStream;
- SdlPsm psm;
+ final SdlPsm psm;
public ConnectedThread(BluetoothSocket socket) {
this.psm = new SdlPsm();
//Log.d(TAG, "Creating a Connected - Read Thread");
@@ -851,7 +792,7 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
Field[] f = bsSocket.getClass().getDeclaredFields();
//int channel = -1;
- BluetoothSocket mySocket = null;
+ BluetoothSocket mySocket;
for (Field field : f) {
if(field.getName().equals("mSocket")){
field.setAccessible(true);
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTcpTransport.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTcpTransport.java
index 50d6ba051..c640f67ba 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTcpTransport.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTcpTransport.java
@@ -70,7 +70,7 @@ public class MultiplexTcpTransport extends MultiplexBaseTransport {
private OutputStream mOutputStream = null;
private MultiplexTcpTransport.TcpTransportThread mThread = null;
private WriterThread writerThread;
- private Context mContext;
+ private final Context mContext;
public MultiplexTcpTransport(int port, String ipAddress, boolean autoReconnect, Handler handler, Context context) {
@@ -182,7 +182,7 @@ public class MultiplexTcpTransport extends MultiplexBaseTransport {
* Internal class that represents separate thread, that does actual work, related to connecting/reading/writing data
*/
private class TcpTransportThread extends Thread {
- SdlPsm psm;
+ final SdlPsm psm;
public TcpTransportThread(){
psm = new SdlPsm();
}
@@ -358,7 +358,7 @@ public class MultiplexTcpTransport extends MultiplexBaseTransport {
private class WriterThread extends Thread {
private boolean isHalted = false;
- private boolean mVerbose = false;
+ private final boolean mVerbose = false;
final BlockingQueue<OutPacket> packetQueue = new LinkedBlockingQueue<>();
@Override
@@ -433,9 +433,9 @@ public class MultiplexTcpTransport extends MultiplexBaseTransport {
}
private final class OutPacket{
- byte[] bytes;
- int count;
- int offset;
+ final byte[] bytes;
+ final int count;
+ final int offset;
OutPacket(byte[] bytes, int offset, int count){
this.bytes = bytes;
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
index 4d0ab0670..e2dd06521 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransportConfig.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexTransportConfig.java
@@ -67,8 +67,8 @@ public class MultiplexTransportConfig extends BaseTransportConfig{
*/
public static final int FLAG_MULTI_SECURITY_HIGH = 0x30;
- Context context;
- String appId;
+ final Context context;
+ final String appId;
ComponentName service;
int securityLevel;
@@ -143,7 +143,7 @@ public class MultiplexTransportConfig extends BaseTransportConfig{
}
/**
- * Get the securitly level that will be used to verify a router service before binding
+ * Get the security 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
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
index 42bbc29a4..e76f2180c 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexUsbTransport.java
@@ -205,7 +205,7 @@ public class MultiplexUsbTransport extends MultiplexBaseTransport{
}
private class ReaderThread extends Thread{
- SdlPsm psm;
+ final SdlPsm psm;
final InputStream inputStream;
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
index f86caa699..39f5909b5 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java
@@ -47,6 +47,7 @@ import android.os.AsyncTask;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
+
import androidx.annotation.NonNull;
import com.smartdevicelink.util.AndroidTools;
@@ -89,7 +90,7 @@ public class RouterServiceValidator {
private static final String JSON_RESPONSE_OBJECT_TAG = "response";
- private static final String JSON_RESONSE_APP_VERSIONS_TAG = "versionBlacklist";
+ private static final String JSON_RESPONSE_APP_VERSIONS_TAG = "versionBlacklist";
private static final String JSON_PUT_ARRAY_TAG = "installedApps";
private static final String JSON_APP_PACKAGE_TAG = "packageName";
@@ -112,7 +113,7 @@ public class RouterServiceValidator {
* 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_VERSION_CHECK = 0x03; //We use 3 because 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;
@@ -121,11 +122,10 @@ public class RouterServiceValidator {
private int flags = FLAG_DEBUG_NONE;
- private Context context= null;
+ private Context context;
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;
@@ -149,71 +149,6 @@ public class RouterServiceValidator {
}
/**
- * 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.
- *
- * Due to SDL 0220 proposal, we should use validateAsync always.
- * This function remains only for backward compatibility.
- */
- @Deprecated
- 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){
- DebugTool.logInfo(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;
- DebugTool.logWarning(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;
- }
-
- /**
* Asynchronously validate the target RouterService, which includes finding the right RouterService.
* @param callback: callback gets called when validation finishes.
*/
@@ -305,7 +240,7 @@ public class RouterServiceValidator {
* FindRouterTask: AsyncTask to find the connected RouterService.
*/
class FindRouterTask extends AsyncTask<Context, Void, ComponentName> {
- FindConnectedRouterCallback mCallback;
+ final FindConnectedRouterCallback mCallback;
final Handler mHandler = new Handler(Looper.getMainLooper());
final Integer TIMEOUT_MSEC = 10000; // 10 sec
@@ -421,7 +356,6 @@ public class RouterServiceValidator {
|| (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));
}
@@ -467,17 +401,18 @@ public class RouterServiceValidator {
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
//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);
+ if (manager != null) {
+ 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;
}
@@ -549,7 +484,7 @@ public class RouterServiceValidator {
JSONObject trustedApps = stringToJson(getTrustedList(context));
JSONArray versions;
- JSONObject app = null;
+ JSONObject app;
try {
app = trustedApps.getJSONObject(packageName);
@@ -563,7 +498,7 @@ public class RouterServiceValidator {
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;}
+ try { versions = app.getJSONArray(JSON_RESPONSE_APP_VERSIONS_TAG); } catch (JSONException e) { e.printStackTrace();return false;}
return verifyVersion(version, versions);
}
@@ -595,12 +530,12 @@ public class RouterServiceValidator {
* @return
*/
private static List<SdlApp> findAllSdlApps(Context context){
- List<SdlApp> apps = new ArrayList<SdlApp>();
+ List<SdlApp> apps = new ArrayList<>();
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
+ //We want to sort our list so that we know it's the same every time
Collections.sort(infoList,new Comparator<ResolveInfo>() {
@Override
public int compare(ResolveInfo lhs, ResolveInfo rhs) {
@@ -638,11 +573,6 @@ public class RouterServiceValidator {
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;
@@ -653,7 +583,7 @@ public class RouterServiceValidator {
}
return false;
}
-
+
pendingListRefresh = true;
//Might want to store a flag letting this class know a request is currently pending
StringBuilder builder = new StringBuilder();
@@ -730,11 +660,13 @@ public class RouterServiceValidator {
*/
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;
- }
- }
+ if (manager != null) {
+ for (RunningServiceInfo serviceInfo : manager.getRunningServices(Integer.MAX_VALUE)) {
+ if (serviceInfo.service.equals(service)) {
+ return true;
+ }
+ }
+ }
return false;
}
@@ -773,9 +705,9 @@ public class RouterServiceValidator {
return prefAdd.commit();
}
/******************************************************************
- *
+ *
* Saving the list for later!!!
- *
+ *
******************************************************************/
/**
@@ -866,8 +798,8 @@ public class RouterServiceValidator {
* Class that holds all the info we want to send/receive from the validation server
*/
public static class SdlApp{
- String packageName;
- int versionCode;
+ final String packageName;
+ final int versionCode;
SdlApp(String packageName, int versionCode){
this.packageName = packageName;
@@ -875,7 +807,7 @@ public class RouterServiceValidator {
}
}
- public static enum TrustedAppStore{
+ public enum TrustedAppStore{
PLAY_STORE("com.android.vending"),
AMAZON("com.amazon.venezia"),
XIAOMI("com.xiaomi.market"),
@@ -885,7 +817,7 @@ public class RouterServiceValidator {
HIAPK("com.hiapk.marketpho"),
;
- String packageString;
+ final String packageString;
private TrustedAppStore(String packageString){
this.packageString = packageString;
}
@@ -900,8 +832,8 @@ public class RouterServiceValidator {
return false;
}
TrustedAppStore[] stores = TrustedAppStore.values();
- for(int i =0; i<stores.length; i++){
- if(packageString.equalsIgnoreCase(stores[i].packageString)){
+ for (TrustedAppStore store : stores) {
+ if (packageString.equalsIgnoreCase(store.packageString)) {
return true;
}
}
@@ -913,8 +845,8 @@ public class RouterServiceValidator {
* 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);
+ public interface TrustedListCallback{
+ 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
index 4ed1b85f4..3229d4abd 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java
@@ -41,17 +41,14 @@ import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ResolveInfo;
import android.hardware.usb.UsbManager;
import android.os.Build;
-import android.os.Debug;
import android.os.Looper;
import android.os.Parcelable;
import android.util.AndroidRuntimeException;
-import com.smartdevicelink.R;
+import androidx.annotation.CallSuper;
+
import com.smartdevicelink.transport.RouterServiceValidator.TrustedListCallback;
import com.smartdevicelink.transport.enums.TransportType;
import com.smartdevicelink.transport.utl.SdlDeviceListener;
@@ -96,6 +93,7 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
}
@Override
+ @CallSuper
public void onReceive(Context context, Intent intent) {
//Log.i(TAG, "Sdl Receiver Activated");
final String action = intent.getAction();
@@ -113,14 +111,14 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
}
if(!(action.equalsIgnoreCase(BluetoothDevice.ACTION_ACL_CONNECTED)
- || action.equalsIgnoreCase(USBTransport.ACTION_USB_ACCESSORY_ATTACHED)
+ || action.equalsIgnoreCase(TransportConstants.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)){
+ if(action.equalsIgnoreCase(TransportConstants.ACTION_USB_ACCESSORY_ATTACHED)){
DebugTool.logInfo(TAG,"Usb connected");
intent.setAction(null);
onSdlEnabled(context, intent);
@@ -159,7 +157,7 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
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());
+ //Log.v(TAG, "SDL enabled by router service from " + packageName + " component 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
@@ -237,7 +235,7 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
context.startService(serviceIntent);
} else {
serviceIntent.putExtra(FOREGROUND_EXTRA, true);
- DebugTool.logInfo("Attempting to startForegroundService - " + System.currentTimeMillis());
+ DebugTool.logInfo(TAG, "Attempting to startForegroundService - " + System.currentTimeMillis());
setForegroundExceptionHandler(); //Prevent ANR in case the OS takes too long to start the service
context.startForegroundService(serviceIntent);
@@ -258,7 +256,7 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
new ServiceFinder(context, context.getPackageName(), new ServiceFinder.ServiceFinderCallback() {
@Override
public void onComplete(Vector<ComponentName> routerServices) {
- runningBluetoothServicePackage = new Vector<ComponentName>();
+ runningBluetoothServicePackage = new Vector<>();
runningBluetoothServicePackage.addAll(routerServices);
if (runningBluetoothServicePackage.isEmpty()) {
//If there isn't a service running we should try to start one
@@ -297,7 +295,7 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
} else { //There are currently running services
if(DebugTool.isDebugEnabled()){
for(ComponentName service : runningBluetoothServicePackage){
- DebugTool.logInfo("Currently running router service: " + service.getPackageName());
+ DebugTool.logInfo(TAG, "Currently running router service: " + service.getPackageName());
}
}
if (altTransportWake) {
@@ -347,6 +345,7 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
if (e != null
&& e instanceof AndroidRuntimeException
&& "android.app.RemoteServiceException".equals(e.getClass().getName()) //android.app.RemoteServiceException is a private class
+ && e.getMessage() != null
&& e.getMessage().contains("SdlRouterService")) {
DebugTool.logInfo(TAG, "Handling failed startForegroundService call");
@@ -372,13 +371,15 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
return false;
}
if (runningBluetoothServicePackage == null) {
- runningBluetoothServicePackage = new Vector<ComponentName>();
+ runningBluetoothServicePackage = new Vector<>();
} else {
runningBluetoothServicePackage.clear();
}
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
- manager.getRunningAppProcesses();
- List<RunningServiceInfo> runningServices = null;
+ if (manager != null) {
+ manager.getRunningAppProcesses();
+ }
+ List<RunningServiceInfo> runningServices;
try {
runningServices = manager.getRunningServices(Integer.MAX_VALUE);
} catch (NullPointerException e) {
@@ -447,7 +448,7 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
ServiceFinder finder = new ServiceFinder(context, context.getPackageName(), new ServiceFinder.ServiceFinderCallback() {
@Override
public void onComplete(Vector<ComponentName> routerServices) {
- runningBluetoothServicePackage = new Vector<ComponentName>();
+ runningBluetoothServicePackage = new Vector<>();
runningBluetoothServicePackage.addAll(routerServices);
requestTransportStatus(context,null,true,false);
}
@@ -462,11 +463,6 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
* @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){
@@ -475,7 +471,7 @@ public abstract class SdlBroadcastReceiver extends BroadcastReceiver{
return;
}
if((!lookForServices || isRouterServiceRunning(context)) && !runningBluetoothServicePackage.isEmpty()){ //So there is a service up, let's see if it's connected
- final ConcurrentLinkedQueue<ComponentName> list = new ConcurrentLinkedQueue<ComponentName>(runningBluetoothServicePackage);
+ final ConcurrentLinkedQueue<ComponentName> list = new ConcurrentLinkedQueue<>(runningBluetoothServicePackage);
final SdlRouterStatusProvider.ConnectedStatusCallback sdlBrCallback = new SdlRouterStatusProvider.ConnectedStatusCallback() {
@Override
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
index 2fde0e817..8f569e7a2 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterService.java
@@ -70,12 +70,13 @@ import android.os.Parcel;
import android.os.ParcelFileDescriptor;
import android.os.Parcelable;
import android.os.RemoteException;
-import androidx.annotation.NonNull;
-import androidx.core.app.NotificationCompat;
import android.util.AndroidRuntimeException;
import android.util.SparseArray;
import android.util.SparseIntArray;
+import androidx.annotation.NonNull;
+import androidx.core.app.NotificationCompat;
+
import com.smartdevicelink.R;
import com.smartdevicelink.marshal.JsonRPCMarshaller;
import com.smartdevicelink.protocol.BinaryFrameHeader;
@@ -152,18 +153,12 @@ public class SdlRouterService extends Service{
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_WRITE = 3;
public static final int MESSAGE_DEVICE_NAME = 4;
public static final int MESSAGE_LOG = 5;
@@ -1023,7 +1018,6 @@ public class SdlRouterService extends Service{
return true;
}
- @SuppressWarnings("unused")
private void pingClients(){
Message message = Message.obtain();
DebugTool.logInfo(TAG, "Pinging "+ registeredApps.size()+ " clients");
@@ -1229,6 +1223,7 @@ public class SdlRouterService extends Service{
if (e != null
&& e instanceof AndroidRuntimeException
&& "android.app.RemoteServiceException".equals(e.getClass().getName()) //android.app.RemoteServiceException is a private class
+ && e.getMessage() != null
&& e.getMessage().contains("invalid channel for service notification")) { //This is the message received in the exception for notification channel issues
// Set the flag to not delete the notification channel to avoid this exception in the future
@@ -1442,7 +1437,6 @@ public class SdlRouterService extends Service{
}
@SuppressLint("NewApi")
- @SuppressWarnings("deprecation")
private void enterForeground(String content, long chronometerLength, boolean ongoing) {
DebugTool.logInfo(TAG, "Attempting to enter the foreground - " + System.currentTimeMillis());
@@ -1610,12 +1604,6 @@ public class SdlRouterService extends Service{
*********************************************** Helper Methods **************************************************************
****************************************************************************************************************************************/
- @SuppressWarnings("SameReturnValue")
- @Deprecated
- public String getConnectedDeviceName(){
- return null;
- }
-
private ArrayList<TransportRecord> getConnectedTransports(){
ArrayList<TransportRecord> connected = new ArrayList<>();
if(bluetoothTransport != null && bluetoothTransport.isConnected()){
@@ -1733,11 +1721,6 @@ public class SdlRouterService extends Service{
}
}
- @Deprecated
- public void onTransportConnected(final TransportType type){
- onTransportConnected(new TransportRecord(type,null));
- }
-
public void onTransportConnected(final TransportRecord record){
cancelForegroundTimeOut();
enterForeground(createConnectedNotificationText(),0,true);
@@ -1798,11 +1781,6 @@ public class SdlRouterService extends Service{
}
- @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.
@@ -1911,16 +1889,6 @@ public class SdlRouterService extends Service{
}
}
- @Deprecated
- public void onTransportError(TransportType transportType){
- onTransportError(new TransportRecord(transportType,null), null);
- }
-
- @Deprecated
- public void onTransportError(TransportRecord record) {
- onTransportError(record, null);
- }
-
public void onTransportError(TransportRecord transport, Bundle errorBundle){
switch (transport.getType()){
case BLUETOOTH:
@@ -2012,7 +1980,7 @@ public class SdlRouterService extends Service{
}
}
- @SuppressWarnings("unused") //The return false after the packet null check is not dead code. Read the getByteArray method from bundle
+ //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;
@@ -2385,7 +2353,7 @@ public class SdlRouterService extends Service{
* And start SDL
* @return a boolean if a connection was attempted
*/
- @SuppressWarnings({"MissingPermission", "unused"})
+ @SuppressWarnings({"MissingPermission"})
public synchronized boolean bluetoothQuerryAndConnect(){
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
if(adapter != null && adapter.isEnabled()){
@@ -2429,29 +2397,6 @@ public class SdlRouterService extends Service{
//**************************************************************************************************************************************
//********************************************************* 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) {
- DebugTool.logWarning(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
@@ -2756,7 +2701,6 @@ public class SdlRouterService extends Service{
// *********************************************************** UTILITY ****************************************************************
//*****************************************************************************************************************************************/
- @SuppressWarnings("unused")
private void debugPacket(byte[] bytes){
//DEBUG
@@ -2940,7 +2884,7 @@ public class SdlRouterService extends Service{
* @deprecated Move to the new version checking system with meta-data
*
*/
- @SuppressWarnings({"unused", "DeprecatedIsStillUsed"})
+ @SuppressWarnings({"DeprecatedIsStillUsed"})
@Deprecated
static class LocalRouterService implements Parcelable{
Intent launchIntent = null;
@@ -3075,24 +3019,6 @@ public class SdlRouterService extends Service{
/**
* 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
*/
@@ -3184,7 +3110,6 @@ public class SdlRouterService extends Service{
}
}
- @SuppressWarnings("unused")
public void clearSessionIds(){
this.sessionIds.clear();
}
@@ -3373,11 +3298,6 @@ public class SdlRouterService extends Service{
}
}
- @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();
@@ -3509,17 +3429,11 @@ public class SdlRouterService extends Service{
private static final int DELAY_COEF = 1;
private static final int SIZE_COEF = 1;
- private byte[] bytesToWrite = null;
+ private byte[] bytesToWrite;
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();
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
index 6a7230fcd..0640017d5 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterStatusProvider.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlRouterStatusProvider.java
@@ -54,16 +54,16 @@ public class SdlRouterStatusProvider {
private static final String TAG = "SdlRouterStateProvider";
- private Context context = null;
+ private Context context;
private boolean isBound = false;
- ConnectedStatusCallback cb = null;
+ ConnectedStatusCallback cb;
Messenger routerServiceMessenger = null;
- private ComponentName routerService = null;
+ private ComponentName routerService;
private int flags = 0;
final Messenger clientMessenger;
- private ServiceConnection routerConnection= new ServiceConnection() {
+ private final ServiceConnection routerConnection= new ServiceConnection() {
public void onServiceConnected(ComponentName className, IBinder service) {
DebugTool.logInfo(TAG, "Bound to service " + className.toString());
@@ -167,7 +167,7 @@ public class SdlRouterStatusProvider {
public ClientHandler(SdlRouterStatusProvider provider){
super(Looper.getMainLooper());
- this.provider = new WeakReference<SdlRouterStatusProvider>(provider);
+ this.provider = new WeakReference<>(provider);
}
@Override
@@ -183,10 +183,10 @@ public class SdlRouterStatusProvider {
break;
}
}
- };
+ }
public interface ConnectedStatusCallback{
- public void onConnectionStatusUpdate(boolean connected, ComponentName service, Context context);
+ 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
deleted file mode 100644
index 32fe26fee..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlTransport.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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 TAG = "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(TAG, 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(TAG, 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(TAG, 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
deleted file mode 100644
index cc123d041..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransport.java
+++ /dev/null
@@ -1,557 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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.os.NetworkOnMainThreadException;
-
-import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.exception.SdlExceptionCause;
-import com.smartdevicelink.protocol.SdlPacket;
-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.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 {
- private static final String TAG = "TCPTransport";
- /**
- * 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 packet The SdlPacket that should be sent over the transport
- * @return True if data was sent successfully, False otherwise
- */
- @SuppressLint("DefaultLocale")
- @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) {
- DebugTool.logInfo(TAG, message);
- }
-
- /**
- * Internal method for logging error messages
- * @param message Message to log
- */
- protected void logError(String message) {
- DebugTool.logError(TAG, message);
- }
-
- /**
- * Internal method for logging warning messages
- * @param message Message to log
- */
- protected void logWarning(String message) {
- DebugTool.logWarning(TAG, 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) {
- DebugTool.logError(TAG, 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
- */
- @SuppressLint("DefaultLocale")
- 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/TCPTransportManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransportManager.java
index aca8789ac..4381b97c6 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransportManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/TCPTransportManager.java
@@ -14,9 +14,9 @@ public class TCPTransportManager extends TransportManagerBase{
private static final String TAG = "TCPTransportManager";
- private TCPHandler tcpHandler;
+ private final TCPHandler tcpHandler;
private MultiplexTcpTransport transport;
- private TCPTransportConfig config;
+ private final TCPTransportConfig config;
public TCPTransportManager(TCPTransportConfig config, TransportEventListener transportEventListener){
super(config,transportEventListener);
@@ -37,7 +37,7 @@ public class TCPTransportManager extends TransportManagerBase{
transport.stop();
}
- @Override
+ @Deprecated
public void resetSession() {
if(transport != null){
transport.stop();
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
index acf84462f..dd887b6d4 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportBroker.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportBroker.java
@@ -33,13 +33,10 @@
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;
@@ -49,6 +46,9 @@ import android.os.Parcelable;
import android.os.RemoteException;
import android.os.TransactionTooLargeException;
+import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.protocol.SdlPacket;
import com.smartdevicelink.transport.enums.TransportType;
import com.smartdevicelink.transport.utl.ByteAraryMessageAssembler;
@@ -62,9 +62,9 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
-import java.util.Locale;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class TransportBroker {
private static final String TAG = "SdlTransportBroker";
@@ -80,9 +80,9 @@ public class TransportBroker {
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 String appId;
+ private final String whereToReply;
+ private Context currentContext;
private final Object INIT_LOCK = new Object();
private final Object MESSAGE_SEND_LOCK = new Object();
@@ -92,7 +92,7 @@ public class TransportBroker {
boolean isBound = false, registeredWithRouterService = false;
private String routerPackage = null, routerClassName = null;
- private ComponentName routerService = null;
+ private ComponentName routerService;
private SdlPacket bufferedPacket = null;
@@ -100,7 +100,7 @@ public class TransportBroker {
private ServiceConnection routerConnection;
private int routerServiceVersion = 1;
- private int messagingVersion = MAX_MESSAGING_VERSION;
+ private final int messagingVersion = MAX_MESSAGING_VERSION;
private void initRouterConnection() {
routerConnection = new ServiceConnection() {
@@ -180,11 +180,11 @@ public class TransportBroker {
* Handler of incoming messages from service.
*/
static class ClientHandler extends Handler {
- ClassLoader loader;
+ final ClassLoader loader;
final WeakReference<TransportBroker> provider;
public ClientHandler(TransportBroker provider) {
- this.provider = new WeakReference<TransportBroker>(provider);
+ this.provider = new WeakReference<>(provider);
loader = getClass().getClassLoader();
}
@@ -235,7 +235,6 @@ public class TransportBroker {
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:
@@ -243,7 +242,7 @@ public class TransportBroker {
DebugTool.logWarning(TAG, "Registration denied from router service. Reason - " + msg.arg1);
break;
}
- ;
+
break;
@@ -251,7 +250,6 @@ public class TransportBroker {
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
DebugTool.logWarning(TAG, "Unregister request denied from router service. Reason - " + msg.arg1);
//Do we care?
@@ -263,7 +261,7 @@ public class TransportBroker {
DebugTool.logWarning(TAG, "Received packet message from router service with no bundle");
return;
}
- //So the intent has a packet with it. PEFRECT! Let's send it through the library
+ //So the intent has a packet with it. PERFECT! 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)) {
@@ -310,10 +308,8 @@ public class TransportBroker {
broker.bufferedPacket = null;
}
}
- //}
- //}
} else {
- DebugTool.logWarning(TAG, "Flase positive packet reception");
+ DebugTool.logWarning(TAG, "False positive packet reception");
}
break;
case TransportConstants.HARDWARE_CONNECTION_EVENT:
@@ -356,7 +352,7 @@ public class TransportBroker {
}
/**
- * Handle a potential connection event. This will adapt legacy router service implementaions
+ * Handle a potential connection event. This will adapt legacy router service implementations
* 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
@@ -393,25 +389,19 @@ public class TransportBroker {
@SuppressLint("SimpleDateFormat")
- public TransportBroker(Context context, String appId, ComponentName service) {
+ public TransportBroker(@NonNull Context context, @NonNull String appId, @NonNull ComponentName service) {
synchronized (INIT_LOCK) {
+ this.appId = appId;
+ currentContext = context;
+ this.routerService = service;
+
clientMessenger = new Messenger(new ClientHandler(this));
initRouterConnection();
- //So the user should have set the AppId, lets define where the intents need to be sent
+
+ //So the user should have set the AppId, lets define where the messages 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;
- currentContext = context;
- //Log.d(TAG, "Registering our reply receiver: " + whereToReply);
- this.routerService = service;
+ whereToReply = WHERE_TO_REPLY_PREFIX + appId + "." + timeStamp;
}
}
@@ -422,7 +412,7 @@ public class TransportBroker {
//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");
+ throw new IllegalStateException("This instance can't be started since it's local reference of context is null. Ensure when supplying a context to the TransportBroker that it is valid");
}
if (routerConnection == null) {
initRouterConnection();
@@ -479,31 +469,11 @@ public class TransportBroker {
public void onServiceUnregsiteredFromRouterService(int unregisterCode) {
}
- @Deprecated
- public void onHardwareDisconnected(TransportType type) {
- stop();
- }
public void onHardwareDisconnected(TransportRecord record, List<TransportRecord> connectedTransports) {
}
- /**
- * WILL NO LONGER BE CALLED
- *
- * @param type
- * @return
- */
- @Deprecated
- public boolean onHardwareConnected(TransportType type) {
- synchronized (INIT_LOCK) {
- if (routerServiceMessenger == null) {
- return false;
- }
- return true;
- }
- }
-
public boolean onHardwareConnected(List<TransportRecord> transports) {
synchronized (INIT_LOCK) {
if (routerServiceMessenger == null && transports != null && transports.size() > 0) {
@@ -525,31 +495,7 @@ public class TransportBroker {
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
+ public boolean sendPacketToRouterService(SdlPacket packet) { //We use ints because that is all that is supported by the output stream class
//Log.d(TAG,whereToReply + "Sending packet to router service");
if (routerServiceMessenger == null) {
@@ -617,16 +563,14 @@ public class TransportBroker {
}
//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
- DebugTool.logInfo(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();
+ DebugTool.logInfo(TAG, whereToReply + " has no router service reference; should shut down.");
+ return false;
}
+ this.routerClassName = this.routerService.getClassName();
+ this.routerPackage = this.routerService.getPackageName();
+
+
if (!sendBindingIntent()) {
DebugTool.logError(TAG, "Something went wrong while trying to bind with the router service.");
SdlBroadcastReceiver.queryForConnectedService(currentContext);
@@ -730,7 +674,7 @@ public class TransportBroker {
*/
private static boolean legacyModeEnabled = false;
- private static Object LEGACY_LOCK = new Object();
+ private static final Object LEGACY_LOCK = new Object();
protected void enableLegacyMode(boolean enable) {
synchronized (LEGACY_LOCK) {
@@ -752,11 +696,6 @@ public class TransportBroker {
/**
* 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;
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
index 5039b0e0e..13edfb5f1 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportManager.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportManager.java
@@ -55,7 +55,6 @@ import com.smartdevicelink.util.DebugTool;
import java.lang.ref.WeakReference;
import java.util.List;
-@SuppressWarnings("unused")
public class TransportManager extends TransportManagerBase{
private static final String TAG = "TransportManager";
@@ -97,7 +96,7 @@ public class TransportManager extends TransportManagerBase{
@Override
public void onFinishedValidation(boolean valid, ComponentName name) {
DebugTool.logInfo(TAG, "onFinishedValidation valid=" + valid + "; name=" + ((name == null)? "null" : name.getPackageName()));
- if (valid) {
+ if (valid && name != null) {
mConfig.service = name;
transport = new TransportBrokerImpl(contextWeakReference.get(), mConfig.appId, mConfig.service);
DebugTool.logInfo(TAG, "TransportManager start was called; transport=" + transport);
@@ -125,14 +124,6 @@ public class TransportManager extends TransportManagerBase{
}
}
- @Override
- @Deprecated
- public void resetSession(){
- if(transport != null){
- transport.resetSession();
- }
- }
-
/**
* Check to see if a transport is connected.
* @param transportType the transport to have its connection status returned. If `null` is
@@ -222,14 +213,6 @@ public class TransportManager extends TransportManagerBase{
return config;
}
- @Deprecated
- public ComponentName getRouterService(){
- if(transport != null) {
- return transport.getRouterService();
- }
- return null;
- }
-
@Override
public void sendPacket(SdlPacket packet){
if(transport !=null){
@@ -249,11 +232,6 @@ public class TransportManager extends TransportManagerBase{
}
}
- @Deprecated
- public void requestSecondaryTransportConnection(byte sessionId, Bundle params){
- transport.requestSecondaryTransportConnection(sessionId, (Bundle)params);
- }
-
@Override
public void requestSecondaryTransportConnection(byte sessionId, TransportRecord transportRecord){
if(transportRecord != null){
@@ -265,7 +243,7 @@ public class TransportManager extends TransportManagerBase{
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]));
+ bundle.putInt(ControlFrameTags.RPC.TransportEventUpdate.TCP_PORT, Integer.parseInt(split[1]));
} //else {something went wrong;}
}else{
bundle.putString(ControlFrameTags.RPC.TransportEventUpdate.TCP_IP_ADDRESS, address);
@@ -284,13 +262,6 @@ public class TransportManager extends TransportManagerBase{
super(context,appId,routerService);
}
- @SuppressWarnings("deprecation")
- @Override
- @Deprecated
- public boolean onHardwareConnected(TransportType transportType){
- return false;
- }
-
@Override
public synchronized boolean onHardwareConnected(List<TransportRecord> transports) {
super.onHardwareConnected(transports);
@@ -478,7 +449,7 @@ public class TransportManager extends TransportManagerBase{
String action = intent.getAction();
if(BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)){
exitLegacyMode("Bluetooth disconnected");
- }else if(action.equalsIgnoreCase(BluetoothAdapter.ACTION_STATE_CHANGED)){
+ }else if(action != null && action.equalsIgnoreCase(BluetoothAdapter.ACTION_STATE_CHANGED)){
int bluetoothState = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, -1);
if(bluetoothState == BluetoothAdapter.STATE_TURNING_OFF || bluetoothState == BluetoothAdapter.STATE_OFF){
DebugTool.logInfo(TAG, "Bluetooth is shutting off, exiting legacy mode.");
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
index 17942b49d..dbe7898ef 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBAccessoryAttachmentActivity.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBAccessoryAttachmentActivity.java
@@ -222,7 +222,7 @@ public class USBAccessoryAttachmentActivity extends Activity {
private void attemptLegacyUsbConnection(UsbAccessory usbAccessory){
if(usbAccessory != null) {
DebugTool.logInfo(TAG, "Attempting to send USB connection intent using legacy method");
- Intent usbAccessoryAttachedIntent = new Intent(USBTransport.ACTION_USB_ACCESSORY_ATTACHED);
+ Intent usbAccessoryAttachedIntent = new Intent(TransportConstants.ACTION_USB_ACCESSORY_ATTACHED);
usbAccessoryAttachedIntent.putExtra(UsbManager.EXTRA_ACCESSORY, usbAccessory);
usbAccessoryAttachedIntent.putExtra(UsbManager.EXTRA_PERMISSION_GRANTED, permissionGranted);
AndroidTools.sendExplicitBroadcast(getApplicationContext(), usbAccessoryAttachedIntent, null);
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
deleted file mode 100644
index 0ab2f2fcf..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransport.java
+++ /dev/null
@@ -1,915 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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(TAG, "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(final UsbAccessory accessory) {
- if (accessory == null) {
- return false;
- }
-
- 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) {
-
- if (accessory == null) {
- handleTransportError("Can't connect to null accessory", null);
- }
-
- 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(TAG, s, tr);
- }
-
- /**
- * Logs the string with WARN level.
- *
- * @param s string to log
- */
- private void logW(String s) {
- DebugTool.logWarning(TAG, 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(TAG, 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(TAG, 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(TAG, DEBUG_PREFIX + s);
- }
-
- private void logI(String s) {
- DebugTool.logInfo(TAG, s);
- }
-
- private void logW(String s) {
- DebugTool.logWarning(TAG, 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(TAG, 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
deleted file mode 100644
index 9aeb1a33a..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/USBTransportConfig.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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
index cd351a622..0b0c9b88d 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/UsbTransferProvider.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/UsbTransferProvider.java
@@ -71,7 +71,7 @@ public class UsbTransferProvider {
ParcelFileDescriptor usbPfd;
Bundle usbInfoBundle;
- private ServiceConnection routerConnection= new ServiceConnection() {
+ private final ServiceConnection routerConnection= new ServiceConnection() {
public void onServiceConnected(ComponentName className, IBinder service) {
DebugTool.logInfo(TAG, "Bound to service " + className.toString());
@@ -212,7 +212,7 @@ public class UsbTransferProvider {
public ClientHandler(UsbTransferProvider provider){
super(Looper.getMainLooper());
- this.provider = new WeakReference<UsbTransferProvider>(provider);
+ this.provider = new WeakReference<>(provider);
}
@Override
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
index c7333fb08..670711709 100644
--- 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
@@ -50,11 +50,11 @@ public class ByteArrayMessageSpliter {
boolean firstPacket;
ByteArrayInputStream stream;
int bytesRead;
- int what;
- String appId;
+ final int what;
+ final String appId;
byte[] buffer;
- int orginalSize;
- int priorityCoef;
+ final int orginalSize;
+ final int priorityCoef;
int routerServiceVersion = 1;
TransportRecord transportRecord;
@@ -68,17 +68,6 @@ public class ByteArrayMessageSpliter {
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;
}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/SdlDeviceListener.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/SdlDeviceListener.java
index b9bd8bb12..1ca1f8d97 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/SdlDeviceListener.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/SdlDeviceListener.java
@@ -39,6 +39,7 @@ import android.content.SharedPreferences;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
+
import androidx.annotation.NonNull;
import com.smartdevicelink.transport.MultiplexBaseTransport;
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
index 0e75acd77..ea2bf709f 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/AndroidTools.java
@@ -84,7 +84,7 @@ public class AndroidTools {
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>();
+ HashMap<String,ResolveInfo> sdlMultiList = new HashMap<>();
for(ResolveInfo info: infos){
if(info.activityInfo.applicationInfo.packageName.equals(myPackageName)){
continue; //Ignoring my own package
@@ -111,7 +111,7 @@ public class AndroidTools {
if(packageManager != null) {
for (ResolveInfo info : resolveInfoList) {
- PackageInfo packageInfo = null;
+ PackageInfo packageInfo;
try {
packageInfo = packageManager.getPackageInfo(info.serviceInfo.packageName, 0);
sdlAppInfoList.add(new SdlAppInfo(info, packageInfo));
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpRequestTask.java b/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
index 44125dff2..1cc0b514c 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
@@ -146,7 +146,7 @@ public class HttpRequestTask extends AsyncTask<String, String, String> {
}
return null;
}
- String response = null;
+ String response;
response = buffer.toString();
//send to post execute
@@ -199,12 +199,12 @@ public class HttpRequestTask extends AsyncTask<String, String, String> {
* Called when HTTP request is successfully completed.
* @param response The response to the HTTP request.
*/
- public abstract void httpCallComplete(String response);
+ void httpCallComplete(String response);
/**
* Called when HTTP request failed.
* @param statusCode The HTTP failure code.
*/
- public abstract void httpFailure(int statusCode);
+ void httpFailure(int statusCode);
}
}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/util/IntegrationValidator.java b/android/sdl_android/src/main/java/com/smartdevicelink/util/IntegrationValidator.java
index 6553da286..d88912c62 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/util/IntegrationValidator.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/IntegrationValidator.java
@@ -113,8 +113,8 @@ public class IntegrationValidator {
if (permissionInfos != null && permissionInfos.length > 0) {
String permissionInfo;
- for (int i = 0; i < permissionInfos.length; i++) {
- permissionInfo = permissionInfos[i];
+ for (String info : permissionInfos) {
+ permissionInfo = info;
permissionList.remove(permissionInfo);
}
}
@@ -147,9 +147,9 @@ public class IntegrationValidator {
if (receivers != null && receivers.length > 0) {
ActivityInfo receiver;
- for (int i = 0; i < receivers.length; i++) {
+ for (ActivityInfo activityInfo : receivers) {
- receiver = receivers[i];
+ receiver = activityInfo;
if (receiver != null) {
int j = 0;
for (ResolveInfo sdlReceiver : sdlReceivers) {
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/util/MediaStreamingStatus.java b/android/sdl_android/src/main/java/com/smartdevicelink/util/MediaStreamingStatus.java
index 84c21f761..e7a4b69d6 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/util/MediaStreamingStatus.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/MediaStreamingStatus.java
@@ -43,6 +43,7 @@ import android.content.IntentFilter;
import android.media.AudioDeviceInfo;
import android.media.AudioManager;
import android.os.Build;
+
import androidx.annotation.NonNull;
import java.lang.ref.WeakReference;
@@ -63,9 +64,9 @@ public class MediaStreamingStatus {
private static final Object BROADCAST_RECEIVER_LOCK = new Object();
private boolean broadcastReceiverValid = true;
- private WeakReference<Context> contextWeakReference;
+ private final WeakReference<Context> contextWeakReference;
private Callback callback;
- private List<String> intentList;
+ private final List<String> intentList;
public MediaStreamingStatus(@NonNull Context context, @NonNull Callback callback){
contextWeakReference = new WeakReference<>(context);
@@ -115,11 +116,13 @@ public class MediaStreamingStatus {
// If API level 23+ audio manager can iterate over all current devices to see if a supported
// device is present.
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){
- AudioDeviceInfo[] deviceInfos = audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS);
- if(deviceInfos != null) {
- for (AudioDeviceInfo deviceInfo : deviceInfos) {
- if (deviceInfo != null && isSupportedAudioDevice(deviceInfo.getType())) {
- return true;
+ if (audioManager != null) {
+ AudioDeviceInfo[] deviceInfos = audioManager.getDevices(AudioManager.GET_DEVICES_OUTPUTS);
+ if (deviceInfos != null) {
+ for (AudioDeviceInfo deviceInfo : deviceInfos) {
+ if (deviceInfo != null && isSupportedAudioDevice(deviceInfo.getType())) {
+ return true;
+ }
}
}
}
@@ -127,7 +130,11 @@ public class MediaStreamingStatus {
}
//This means the SDK version is < M, and our min is 8 so this API is always available
- return audioManager.isBluetoothA2dpOn();
+ if (audioManager != null) {
+ return audioManager.isBluetoothA2dpOn();
+ }
+
+ return false;
}
/**
@@ -268,7 +275,7 @@ public class MediaStreamingStatus {
}
}
- private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
+ private final BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
synchronized (BROADCAST_RECEIVER_LOCK) {
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
index 0a08a3f16..35c852c09 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/util/SdlAppInfo.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/SdlAppInfo.java
@@ -53,7 +53,7 @@ public class SdlAppInfo {
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.
+ int routerServiceVersion = 4; //We use this as a default and assume if the number doesn't exist in meta data it is because the app hasn't updated.
boolean isCustomRouterService = false;
long lastUpdateTime;
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
index 9265eb345..0848446ef 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/util/ServiceFinder.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/util/ServiceFinder.java
@@ -91,7 +91,7 @@ public class ServiceFinder {
}
- BroadcastReceiver mainServiceReceiver = new BroadcastReceiver() {
+ final BroadcastReceiver mainServiceReceiver = new BroadcastReceiver() {
private final Object LIST_LOCK = new Object();
@Override
diff --git a/android/sdl_android/src/test/java/com/smartdevicelink/managers/video/HapticInterfaceManagerTest.java b/android/sdl_android/src/test/java/com/smartdevicelink/managers/video/HapticInterfaceManagerTest.java
index 7c854cbe4..1e147a728 100644
--- a/android/sdl_android/src/test/java/com/smartdevicelink/managers/video/HapticInterfaceManagerTest.java
+++ b/android/sdl_android/src/test/java/com/smartdevicelink/managers/video/HapticInterfaceManagerTest.java
@@ -24,7 +24,7 @@ package com.smartdevicelink.managers.video;
import android.view.View;
import android.view.ViewGroup;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.HapticRect;
import com.smartdevicelink.proxy.rpc.Rectangle;
import com.smartdevicelink.proxy.rpc.SendHapticData;
diff --git a/base/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java b/base/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java
deleted file mode 100644
index f6f3b1cc2..000000000
--- a/base/src/main/java/com/smartdevicelink/Dispatcher/IDispatchingStrategy.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
-
-@Deprecated
-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
deleted file mode 100644
index 16681e600..000000000
--- a/base/src/main/java/com/smartdevicelink/Dispatcher/ProxyMessageDispatcher.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
-
-@Deprecated
-public class ProxyMessageDispatcher<T> {
- private static final String TAG = "ProxyMessageDispatcher";
- 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(TAG, "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/managers/BaseSdlManager.java b/base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java
index 5dc9a3e75..dce30db8e 100644
--- a/base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/BaseSdlManager.java
@@ -38,6 +38,7 @@ import com.smartdevicelink.managers.file.FileManagerConfig;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
import com.smartdevicelink.managers.lifecycle.LifecycleConfigurationUpdate;
import com.smartdevicelink.managers.lifecycle.LifecycleManager;
+import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
import com.smartdevicelink.managers.permission.PermissionManager;
import com.smartdevicelink.managers.screen.ScreenManager;
import com.smartdevicelink.protocol.enums.FunctionID;
@@ -46,8 +47,6 @@ import com.smartdevicelink.proxy.RPCMessage;
import com.smartdevicelink.proxy.RPCNotification;
import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
import com.smartdevicelink.proxy.rpc.ChangeRegistration;
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
@@ -56,7 +55,6 @@ 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.Result;
import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
@@ -179,17 +177,10 @@ abstract class BaseSdlManager {
if ((actualLanguage != null && !actualLanguage.equals(language)) || (actualHMILanguage != null && !actualHMILanguage.equals(hmiLanguage))) {
- LifecycleConfigurationUpdate lcuNew = managerListener.managerShouldUpdateLifecycle(actualLanguage, actualHMILanguage);
- LifecycleConfigurationUpdate lcuOld = managerListener.managerShouldUpdateLifecycle(actualLanguage);
- final LifecycleConfigurationUpdate lcu;
+ final LifecycleConfigurationUpdate lcu = managerListener.managerShouldUpdateLifecycle(actualLanguage, actualHMILanguage);
+
ChangeRegistration changeRegistration;
- if (lcuNew == null) {
- lcu = lcuOld;
- changeRegistration = new ChangeRegistration(actualLanguage, actualLanguage);
- } else {
- lcu = lcuNew;
- changeRegistration = new ChangeRegistration(actualLanguage, actualHMILanguage);
- }
+ changeRegistration = new ChangeRegistration(actualLanguage, actualHMILanguage);
if (lcu != null) {
changeRegistration.setAppName(lcu.getAppName());
@@ -200,6 +191,12 @@ abstract class BaseSdlManager {
@Override
public void onResponse(int correlationId, RPCResponse response) {
if (response.getSuccess()) {
+ try {
+ DebugTool.logInfo(TAG, response.serializeJSON().toString());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+
// go through and change sdlManager properties that were changed via the LCU update
hmiLanguage = actualHMILanguage;
language = actualLanguage;
@@ -219,18 +216,10 @@ abstract class BaseSdlManager {
if (lcu.getVoiceRecognitionCommandNames() != null) {
vrSynonyms = lcu.getVoiceRecognitionCommandNames();
}
+ } else {
+ DebugTool.logError(TAG, "Change Registration onError: " + response.getResultCode() + " | Info: " + response.getInfo());
+ retryChangeRegistration();
}
- try {
- DebugTool.logInfo(TAG, response.serializeJSON().toString());
- } catch (JSONException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- DebugTool.logError(TAG, "Change Registration onError: " + resultCode + " | Info: " + info);
- retryChangeRegistration();
}
});
this.sendRPC(changeRegistration);
@@ -267,7 +256,7 @@ abstract class BaseSdlManager {
if (onRPCNotificationListeners != null) {
Set<FunctionID> functionIDSet = onRPCNotificationListeners.keySet();
if (functionIDSet != null && !functionIDSet.isEmpty()) {
- queuedNotifications = new ConcurrentLinkedQueue<RPCNotification>();
+ queuedNotifications = new ConcurrentLinkedQueue<>();
queuedNotificationListener = new OnRPCNotificationListener() {
@Override
public void onNotified(RPCNotification notification) {
@@ -316,7 +305,6 @@ abstract class BaseSdlManager {
/**
* Starts up a SdlManager, and calls provided callback called once all BaseSubManagers are done setting up
*/
- @SuppressWarnings("unchecked")
public void start() {
LifecycleManager.AppConfig appConfig = new LifecycleManager.AppConfig();
appConfig.setAppName(appName);
@@ -610,7 +598,7 @@ abstract class BaseSdlManager {
// BUILDER
public static class Builder {
- SdlManager sdlManager;
+ final SdlManager sdlManager;
Builder(@NonNull final String appId, @NonNull final String appName, @NonNull final SdlManagerListener listener) {
sdlManager = new SdlManager();
@@ -622,7 +610,7 @@ abstract class BaseSdlManager {
/**
* Sets the App ID
*
- * @param appId String representation of the App ID retreived from the SDL Developer Portal
+ * @param appId String representation of the App ID retrieved from the SDL Developer Portal
*/
public Builder setAppId(@NonNull final String appId) {
sdlManager.appId = appId;
@@ -790,17 +778,6 @@ abstract class BaseSdlManager {
}
/**
- * Sets the Security libraries
- *
- * @param secList The list of security class(es)
- */
- @Deprecated
- public Builder setSdlSecurity(List<Class<? extends SdlSecurityBase>> secList) {
- sdlManager.sdlSecList = secList;
- return this;
- }
-
- /**
* Sets the security libraries and a callback to notify caller when there is update to encryption service
*
* @param secList The list of security class(es)
diff --git a/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java b/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java
index 74aebda5a..11de4359b 100644
--- a/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/BaseSubManager.java
@@ -31,9 +31,10 @@
*/
package com.smartdevicelink.managers;
+import androidx.annotation.CallSuper;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
-import com.smartdevicelink.proxy.interfaces.ISdl;
import com.smartdevicelink.transport.utl.TransportRecord;
import java.util.List;
@@ -47,6 +48,7 @@ import java.util.List;
*
* 1. <br>
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public abstract class BaseSubManager {
// states - if this gets more complicated we can move elsewhere
@@ -65,6 +67,7 @@ public abstract class BaseSubManager {
* 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
*/
+ @CallSuper
public void start(CompletionListener listener){
this.completionListener = listener;
int state = getState();
@@ -77,6 +80,7 @@ public abstract class BaseSubManager {
/**
* <p>Called when manager is being torn down</p>
*/
+ @CallSuper
public void dispose(){
transitionToState(SHUTDOWN);
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java b/base/src/main/java/com/smartdevicelink/managers/ISdl.java
index a4183f01a..5885f4dc4 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdl.java
+++ b/base/src/main/java/com/smartdevicelink/managers/ISdl.java
@@ -1,21 +1,19 @@
-package com.smartdevicelink.proxy.interfaces;
+package com.smartdevicelink.managers;
import androidx.annotation.NonNull;
import com.livio.taskmaster.Taskmaster;
+import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
+import com.smartdevicelink.protocol.ISdlServiceListener;
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.RegisterAppInterfaceResponse;
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;
@@ -52,7 +50,6 @@ import java.util.List;
* 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 {
/**
@@ -87,74 +84,24 @@ public interface ISdl {
/**
* Starts the video streaming service
- * @param parameters desired video streaming params for this sevice to be started with
+ * @param parameters desired video streaming params for this service 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
- */
- @Deprecated
- IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters);
-
- /**
- * Starts the Audio streaming service
- * @param encrypted flag to start this service with encryption or not
- */
- @Deprecated
- 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
- */
- @Deprecated
- 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
- */
- @Deprecated
- void sendRequests(List<? extends RPCRequest> rpcs, final OnMultipleRequestListener listener);
-
- /**
* Pass a list of RPC messages through the proxy to be sent to core
* @param rpcs List of RPC messages
* @param listener OnMultipleRequestListener that is called between requests and after all are processed
@@ -217,65 +164,12 @@ public interface ISdl {
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
- * @deprecated use {@link #getCapability(SystemCapabilityType, OnSystemCapabilityListener, boolean)} instead.
- */
- @Deprecated
- 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
- * @deprecated use {@link #getCapability(SystemCapabilityType, OnSystemCapabilityListener, boolean)} instead.
- */
- @Deprecated
- void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener);
-
- /** Gets the capability object that corresponds to the supplied capability type by returning the currently cached value immediately (or null) as well as calling the listener immediately with the cached value, if available. If not available, the listener will retrieve a new value and return that when the head unit responds.
- * <strong>If capability is not cached, the method will return null and trigger the supplied listener when the capability becomes available</strong>
- * @param systemCapabilityType type of capability desired
- * @param scListener callback to execute upon retrieving capability
- * @param forceUpdate flag to force getting a new fresh copy of the capability from the head unit even if it is cached
- * @return desired capability if it is cached in the manager, otherwise returns a null object
- */
- @Deprecated
- Object getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener, boolean forceUpdate);
-
- /**
* Get RegisterAppInterfaceResponse
* @return the RegisterAppInterfaceResponse if available, null if not
*/
RegisterAppInterfaceResponse getRegisterAppInterfaceResponse();
/**
- * 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
- */
- @Deprecated
- 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
- */
- @Deprecated
- 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
- */
- @Deprecated
- 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
@@ -305,4 +199,6 @@ public interface ISdl {
void startRPCEncryption();
Taskmaster getTaskmaster();
+
+ SystemCapabilityManager getSystemCapabilityManager();
}
diff --git a/base/src/main/java/com/smartdevicelink/managers/ManagerUtility.java b/base/src/main/java/com/smartdevicelink/managers/ManagerUtility.java
index 2bac81e42..b788bab1c 100644
--- a/base/src/main/java/com/smartdevicelink/managers/ManagerUtility.java
+++ b/base/src/main/java/com/smartdevicelink/managers/ManagerUtility.java
@@ -28,14 +28,17 @@ public class ManagerUtility {
* @param name ImageFieldName representing a name of a given Image field that would be stored in WindowCapability
* @return true if name exist in WindowCapability else false
*/
- public static boolean hasImageFieldOfName(WindowCapability windowCapability, ImageFieldName name) {
+ public static boolean hasImageFieldOfName(final WindowCapability windowCapability, final ImageFieldName name) {
if (windowCapability == null || name == null) {
return false;
}
if (windowCapability.getImageFields() != null) {
- for (ImageField field : windowCapability.getImageFields()) {
- if (field != null && name.equals(field.getName())) {
- return true;
+ List<ImageField> imageFields = windowCapability.getImageFields();
+ if(imageFields != null && imageFields.size() > 0) {
+ for (ImageField field : imageFields) {
+ if (field != null && name.equals(field.getName())) {
+ return true;
+ }
}
}
}
@@ -49,14 +52,17 @@ public class ManagerUtility {
* @param name TextFieldName representing a name of a given text field that would be stored in WindowCapability
* @return true if name exist in WindowCapability else false
*/
- public static boolean hasTextFieldOfName(WindowCapability windowCapability, TextFieldName name) {
+ public static boolean hasTextFieldOfName(final WindowCapability windowCapability, final TextFieldName name) {
if (windowCapability == null || name == null) {
return false;
}
if (windowCapability.getTextFields() != null) {
- for (TextField field : windowCapability.getTextFields()) {
- if (field != null && name.equals(field.getName())) {
- return true;
+ List<TextField> textFields = windowCapability.getTextFields();
+ if (textFields != null && textFields.size() > 0) {
+ for (TextField field : textFields) {
+ if (field != null && name.equals(field.getName())) {
+ return true;
+ }
}
}
}
@@ -69,24 +75,26 @@ public class ManagerUtility {
* @param windowCapability WindowCapability representing the capabilities of the desired window
* @return linesFound Number of textFields found in WindowCapability
*/
- public static int getMaxNumberOfMainFieldLines(WindowCapability windowCapability) {
+ public static int getMaxNumberOfMainFieldLines(final WindowCapability windowCapability) {
int highestFound = 0;
if (windowCapability != null && windowCapability.getTextFields() != null) {
for (TextField field : windowCapability.getTextFields()) {
int fieldNumber = 0;
- switch (field.getName()) {
- case mainField1:
- fieldNumber = 1;
- break;
- case mainField2:
- fieldNumber = 2;
- break;
- case mainField3:
- fieldNumber = 3;
- break;
- case mainField4:
- fieldNumber = 4;
- break;
+ if(field != null && field.getName() != null) {
+ switch (field.getName()) {
+ case mainField1:
+ fieldNumber = 1;
+ break;
+ case mainField2:
+ fieldNumber = 2;
+ break;
+ case mainField3:
+ fieldNumber = 3;
+ break;
+ case mainField4:
+ fieldNumber = 4;
+ break;
+ }
}
if (fieldNumber > 0) {
highestFound = Math.max(highestFound, fieldNumber);
diff --git a/base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java b/base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java
index e4c191308..65bf6e3e1 100644
--- a/base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/audio/BaseAudioStreamManager.java
@@ -34,7 +34,7 @@ package com.smartdevicelink.managers.audio;
import androidx.annotation.NonNull;
import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
abstract class BaseAudioStreamManager extends BaseSubManager {
BaseAudioStreamManager(@NonNull ISdl 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
index c08cb17e0..e6c67d2b8 100644
--- a/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/file/BaseFileManager.java
@@ -34,14 +34,15 @@ package com.smartdevicelink.managers.file;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
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.DeleteFileResponse;
import com.smartdevicelink.proxy.rpc.ListFiles;
@@ -81,18 +82,11 @@ abstract class BaseFileManager extends BaseSubManager {
final static String TAG = "FileManager";
final static int SPACE_AVAILABLE_MAX_VALUE = 2000000000;
- private List<String> remoteFiles, uploadedEphemeralFileNames;
+ private List<String> remoteFiles;
+ private final List<String> uploadedEphemeralFileNames;
private int bytesAvailable = SPACE_AVAILABLE_MAX_VALUE;
- private FileManagerConfig fileManagerConfig;
- private HashMap<String, Integer> failedFileUploadsIndex;
-
- @Deprecated
- BaseFileManager(ISdl internalInterface) {
-
- // setup
- super(internalInterface);
- uploadedEphemeralFileNames = new ArrayList<>();
- }
+ private final FileManagerConfig fileManagerConfig;
+ private final HashMap<String, Integer> failedFileUploadsIndex;
/**
* Constructor for BaseFileManager
@@ -109,6 +103,7 @@ abstract class BaseFileManager extends BaseSubManager {
}
@Override
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public void start(CompletionListener listener) {
// prepare manager - don't set state to ready until we have list of files
retrieveRemoteFiles();
@@ -123,7 +118,7 @@ abstract class BaseFileManager extends BaseSubManager {
*/
public List<String> getRemoteFileNames() {
if (getState() != BaseSubManager.READY){
- // error and dont return list
+ // error and don't return list
throw new IllegalArgumentException("FileManager is not READY");
}
// return list (this is synchronous at this point)
@@ -146,24 +141,21 @@ abstract class BaseFileManager extends BaseSubManager {
@Override
public void onResponse(int correlationId, RPCResponse response) {
ListFilesResponse listFilesResponse = (ListFilesResponse) response;
- if(listFilesResponse.getSuccess()){
+ if (listFilesResponse.getSuccess()) {
bytesAvailable = listFilesResponse.getSpaceAvailable() != null ? listFilesResponse.getSpaceAvailable() : SPACE_AVAILABLE_MAX_VALUE;
- if(listFilesResponse.getFilenames() != null){
+ if (listFilesResponse.getFilenames() != null) {
remoteFiles.addAll(listFilesResponse.getFilenames());
}
// on callback set manager to ready state
transitionToState(BaseSubManager.READY);
+ } else {
+ // file list could not be received. assume that setting can work and allow SDLManager to start
+ DebugTool.logError(TAG, "File Manager could not list files");
+ bytesAvailable = SPACE_AVAILABLE_MAX_VALUE;
+ transitionToState(BaseSubManager.READY);
}
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- // file list could not be received. assume that setting can work and allow SDLManager to start
- DebugTool.logError(TAG, "File Manager could not list files");
- bytesAvailable = SPACE_AVAILABLE_MAX_VALUE;
- transitionToState(BaseSubManager.READY);
- }
});
internalInterface.sendRPC(listFiles);
}
@@ -248,9 +240,9 @@ abstract class BaseFileManager extends BaseSubManager {
int fileNum = 0;
@Override
- public void addCorrelationId(int correlationid) {
- super.addCorrelationId(correlationid);
- requestMap.put(correlationid, requests.get(fileNum++));
+ public void addCorrelationId(int correlationId) {
+ super.addCorrelationId(correlationId);
+ requestMap.put(correlationId, requests.get(fileNum++));
}
@Override
@@ -273,48 +265,46 @@ abstract class BaseFileManager extends BaseSubManager {
}
@Override
- public void onError(int correlationId, Result resultCode, String info) {
- final RPCRequest request = requestMap.get(correlationId);
- if (request != null) {
- if (!deletionOperation) {
- if (shouldReUploadFile(((PutFile) request).getSdlFileName(), ((PutFile) request).getFileType())) {
- request.setOnRPCResponseListener(null);
- requestsToResend.add(request);
- } else {
- errors.put(((PutFile) request).getSdlFileName(), buildErrorString(resultCode, info));
- }
- } else {
- errors.put(((DeleteFile) request).getSdlFileName(), buildErrorString(resultCode, info));
- }
- }
- }
-
- @Override
public void onResponse(int correlationId, RPCResponse response) {
if (response.getSuccess()) {
if (response instanceof PutFileResponse) {
PutFileResponse putFileResponse = (PutFileResponse) response;
bytesAvailable = putFileResponse.getSpaceAvailable() != null ? putFileResponse.getSpaceAvailable() : SPACE_AVAILABLE_MAX_VALUE;
- if (requestMap.get(correlationId) != null) {
- remoteFiles.add(((PutFile) requestMap.get(correlationId)).getSdlFileName());
- uploadedEphemeralFileNames.add(((PutFile) requestMap.get(correlationId)).getSdlFileName());
+ PutFile putFile = ((PutFile) requestMap.get(correlationId));
+ if (putFile != null) {
+ remoteFiles.add(putFile.getSdlFileName());
+ uploadedEphemeralFileNames.add(putFile.getSdlFileName());
}
} else if (response instanceof DeleteFileResponse) {
DeleteFileResponse deleteFileResponse = (DeleteFileResponse) response;
bytesAvailable = deleteFileResponse.getSpaceAvailable() != null ? deleteFileResponse.getSpaceAvailable() : SPACE_AVAILABLE_MAX_VALUE;
- if (requestMap.get(correlationId) != null) {
- remoteFiles.remove(((DeleteFile) requestMap.get(correlationId)).getSdlFileName());
- uploadedEphemeralFileNames.remove(((DeleteFile) requestMap.get(correlationId)).getSdlFileName());
+ DeleteFile deleteFile = (DeleteFile) requestMap.get(correlationId);
+ if (deleteFile != null) {
+ remoteFiles.remove(deleteFile.getSdlFileName());
+ uploadedEphemeralFileNames.remove(deleteFile.getSdlFileName());
+ }
+ }
+ } else {
+ final RPCRequest request = requestMap.get(correlationId);
+ if (request != null) {
+ if (!deletionOperation) {
+ if (shouldReUploadFile(((PutFile) request).getSdlFileName(), ((PutFile) request).getFileType())) {
+ request.setOnRPCResponseListener(null);
+ requestsToResend.add(request);
+ } else {
+ errors.put(((PutFile) request).getSdlFileName(), buildErrorString(response.getResultCode(), response.getInfo()));
+ }
+ } else {
+ errors.put(((DeleteFile) request).getSdlFileName(), buildErrorString(response.getResultCode(), response.getInfo()));
}
}
}
}
-
};
- internalInterface.sendRequests(requests, onMultipleRequestListener);
+ internalInterface.sendRPCs(requests, onMultipleRequestListener);
}
/**
@@ -342,19 +332,15 @@ abstract class BaseFileManager extends BaseSubManager {
bytesAvailable = putFileResponse.getSpaceAvailable() != null ? putFileResponse.getSpaceAvailable() : SPACE_AVAILABLE_MAX_VALUE;
remoteFiles.add(file.getName());
uploadedEphemeralFileNames.add(file.getName());
- }
- if (listener != null) {
- listener.onComplete(putFileResponse.getSuccess());
- }
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- super.onError(correlationId, resultCode, info);
- if (shouldReUploadFile(file.getName(), file.getType())) {
- uploadFile(file, listener);
- } else if (listener != null) {
- listener.onComplete(false);
+ if (listener != null) {
+ listener.onComplete(true);
+ }
+ } else {
+ if (shouldReUploadFile(file.getName(), file.getType())) {
+ uploadFile(file, listener);
+ } else if (listener != null) {
+ listener.onComplete(false);
+ }
}
}
});
@@ -369,9 +355,9 @@ abstract class BaseFileManager extends BaseSubManager {
*/
private boolean shouldReUploadFile(String fileName, FileType fileType) {
if (!failedFileUploadsIndex.containsKey(fileName)) {
- if (fileType.equals(FileType.GRAPHIC_JPEG) ||
- fileType.equals(FileType.GRAPHIC_BMP) ||
- fileType.equals(FileType.GRAPHIC_PNG)) {
+ if (FileType.GRAPHIC_JPEG.equals(fileType) ||
+ FileType.GRAPHIC_BMP.equals(fileType) ||
+ FileType.GRAPHIC_PNG.equals(fileType)) {
failedFileUploadsIndex.put(fileName, fileManagerConfig.getArtworkRetryCount());
} else {
failedFileUploadsIndex.put(fileName, fileManagerConfig.getFileRetryCount());
diff --git a/base/src/main/java/com/smartdevicelink/managers/file/FileManagerConfig.java b/base/src/main/java/com/smartdevicelink/managers/file/FileManagerConfig.java
index 4ec20b875..7ff6207d6 100644
--- a/base/src/main/java/com/smartdevicelink/managers/file/FileManagerConfig.java
+++ b/base/src/main/java/com/smartdevicelink/managers/file/FileManagerConfig.java
@@ -25,7 +25,7 @@ public class FileManagerConfig {
/**
* Setter for Integer artWorkRetryCount
*
- * @param artworkRetryCount
+ * @param artworkRetryCount the number of retry attempts
*/
public void setArtworkRetryCount(int artworkRetryCount) {
this.artworkRetryCount = artworkRetryCount;
@@ -43,7 +43,7 @@ public class FileManagerConfig {
/**
* Setter for Integer fileRetryCount
*
- * @param fileRetryCount
+ * @param fileRetryCount the number of retry attempts
*/
public void setFileRetryCount(int fileRetryCount) {
this.fileRetryCount = fileRetryCount;
diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseEncryptionLifecycleManager.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseEncryptionLifecycleManager.java
index a458ae048..2e005ef68 100644
--- a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseEncryptionLifecycleManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseEncryptionLifecycleManager.java
@@ -33,13 +33,14 @@
package com.smartdevicelink.managers.lifecycle;
import androidx.annotation.NonNull;
-import com.smartdevicelink.SdlConnection.SdlSession;
+
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.managers.ServiceEncryptionListener;
+import com.smartdevicelink.protocol.ISdlServiceListener;
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.managers.ISdl;
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
import com.smartdevicelink.proxy.rpc.PermissionItem;
@@ -53,12 +54,12 @@ import java.util.Set;
abstract class BaseEncryptionLifecycleManager {
private static final String TAG = "BaseEncryptionLifecycleManager";
- private ISdl internalInterface;
+ private final ISdl internalInterface;
private ServiceEncryptionListener serviceEncryptionListener;
private HMILevel currentHMILevel;
- private Set<String> encryptionRequiredRPCs = new HashSet<>();
+ private final Set<String> encryptionRequiredRPCs = new HashSet<>();
private boolean rpcSecuredServiceStarted;
- ISdlServiceListener securedServiceListener;
+ final ISdlServiceListener securedServiceListener;
BaseEncryptionLifecycleManager(@NonNull ISdl isdl, ServiceEncryptionListener listener) {
internalInterface = isdl;
diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java
index 75afd665d..03158c73c 100644
--- a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java
@@ -36,9 +36,10 @@ import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import com.livio.taskmaster.Taskmaster;
-import com.smartdevicelink.SdlConnection.ISdlSessionListener;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.session.ISdlSessionListener;
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.exception.SdlException;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.SdlManager;
import com.smartdevicelink.managers.ServiceEncryptionListener;
import com.smartdevicelink.marshal.JsonRPCMarshaller;
@@ -50,12 +51,8 @@ import com.smartdevicelink.proxy.RPCMessage;
import com.smartdevicelink.proxy.RPCNotification;
import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.managers.lifecycle.BaseSystemCapabilityManager;
-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.protocol.ISdlServiceListener;
+import com.smartdevicelink.proxy.rpc.GenericResponse;
import com.smartdevicelink.proxy.rpc.OnAppInterfaceUnregistered;
import com.smartdevicelink.proxy.rpc.OnButtonEvent;
import com.smartdevicelink.proxy.rpc.OnButtonPress;
@@ -79,16 +76,12 @@ import com.smartdevicelink.proxy.rpc.enums.Language;
import com.smartdevicelink.proxy.rpc.enums.RequestType;
import com.smartdevicelink.proxy.rpc.enums.Result;
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.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.audio.AudioStreamingCodec;
-import com.smartdevicelink.streaming.audio.AudioStreamingParams;
import com.smartdevicelink.streaming.video.VideoStreamingParameters;
import com.smartdevicelink.transport.BaseTransportConfig;
import com.smartdevicelink.util.CorrelationIdGenerator;
@@ -117,7 +110,7 @@ abstract class BaseLifecycleManager {
ON_NOTIFICATION_LISTENER_LOCK = new Object();
SdlSession session;
- AppConfig appConfig;
+ final AppConfig appConfig;
Version rpcSpecVersion = MAX_SUPPORTED_RPC_VERSION;
HashMap<Integer, CopyOnWriteArrayList<OnRPCListener>> rpcListeners;
HashMap<Integer, OnRPCResponseListener> rpcResponseListeners;
@@ -128,11 +121,11 @@ abstract class BaseLifecycleManager {
RegisterAppInterfaceResponse raiResponse = null;
private OnHMIStatus currentHMIStatus;
boolean firstTimeFull = true;
- LifecycleListener lifecycleListener;
+ final LifecycleListener lifecycleListener;
private List<Class<? extends SdlSecurityBase>> _secList = null;
private String authToken;
- Version minimumProtocolVersion;
- Version minimumRPCVersion;
+ final Version minimumProtocolVersion;
+ final Version minimumRPCVersion;
BaseTransportConfig _transportConfig;
private Taskmaster taskmaster;
@@ -210,17 +203,6 @@ abstract class BaseLifecycleManager {
listener.getSingleRpcResponseListener().onResponse(correlationId, response);
}
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- super.onError(correlationId, resultCode, info);
- if (devOnRPCResponseListener != null) {
- devOnRPCResponseListener.onError(correlationId, resultCode, info);
- }
- if (listener.getSingleRpcResponseListener() != null) {
- listener.getSingleRpcResponseListener().onError(correlationId, resultCode, info);
- }
- }
});
}
sendRPCMessagePrivate(request, false);
@@ -270,20 +252,6 @@ abstract class BaseLifecycleManager {
// recurse after onResponse
sendSequentialRPCs(messages, listener);
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- if (devOnRPCResponseListener != null) {
- devOnRPCResponseListener.onError(correlationId, resultCode, info);
- }
- if (listener != null) {
- listener.onError(correlationId, resultCode, info);
- listener.onUpdate(messages.size());
-
- }
- // recurse after onError
- sendSequentialRPCs(messages, listener);
- }
});
sendRPCMessagePrivate(request, false);
} else {
@@ -302,7 +270,7 @@ abstract class BaseLifecycleManager {
* 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>
+ * <b>NOTE: THERE IS NO GUARANTEE THIS WILL BE A VALID SYSTEM CAPABILITY MANAGER</b>
*
* @param sdlManager this must be a working manager instance
* @return the system capability manager.
@@ -379,7 +347,7 @@ abstract class BaseLifecycleManager {
addRpcListener(FunctionID.UNREGISTER_APP_INTERFACE, rpcListener);
}
- private OnRPCListener rpcListener = new OnRPCListener() {
+ private final OnRPCListener rpcListener = new OnRPCListener() {
@Override
public void onReceived(RPCMessage message) {
//Make sure this is a response as expected
@@ -512,7 +480,10 @@ abstract class BaseLifecycleManager {
rpcListeners.put(id.getId(), new CopyOnWriteArrayList<OnRPCListener>());
}
- rpcListeners.get(id.getId()).add(listener);
+ CopyOnWriteArrayList<OnRPCListener> listeners = rpcListeners.get(id.getId());
+ if (listeners != null) {
+ listeners.add(listener);
+ }
}
}
}
@@ -530,24 +501,6 @@ abstract class BaseLifecycleManager {
}
/**
- * 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.
*
@@ -561,10 +514,8 @@ abstract class BaseLifecycleManager {
if (rpcResponseListeners != null
&& rpcResponseListeners.containsKey(correlationId)) {
OnRPCResponseListener listener = rpcResponseListeners.get(correlationId);
- if (msg.getSuccess()) {
+ if (listener != null) {
listener.onResponse(correlationId, msg);
- } else {
- listener.onError(correlationId, msg.getResultCode(), msg.getInfo());
}
rpcResponseListeners.remove(correlationId);
return true;
@@ -578,22 +529,17 @@ abstract class BaseLifecycleManager {
*
* @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) {
+ private void addOnRPCResponseListener(OnRPCResponseListener listener, int correlationId) {
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;
@@ -646,7 +592,6 @@ abstract class BaseLifecycleManager {
* @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) {
@@ -673,7 +618,7 @@ abstract class BaseLifecycleManager {
@SuppressWarnings("UnusedReturnValue")
private boolean onRPCRequestReceived(RPCRequest request) {
if (request == null) {
- DebugTool.logError("onRPCRequestReceived - request was null");
+ DebugTool.logError(TAG, "onRPCRequestReceived - request was null");
return false;
}
DebugTool.logInfo(TAG, "onRPCRequestReceived - " + request.getFunctionName());
@@ -697,7 +642,6 @@ abstract class BaseLifecycleManager {
* @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) {
@@ -735,7 +679,9 @@ abstract class BaseLifecycleManager {
// Test for illegal correlation ID
if (request.getCorrelationID() == REGISTER_APP_INTERFACE_CORRELATION_ID || request.getCorrelationID() == UNREGISTER_APP_INTERFACE_CORRELATION_ID || request.getCorrelationID() == PoliciesFetcher.POLICIES_CORRELATION_ID) {
if (listener != null) {
- request.getOnRPCResponseListener().onError(request.getCorrelationID(), Result.REJECTED, "Invalid correlation ID. The correlation ID, " + request.getCorrelationID() + " , is a reserved correlation ID.");
+ GenericResponse response = new GenericResponse(false, Result.REJECTED);
+ response.setInfo("Invalid correlation ID. The correlation ID, " + request.getCorrelationID() + " , is a reserved correlation ID.");
+ request.getOnRPCResponseListener().onResponse(request.getCorrelationID(), response);
}
return;
}
@@ -743,7 +689,9 @@ abstract class BaseLifecycleManager {
// Prevent developer from sending RAI or UAI manually
if (request.getFunctionName().equals(FunctionID.REGISTER_APP_INTERFACE.toString()) || request.getFunctionName().equals(FunctionID.UNREGISTER_APP_INTERFACE.toString())) {
if (listener != null) {
- request.getOnRPCResponseListener().onError(request.getCorrelationID(), Result.REJECTED, "The RPCRequest, " + message.getFunctionName() + ", is un-allowed to be sent manually by the developer.");
+ GenericResponse response = new GenericResponse(false, Result.REJECTED);
+ response.setInfo("The RPCRequest, " + message.getFunctionName() + ", is un-allowed to be sent manually by the developer.");
+ request.getOnRPCResponseListener().onResponse(request.getCorrelationID(), response);
}
return;
}
@@ -803,7 +751,9 @@ abstract class BaseLifecycleManager {
RPCRequest request = (RPCRequest) message;
OnRPCResponseListener listener = ((RPCRequest) message).getOnRPCResponseListener();
if (listener != null) {
- listener.onError(request.getCorrelationID(), Result.ABORTED, errorInfo);
+ GenericResponse response = new GenericResponse(false, Result.ABORTED);
+ response.setInfo(errorInfo);
+ request.getOnRPCResponseListener().onResponse(request.getCorrelationID(), response);
}
}
DebugTool.logWarning(TAG, errorInfo);
@@ -821,7 +771,7 @@ abstract class BaseLifecycleManager {
OnRPCResponseListener listener = ((RPCRequest) message).getOnRPCResponseListener();
if (listener != null) {
- addOnRPCResponseListener(listener, corrId, msgBytes.length);
+ addOnRPCResponseListener(listener, corrId);
}
}
} else if (RPCMessage.KEY_RESPONSE.equals(message.getMessageType())) { // Response Specifics
@@ -882,7 +832,7 @@ abstract class BaseLifecycleManager {
} 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)) {
+ if ((FunctionID.ON_BUTTON_PRESS.equals(functionID)) || FunctionID.ON_BUTTON_EVENT.equals(functionID)) {
RPCNotification notificationCompat = handleButtonNotificationFormatting(rpc);
if (notificationCompat != null) {
onRPCNotificationReceived((notificationCompat));
@@ -992,43 +942,11 @@ abstract class BaseLifecycleManager {
}
@Override
- public void stopVideoService() {
- BaseLifecycleManager.this.endVideoStream();
- }
-
- @Override
- public IVideoStreamListener startVideoStream(boolean isEncrypted, VideoStreamingParameters parameters) {
- DebugTool.logWarning(TAG, "startVideoStream is not currently implemented");
- return null;
- }
-
- @Override
- public void startAudioService(boolean encrypted, AudioStreamingCodec codec, AudioStreamingParams params) {
- DebugTool.logWarning(TAG, "startAudioService is not currently implemented");
- }
-
- @Override
public void startAudioService(boolean encrypted) {
BaseLifecycleManager.this.startAudioService(encrypted);
}
@Override
- public void stopAudioService() {
- BaseLifecycleManager.this.endAudioStream();
- }
-
- @Override
- public IAudioStreamListener startAudioStream(boolean isEncrypted, AudioStreamingCodec codec, AudioStreamingParams params) {
- DebugTool.logWarning(TAG, "startAudioStream is not currently implemented");
- return null;
- }
-
- @Override
- public void sendRPCRequest(RPCRequest message) {
- BaseLifecycleManager.this.sendRPCMessagePrivate(message, false);
- }
-
- @Override
public void sendRPC(RPCMessage message) {
if (isConnected()) {
BaseLifecycleManager.this.sendRPCMessagePrivate(message, false);
@@ -1036,11 +954,6 @@ abstract class BaseLifecycleManager {
}
@Override
- public void sendRequests(List<? extends RPCRequest> rpcs, OnMultipleRequestListener listener) {
- BaseLifecycleManager.this.sendRPCs(rpcs, listener);
- }
-
- @Override
public void sendRPCs(List<? extends RPCMessage> rpcs, OnMultipleRequestListener listener) {
BaseLifecycleManager.this.sendRPCs(rpcs, listener);
}
@@ -1081,65 +994,16 @@ abstract class BaseLifecycleManager {
}
@Override
- public Object getCapability(SystemCapabilityType systemCapabilityType) {
- if (BaseLifecycleManager.this.systemCapabilityManager != null) {
- return BaseLifecycleManager.this.systemCapabilityManager.getCapability(systemCapabilityType);
- } else {
- return null;
- }
- }
-
- @Override
- public void getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener) {
- if (BaseLifecycleManager.this.systemCapabilityManager != null) {
- BaseLifecycleManager.this.systemCapabilityManager.getCapability(systemCapabilityType, scListener);
- }
- }
-
- @Override
- public Object getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener, boolean forceUpdate) {
- if (BaseLifecycleManager.this.systemCapabilityManager != null) {
- return BaseLifecycleManager.this.systemCapabilityManager.getCapability(systemCapabilityType, scListener, forceUpdate);
- } else {
- return null;
- }
- }
-
- @Override
public RegisterAppInterfaceResponse getRegisterAppInterfaceResponse() {
return raiResponse;
}
@Override
- public boolean isCapabilitySupported(SystemCapabilityType systemCapabilityType) {
- if (BaseLifecycleManager.this.systemCapabilityManager != null) {
- return BaseLifecycleManager.this.systemCapabilityManager.isCapabilitySupported(systemCapabilityType);
- } else {
- return false;
- }
- }
-
- @Override
- public void addOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener) {
- if (BaseLifecycleManager.this.systemCapabilityManager != null) {
- BaseLifecycleManager.this.systemCapabilityManager.addOnSystemCapabilityListener(systemCapabilityType, listener);
- }
- }
-
- @Override
- public boolean removeOnSystemCapabilityListener(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener listener) {
- if (BaseLifecycleManager.this.systemCapabilityManager != null) {
- return BaseLifecycleManager.this.systemCapabilityManager.removeOnSystemCapabilityListener(systemCapabilityType, listener);
- } else {
- return false;
- }
- }
-
- @Override
public boolean isTransportForServiceAvailable(SessionType serviceType) {
return BaseLifecycleManager.this.session.isTransportForServiceAvailable(serviceType);
}
+ @NonNull
@Override
public SdlMsgVersion getSdlMsgVersion() {
SdlMsgVersion msgVersion = new SdlMsgVersion(rpcSpecVersion.getMajor(), rpcSpecVersion.getMinor());
@@ -1147,6 +1011,7 @@ abstract class BaseLifecycleManager {
return msgVersion;
}
+ @NonNull
@Override
public Version getProtocolVersion() {
return BaseLifecycleManager.this.getProtocolVersion();
@@ -1161,6 +1026,11 @@ abstract class BaseLifecycleManager {
public Taskmaster getTaskmaster() {
return BaseLifecycleManager.this.getTaskmaster();
}
+
+ @Override
+ public SystemCapabilityManager getSystemCapabilityManager() {
+ return BaseLifecycleManager.this.systemCapabilityManager;
+ }
};
/* *******************************************************************************************************
@@ -1243,11 +1113,6 @@ abstract class BaseLifecycleManager {
}
}
- @Deprecated
- public void setSdlSecurityClassList(List<Class<? extends SdlSecurityBase>> list) {
- _secList = list;
- }
-
/**
* Sets the security libraries and a callback to notify caller when there is update to encryption service
*
@@ -1318,15 +1183,9 @@ abstract class BaseLifecycleManager {
void startVideoService(boolean encrypted, VideoStreamingParameters parameters) {
}
- void endVideoStream() {
- }
-
void startAudioService(boolean encrypted) {
}
- void endAudioStream() {
- }
-
void setSdlSecurityStaticVars() {
}
diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseSystemCapabilityManager.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseSystemCapabilityManager.java
index a86f716fd..052ecb5c4 100644
--- a/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseSystemCapabilityManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseSystemCapabilityManager.java
@@ -31,12 +31,11 @@
*/
package com.smartdevicelink.managers.lifecycle;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.ManagerUtility;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCMessage;
import com.smartdevicelink.proxy.RPCResponse;
-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.ButtonCapabilities;
@@ -59,7 +58,6 @@ import com.smartdevicelink.proxy.rpc.enums.HMILevel;
import com.smartdevicelink.proxy.rpc.enums.ImageType;
import com.smartdevicelink.proxy.rpc.enums.MediaClockFormat;
import com.smartdevicelink.proxy.rpc.enums.PredefinedWindows;
-import com.smartdevicelink.proxy.rpc.enums.Result;
import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
import com.smartdevicelink.proxy.rpc.enums.WindowType;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCListener;
@@ -82,7 +80,6 @@ abstract class BaseSystemCapabilityManager {
private final HashMap<SystemCapabilityType, CopyOnWriteArrayList<OnSystemCapabilityListener>> onSystemCapabilityListeners;
private final Object LISTENER_LOCK;
private final ISdl callback;
- private OnRPCListener rpcListener;
private boolean shouldConvertDeprecatedDisplayCapabilities;
private HMILevel currentHMILevel;
@@ -169,7 +166,7 @@ abstract class BaseSystemCapabilityManager {
private void updateDeprecatedDisplayCapabilities() {
WindowCapability defaultMainWindowCapabilities = getDefaultMainWindowCapability();
- List<DisplayCapability> displayCapabilityList = convertToList(getCapability(SystemCapabilityType.DISPLAYS), DisplayCapability.class);
+ List<DisplayCapability> displayCapabilityList = convertToList(getCapability(SystemCapabilityType.DISPLAYS, null, false), DisplayCapability.class);
if (defaultMainWindowCapabilities == null || displayCapabilityList == null || displayCapabilityList.size() == 0) {
return;
@@ -187,7 +184,7 @@ abstract class BaseSystemCapabilityManager {
return;
}
- List<DisplayCapability> oldCapabilities = convertToList(getCapability(SystemCapabilityType.DISPLAYS), DisplayCapability.class);
+ List<DisplayCapability> oldCapabilities = convertToList(getCapability(SystemCapabilityType.DISPLAYS, null, false), DisplayCapability.class);
if (oldCapabilities == null || oldCapabilities.size() == 0) {
setCapability(SystemCapabilityType.DISPLAYS, newCapabilities);
@@ -230,7 +227,7 @@ abstract class BaseSystemCapabilityManager {
public WindowCapability getWindowCapability(int windowID) {
- List<DisplayCapability> capabilities = convertToList(getCapability(SystemCapabilityType.DISPLAYS), DisplayCapability.class);
+ List<DisplayCapability> capabilities = convertToList(getCapability(SystemCapabilityType.DISPLAYS, null, false), DisplayCapability.class);
if (capabilities == null || capabilities.size() == 0) {
return null;
}
@@ -267,7 +264,7 @@ abstract class BaseSystemCapabilityManager {
}
private void setupRpcListeners() {
- rpcListener = new OnRPCListener() {
+ OnRPCListener rpcListener = new OnRPCListener() {
@Override
public void onReceived(RPCMessage message) {
if (message != null) {
@@ -407,7 +404,7 @@ abstract class BaseSystemCapabilityManager {
if (rpcVersion.isBetween(new Version(3, 0, 0), new Version(4, 4, 0)) >= 0) {
//This was before the system capability feature was added so check if
// graphics are supported instead
- DisplayCapabilities displayCapabilities = (DisplayCapabilities) getCapability(SystemCapabilityType.DISPLAY);
+ DisplayCapabilities displayCapabilities = (DisplayCapabilities) getCapability(SystemCapabilityType.DISPLAY, null, false);
if (displayCapabilities != null) {
return displayCapabilities.getGraphicSupported() != null && displayCapabilities.getGraphicSupported();
}
@@ -500,26 +497,6 @@ abstract class BaseSystemCapabilityManager {
return getCapabilityPrivate(systemCapabilityType, scListener, null, forceUpdate);
}
- /** Gets the capability object that corresponds to the supplied capability type by calling the listener immediately with the cached value, if available. If not available, the listener will retrieve a new value and return that when the head unit responds.
- * @param systemCapabilityType Type of capability desired
- * @param scListener callback to execute upon retrieving capability
- * @deprecated use {@link #getCapability(SystemCapabilityType, OnSystemCapabilityListener, boolean)} instead.
- */
- @Deprecated
- public void getCapability(final SystemCapabilityType systemCapabilityType, final OnSystemCapabilityListener scListener) {
- getCapabilityPrivate(systemCapabilityType, scListener, null, false);
- }
-
- /** Gets the capability object that corresponds to the supplied capability type by returning the currently cached value immediately if available. Otherwise returns a null object and works in the background to retrieve the capability for the next call
- * @param systemCapabilityType Type of capability desired
- * @return Desired capability if it is cached in the manager, otherwise returns null
- * @deprecated use {@link #getCapability(SystemCapabilityType, OnSystemCapabilityListener, boolean)} instead.
- */
- @Deprecated
- public Object getCapability(final SystemCapabilityType systemCapabilityType) {
- return getCapabilityPrivate(systemCapabilityType, null, null, false);
- }
-
/**
* Adds a listener to be called whenever a new capability is retrieved. This method automatically subscribes to the supplied capability type and may call the listener multiple times if there are future updates, unlike getCapability() methods, which only call the listener one time.
* @param systemCapabilityType Type of capability desired
@@ -620,13 +597,6 @@ abstract class BaseSystemCapabilityManager {
}
}
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- if (scListener != null) {
- scListener.onError(info);
- }
- }
});
request.setCorrelationID(CorrelationIdGenerator.generateId());
@@ -656,7 +626,7 @@ abstract class BaseSystemCapabilityManager {
//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>();
+ return new ArrayList<>();
}
} else {
return null;
diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/OnSystemCapabilityListener.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/OnSystemCapabilityListener.java
index f1dd490a8..e4b54b207 100644
--- a/base/src/main/java/com/smartdevicelink/managers/lifecycle/OnSystemCapabilityListener.java
+++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/OnSystemCapabilityListener.java
@@ -29,7 +29,7 @@
* 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;
+package com.smartdevicelink.managers.lifecycle;
public interface OnSystemCapabilityListener {
void onCapabilityRetrieved(Object capability);
diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/PoliciesFetcher.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/PoliciesFetcher.java
index a217cfb07..41a83cd12 100644
--- a/base/src/main/java/com/smartdevicelink/managers/lifecycle/PoliciesFetcher.java
+++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/PoliciesFetcher.java
@@ -39,11 +39,17 @@ 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.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
@@ -63,7 +69,7 @@ class PoliciesFetcher {
boolean bDoOutput = true;
boolean bDoInput = true;
boolean bUsesCaches = false;
- String sRequestMeth = "POST";
+ String sRequestMethod = "POST";
boolean bInstFolRed = false;
String sCharSet = "utf-8";
@@ -81,7 +87,7 @@ class PoliciesFetcher {
bDoOutput = myHeader.getDoOutput();
bDoInput = myHeader.getDoInput();
bUsesCaches = myHeader.getUseCaches();
- sRequestMeth = myHeader.getRequestMethod();
+ sRequestMethod = myHeader.getRequestMethod();
iReadTimeout = myHeader.getReadTimeout();
bInstFolRed = myHeader.getInstanceFollowRedirects();
sCharSet = myHeader.getCharset();
@@ -96,12 +102,12 @@ class PoliciesFetcher {
urlConnection.setConnectTimeout(CONNECTION_TIMEOUT);
urlConnection.setDoOutput(bDoOutput);
urlConnection.setDoInput(bDoInput);
- urlConnection.setRequestMethod(sRequestMeth);
+ urlConnection.setRequestMethod(sRequestMethod);
urlConnection.setReadTimeout(READ_TIMEOUT);
urlConnection.setInstanceFollowRedirects(bInstFolRed);
urlConnection.setRequestProperty("Content-Type", sContentType);
urlConnection.setRequestProperty("charset", sCharSet);
- urlConnection.setRequestProperty("Content-Length", "" + Integer.toString(iContentLength));
+ urlConnection.setRequestProperty("Content-Length", "" + iContentLength);
urlConnection.setUseCaches(bUsesCaches);
return urlConnection;
} catch (Exception e) {
@@ -166,7 +172,7 @@ class PoliciesFetcher {
long BeforeTime = System.currentTimeMillis();
long AfterTime = System.currentTimeMillis();
- final long roundtriptime = AfterTime - BeforeTime;
+ final long roundTripTime = AfterTime - BeforeTime;
int iResponseCode = urlConnection.getResponseCode();
@@ -195,7 +201,7 @@ class PoliciesFetcher {
putFile.setCRC(response.toString().getBytes());
return putFile;
} else {
- Vector<String> cloudDataReceived = new Vector<String>();
+ Vector<String> cloudDataReceived = new Vector<>();
final String dataKey = "data";
// Convert the response to JSON
JSONObject jsonResponse = new JSONObject(response.toString());
diff --git a/base/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java b/base/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java
index 9cc9eee25..1c4b1fccb 100644
--- a/base/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java
+++ b/base/src/main/java/com/smartdevicelink/managers/lifecycle/RpcConverter.java
@@ -79,9 +79,9 @@ public class RpcConverter {
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);
+ final Hashtable<String, Object> mHash = JsonRPCMarshaller.unmarshall(message.getData());
+ if (mHash != null) {
+ hashTemp.put(RPCMessage.KEY_PARAMETERS, mHash);
}
}
diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java b/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java
index 669a34a7a..686a2627d 100644
--- a/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/permission/BasePermissionManager.java
@@ -33,12 +33,13 @@ package com.smartdevicelink.managers.permission;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
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;
@@ -68,8 +69,8 @@ abstract class BasePermissionManager extends BaseSubManager{
private HMILevel currentHMILevel;
private Map<FunctionID, PermissionItem> currentPermissionItems;
private OnRPCNotificationListener onHMIStatusListener, onPermissionsChangeListener;
- private List<PermissionFilter> filters;
- private Set<String> encryptionRequiredRPCs = new HashSet<>();
+ private final List<PermissionFilter> filters;
+ private final Set<String> encryptionRequiredRPCs = new HashSet<>();
// Permission groups status constants
@IntDef({PERMISSION_GROUP_STATUS_ALLOWED, PERMISSION_GROUP_STATUS_DISALLOWED,
@@ -146,6 +147,7 @@ abstract class BasePermissionManager extends BaseSubManager{
}
@Override
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public void start(CompletionListener listener) {
checkState();
super.start(listener);
@@ -177,10 +179,6 @@ abstract class BasePermissionManager extends BaseSubManager{
/**
* 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) {
@@ -289,6 +287,7 @@ abstract class BasePermissionManager extends BaseSubManager{
* Clean up everything after the manager is no longer needed
*/
@Override
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public void dispose(){
super.dispose();
diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java b/base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java
index dd600fc6d..662ac795a 100644
--- a/base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java
+++ b/base/src/main/java/com/smartdevicelink/managers/permission/OnPermissionChangeListener.java
@@ -47,5 +47,5 @@ public interface OnPermissionChangeListener {
* @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);
+ void onPermissionsChange(@NonNull Map<FunctionID, PermissionStatus> allowedPermissions, @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
index cd7a8f736..d09e75195 100644
--- a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java
+++ b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionElement.java
@@ -47,8 +47,8 @@ public class PermissionElement {
/**
* Create a new instance of PermissionElement
- * @param rpcName
- * @param parameters
+ * @param rpcName the name of the RPC
+ * @param parameters a list of the RPC parameters
*/
public PermissionElement(@NonNull FunctionID rpcName, List<String> parameters){
this.rpcName = rpcName;
diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java
index 018e038c9..a48b71c9f 100644
--- a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java
+++ b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionFilter.java
@@ -47,13 +47,9 @@ class PermissionFilter {
/**
* 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) {
+ PermissionFilter(UUID identifier, @NonNull List<PermissionElement> permissionElements, @PermissionManager.PermissionGroupType int groupType, @NonNull OnPermissionChangeListener listener) {
if (identifier == null) {
this.identifier = UUID.randomUUID();
} else {
diff --git a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java
index 8f44ac0f6..adae88e5d 100644
--- a/base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java
+++ b/base/src/main/java/com/smartdevicelink/managers/permission/PermissionStatus.java
@@ -51,7 +51,7 @@ public class PermissionStatus {
* @param isRPCAllowed
* @param allowedParameters
*/
- public PermissionStatus(@NonNull FunctionID rpcName, @NonNull boolean isRPCAllowed, Map<String, Boolean> allowedParameters) {
+ public PermissionStatus(@NonNull FunctionID rpcName, boolean isRPCAllowed, Map<String, Boolean> allowedParameters) {
this.rpcName = rpcName;
this.isRPCAllowed = isRPCAllowed;
this.allowedParameters = allowedParameters;
@@ -77,7 +77,7 @@ public class PermissionStatus {
* Set whether the RPC is allowed or not
* @param isRPCAllowed
*/
- protected void setIsRPCAllowed(@NonNull boolean isRPCAllowed) {
+ protected void setIsRPCAllowed(boolean isRPCAllowed) {
this.isRPCAllowed = isRPCAllowed;
}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java
index 80daf4d2e..297c114d3 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java
@@ -33,9 +33,11 @@ package com.smartdevicelink.managers.screen;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.RestrictTo;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.file.FileManager;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
import com.smartdevicelink.managers.screen.choiceset.ChoiceCell;
@@ -48,7 +50,6 @@ import com.smartdevicelink.managers.screen.menu.MenuConfiguration;
import com.smartdevicelink.managers.screen.menu.MenuManager;
import com.smartdevicelink.managers.screen.menu.VoiceCommand;
import com.smartdevicelink.managers.screen.menu.VoiceCommandManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
import com.smartdevicelink.proxy.rpc.KeyboardProperties;
import com.smartdevicelink.proxy.rpc.enums.ButtonName;
import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
@@ -67,7 +68,7 @@ import java.util.List;
*/
abstract class BaseScreenManager extends BaseSubManager {
- private static String TAG = "ScreenManager";
+ private static final String TAG = "ScreenManager";
private final WeakReference<FileManager> fileManager;
private SoftButtonManager softButtonManager;
private TextAndGraphicManager textAndGraphicManager;
@@ -78,6 +79,7 @@ abstract class BaseScreenManager extends BaseSubManager {
// Sub manager listener
private final CompletionListener subManagerListener = new CompletionListener() {
+
@Override
public synchronized void onComplete(boolean success) {
if (softButtonManager != null && textAndGraphicManager != null && voiceCommandManager != null && menuManager != null && choiceSetManager != null && subscribeButtonManager != null) {
@@ -112,6 +114,7 @@ abstract class BaseScreenManager extends BaseSubManager {
}
@Override
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public void start(CompletionListener listener) {
super.start(listener);
this.softButtonManager.start(subManagerListener);
@@ -137,6 +140,7 @@ abstract class BaseScreenManager extends BaseSubManager {
* <p>Called when manager is being torn down</p>
*/
@Override
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public void dispose() {
softButtonManager.dispose();
textAndGraphicManager.dispose();
@@ -248,6 +252,9 @@ abstract class BaseScreenManager extends BaseSubManager {
* @return an SdlArtwork object represents the current primaryGraphic
*/
public SdlArtwork getPrimaryGraphic() {
+ if (this.textAndGraphicManager.getPrimaryGraphic() == null || textAndGraphicManager.getPrimaryGraphic().getName() == null || this.textAndGraphicManager.getPrimaryGraphic().getName().equals(textAndGraphicManager.getBlankArtwork().getName())) {
+ return null;
+ }
return this.textAndGraphicManager.getPrimaryGraphic();
}
@@ -267,6 +274,9 @@ abstract class BaseScreenManager extends BaseSubManager {
* @return an SdlArtwork object represents the current secondaryGraphic
*/
public SdlArtwork getSecondaryGraphic() {
+ if (this.textAndGraphicManager.getSecondaryGraphic() == null || textAndGraphicManager.getSecondaryGraphic().getName() == null || this.textAndGraphicManager.getSecondaryGraphic().getName().equals(textAndGraphicManager.getBlankArtwork().getName())) {
+ return null;
+ }
return this.textAndGraphicManager.getSecondaryGraphic();
}
@@ -353,7 +363,7 @@ abstract class BaseScreenManager extends BaseSubManager {
/**
* Sets the title of the new template that will be displayed.
* Sending an empty String "" will clear the field
- * @param title the title of the new template that will be displayed. Maxlength: 100.
+ * @param title the title of the new template that will be displayed. MaxLength: 100.
*/
public void setTitle(String title){
this.textAndGraphicManager.setTitle(title);
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java
index da2ed1173..690e8e5b9 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java
@@ -37,12 +37,12 @@ import com.livio.taskmaster.Queue;
import com.livio.taskmaster.Task;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.lifecycle.OnSystemCapabilityListener;
+import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
import com.smartdevicelink.proxy.rpc.DisplayCapability;
import com.smartdevicelink.proxy.rpc.OnButtonEvent;
import com.smartdevicelink.proxy.rpc.OnButtonPress;
@@ -136,7 +136,11 @@ abstract class BaseSoftButtonManager extends BaseSubManager {
for (WindowCapability windowCapability : mainDisplay.getWindowCapabilities()) {
int currentWindowID = windowCapability.getWindowID() != null ? windowCapability.getWindowID() : PredefinedWindows.DEFAULT_WINDOW.getValue();
if (currentWindowID == PredefinedWindows.DEFAULT_WINDOW.getValue()) {
- softButtonCapabilities = windowCapability.getSoftButtonCapabilities().get(0);
+ if (windowCapability.getSoftButtonCapabilities() != null && windowCapability.getSoftButtonCapabilities().size() > 0) {
+ softButtonCapabilities = windowCapability.getSoftButtonCapabilities().get(0);
+ } else {
+ softButtonCapabilities = null;
+ }
break;
}
}
@@ -161,7 +165,9 @@ abstract class BaseSoftButtonManager extends BaseSubManager {
updateTransactionQueueSuspended();
}
};
- this.internalInterface.addOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplayCapabilityListener);
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ this.internalInterface.getSystemCapabilityManager().addOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplayCapabilityListener);
+ }
// Add OnButtonPressListener to notify SoftButtonObjects when there is a button press
this.onButtonPressListener = new OnRPCNotificationListener() {
@@ -232,7 +238,9 @@ abstract class BaseSoftButtonManager extends BaseSubManager {
internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, onHMIStatusListener);
internalInterface.removeOnRPCNotificationListener(FunctionID.ON_BUTTON_PRESS, onButtonPressListener);
internalInterface.removeOnRPCNotificationListener(FunctionID.ON_BUTTON_EVENT, onButtonEventListener);
- internalInterface.removeOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplayCapabilityListener);
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ internalInterface.getSystemCapabilityManager().removeOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplayCapabilityListener);
+ }
}
private Queue newTransactionQueue() {
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseSubscribeButtonManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseSubscribeButtonManager.java
index ba9e8aa53..05addbffe 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/BaseSubscribeButtonManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseSubscribeButtonManager.java
@@ -4,16 +4,15 @@ import androidx.annotation.NonNull;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
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.rpc.OnButtonEvent;
import com.smartdevicelink.proxy.rpc.OnButtonPress;
import com.smartdevicelink.proxy.rpc.SubscribeButton;
import com.smartdevicelink.proxy.rpc.UnsubscribeButton;
import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.proxy.rpc.enums.Result;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
import com.smartdevicelink.util.DebugTool;
@@ -29,7 +28,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
abstract class BaseSubscribeButtonManager extends BaseSubManager {
private static final String TAG = "SubscribeButtonManager";
- HashMap<ButtonName, CopyOnWriteArrayList<OnButtonListener>> onButtonListeners;
+ final HashMap<ButtonName, CopyOnWriteArrayList<OnButtonListener>> onButtonListeners;
private OnRPCNotificationListener onButtonPressListener;
private OnRPCNotificationListener onButtonEventListener;
@@ -124,12 +123,11 @@ abstract class BaseSubscribeButtonManager extends BaseSubManager {
unsubscribeButtonRequest.setOnRPCResponseListener(new OnRPCResponseListener() {
@Override
public void onResponse(int correlationId, RPCResponse response) {
- onButtonListeners.remove(buttonName);
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- listener.onError("Attempt to unsubscribe to button named " + buttonName + " Failed. ResultCode: " + resultCode + " info: " + info);
+ if (response.getSuccess()) {
+ onButtonListeners.remove(buttonName);
+ } else {
+ listener.onError("Attempt to unsubscribe to button named " + buttonName + " Failed. ResultCode: " + response.getResultCode() + " info: " + response.getInfo());
+ }
}
});
internalInterface.sendRPC(unsubscribeButtonRequest);
@@ -146,13 +144,12 @@ abstract class BaseSubscribeButtonManager extends BaseSubManager {
subscribeButtonRequest.setOnRPCResponseListener(new OnRPCResponseListener() {
@Override
public void onResponse(int correlationId, RPCResponse response) {
- onButtonListeners.put(buttonName, new CopyOnWriteArrayList<OnButtonListener>());
- onButtonListeners.get(buttonName).add(listener);
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- listener.onError("Attempt to subscribe to button named " + buttonName + " Failed . ResultCode: " + resultCode + " info: " + info);
+ if (response.getSuccess()) {
+ onButtonListeners.put(buttonName, new CopyOnWriteArrayList<OnButtonListener>());
+ onButtonListeners.get(buttonName).add(listener);
+ } else {
+ listener.onError("Attempt to subscribe to button named " + buttonName + " Failed . ResultCode: " + response.getResultCode() + " info: " + response.getInfo());
+ }
}
});
internalInterface.sendRPC(subscribeButtonRequest);
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
index 654d03f2f..3542dd269 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019 Livio, Inc.
+ * Copyright (c) 2019 - 2020 Livio, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,62 +33,51 @@ package com.smartdevicelink.managers.screen;
import androidx.annotation.NonNull;
+import com.livio.taskmaster.Queue;
+import com.livio.taskmaster.Task;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.managers.ManagerUtility;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.managers.lifecycle.OnSystemCapabilityListener;
+import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
import com.smartdevicelink.proxy.rpc.DisplayCapability;
-import com.smartdevicelink.proxy.rpc.MetadataTags;
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
import com.smartdevicelink.proxy.rpc.Show;
import com.smartdevicelink.proxy.rpc.WindowCapability;
import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
import com.smartdevicelink.proxy.rpc.enums.MetadataType;
import com.smartdevicelink.proxy.rpc.enums.PredefinedWindows;
-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.CompareUtils;
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>
- *
+ * <p>
* 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;
+ boolean isDirty;
+ Show currentScreenData;
HMILevel currentHMILevel;
+ private final WeakReference<SoftButtonManager> softButtonManager;
WindowCapability defaultMainWindowCapability;
- private boolean pendingHMIFull, batchingUpdates;
+ private boolean batchingUpdates;
private final WeakReference<FileManager> fileManager;
- private final WeakReference<SoftButtonManager> softButtonManager;
- private CompletionListener queuedUpdateListener, inProgressListener, pendingHMIListener;
SdlArtwork blankArtwork;
private OnRPCNotificationListener hmiListener;
private OnSystemCapabilityListener onDisplaysCapabilityListener;
@@ -96,6 +85,9 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
private TextAlignment textAlignment;
private String textField1, textField2, textField3, textField4, mediaTrackTextField, title;
private MetadataType textField1Type, textField2Type, textField3Type, textField4Type;
+ TextAndGraphicUpdateOperation updateOperation;
+ private CompletionListener currentOperationListener;
+ Queue transactionQueue;
//Constructors
@@ -106,12 +98,11 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
this.softButtonManager = new WeakReference<>(softButtonManager);
batchingUpdates = false;
isDirty = false;
- pendingHMIFull = false;
textAlignment = CENTERED;
currentHMILevel = HMILevel.HMI_NONE;
currentScreenData = new Show();
+ this.transactionQueue = newTransactionQueue();
addListeners();
- getBlankArtwork();
}
@Override
@@ -121,8 +112,7 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
}
@Override
- public void dispose(){
-
+ public void dispose() {
textField1 = null;
textField1Type = null;
textField2 = null;
@@ -138,83 +128,51 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
secondaryGraphic = null;
blankArtwork = null;
defaultMainWindowCapability = null;
- inProgressUpdate = null;
- queuedImageUpdate = null;
currentScreenData = null;
- queuedUpdateListener = null;
- pendingHMIListener = null;
- inProgressListener = null;
- hasQueuedUpdate = false;
isDirty = false;
- pendingHMIFull = false;
+ updateOperation = null;
+
+ // Cancel the operations
+ if (transactionQueue != null) {
+ transactionQueue.close();
+ transactionQueue = null;
+ }
// remove listeners
internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
- internalInterface.removeOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplaysCapabilityListener);
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ internalInterface.getSystemCapabilityManager().removeOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplaysCapabilityListener);
+ }
super.dispose();
}
- private void addListeners() {
- // add listener
- hmiListener = new OnRPCNotificationListener() {
- @Override
- public void onNotified(RPCNotification notification) {
- OnHMIStatus onHMIStatus = (OnHMIStatus)notification;
- if (onHMIStatus.getWindowID() != null && onHMIStatus.getWindowID() != PredefinedWindows.DEFAULT_WINDOW.getValue()) {
- return;
- }
- currentHMILevel = onHMIStatus.getHmiLevel();
- if (currentHMILevel == HMILevel.HMI_FULL){
- if (pendingHMIFull){
- DebugTool.logInfo(TAG, "Acquired HMI_FULL with pending update. Sending now");
- pendingHMIFull = false;
- sdlUpdate(pendingHMIListener);
- pendingHMIListener = null;
- }
- }
- }
- };
- internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
-
-
- onDisplaysCapabilityListener = new OnSystemCapabilityListener() {
- @Override
- public void onCapabilityRetrieved(Object capability) {
- // instead of using the parameter it's more safe to use the convenience method
- List<DisplayCapability> capabilities = SystemCapabilityManager.convertToList(capability, DisplayCapability.class);
- if (capabilities == null || capabilities.size() == 0) {
- DebugTool.logError(TAG, "TextAndGraphic Manager - Capabilities sent here are null or empty");
- }else {
- DisplayCapability display = capabilities.get(0);
- for (WindowCapability windowCapability : display.getWindowCapabilities()) {
- int currentWindowID = windowCapability.getWindowID() != null ? windowCapability.getWindowID() : PredefinedWindows.DEFAULT_WINDOW.getValue();
- if (currentWindowID == PredefinedWindows.DEFAULT_WINDOW.getValue()) {
- defaultMainWindowCapability = windowCapability;
- }
- }
- }
- }
+ private Queue newTransactionQueue() {
+ Queue queue = internalInterface.getTaskmaster().createQueue("TextAndGraphicManager", 3, false);
+ queue.pause();
+ return queue;
+ }
- @Override
- public void onError(String info) {
- DebugTool.logError(TAG, "Display Capability cannot be retrieved");
- defaultMainWindowCapability = null;
- }
- };
- this.internalInterface.addOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplaysCapabilityListener);
+ // Suspend the queue if the WindowCapabilities are null
+ // OR if the HMI level is NONE since we want to delay sending RPCs until we're in non-NONE
+ private void updateTransactionQueueSuspended() {
+ if (defaultMainWindowCapability == null || HMILevel.HMI_NONE.equals(currentHMILevel)) {
+ DebugTool.logInfo(TAG, String.format("Suspending the transaction queue. Current HMI level is NONE: %b, window capabilities are null: %b", HMILevel.HMI_NONE.equals(currentHMILevel), defaultMainWindowCapability == null));
+ transactionQueue.pause();
+ } else {
+ DebugTool.logInfo(TAG, "Starting the transaction queue");
+ transactionQueue.resume();
+ }
}
// Upload / Send
protected void update(CompletionListener listener) {
-
// check if is batch update
if (batchingUpdates) {
return;
}
-
- if (isDirty){
+ if (isDirty) {
isDirty = false;
sdlUpdate(listener);
} else if (listener != null) {
@@ -222,759 +180,332 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
}
}
- 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;
+ private synchronized void sdlUpdate(final CompletionListener listener) {
+ if (this.transactionQueue.getTasksAsList().size() > 0) {
+ // Transactions already in queue, we need to clear it out
+ transactionQueue.clear();
+ updateOperation = null;
+ if (currentOperationListener != null) {
+ currentOperationListener.onComplete(false);
}
- 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;
+ // Task can be READY, about to start and popped of the queue, so we have to cancel it, to prevent it from starting
+ if (updateOperation != null && updateOperation.getState() == Task.READY) {
+ updateOperation.cancelTask();
+ if (currentOperationListener != null) {
+ currentOperationListener.onComplete(false);
}
-
- 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){
- DebugTool.logError(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;
+ // If Task is IN_PROGRESS, it’s not on the queue, we need to mark it as cancelled. The task will return at some point when it checks its status and call the listener back
+ if (updateOperation != null && updateOperation.getState() == Task.IN_PROGRESS) {
+ updateOperation.cancelTask();
}
- }
- private void sendShow(){
- inProgressUpdate.setOnRPCResponseListener(new OnRPCResponseListener() {
- @Override
- public void onResponse(int correlationId, RPCResponse response) {
- handleResponse(response.getSuccess());
- }
+ currentOperationListener = listener;
+ CurrentScreenDataUpdatedListener currentScreenDataUpdateListener = new CurrentScreenDataUpdatedListener() {
@Override
- public void onError(int correlationId, Result resultCode, String info) {
- handleResponse(false);
+ public void onUpdate(Show show) {
+ updatePendingOperationsWithNewScreenData(show);
+ currentScreenData = show;
}
+ };
- 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.sendRPC(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(TAG, "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) {
- DebugTool.logError(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 && shouldUpdateMediaTrackField()) {
- show.setMediaTrack(mediaTrackTextField);
- }
-
- if (title != null && shouldUpdateTitleField()) {
- show.setTemplateTitle(title);
- }
-
- List<String> nonNullFields = findValidMainTextFields();
- if (nonNullFields.isEmpty()){
- return show;
- }
-
- int numberOfLines = defaultMainWindowCapability != null ? ManagerUtility.WindowCapabilityUtility.getMaxNumberOfMainFieldLines(defaultMainWindowCapability) : 4;
-
- 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;
+ updateOperation = new TextAndGraphicUpdateOperation(internalInterface, fileManager.get(), defaultMainWindowCapability, currentScreenData, currentState(), currentOperationListener, currentScreenDataUpdateListener);
+ transactionQueue.add(updateOperation, false);
}
- private Show assembleFourLineShowText(Show show){
-
- MetadataTags tags = new MetadataTags();
-
- if (textField1 != null && textField1.length() > 0) {
- show.setMainField1(textField1);
- if (textField1Type != null){
- tags.setMainField1(textField1Type);
+ //Updates pending task with current screen data
+ void updatePendingOperationsWithNewScreenData(Show newScreenData) {
+ for (Task task : transactionQueue.getTasksAsList()) {
+ if (!(task instanceof TextAndGraphicUpdateOperation)) {
+ continue;
}
+ ((TextAndGraphicUpdateOperation) task).setCurrentScreenData(newScreenData);
}
-
- if (textField2 != null && textField2.length() > 0) {
- show.setMainField2(textField2);
- if (textField2Type != null){
- tags.setMainField2(textField2Type);
- }
+ if (this.softButtonManager.get() != null && newScreenData.getMainField1() != null) {
+ this.softButtonManager.get().setCurrentMainField1(currentScreenData.getMainField1());
}
-
- 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());
- newShow.setTemplateTitle(show.getTemplateTitle());
-
- return newShow;
- }
-
- private Show setBlankTextFields(Show newShow){
-
- newShow.setMainField1("");
- newShow.setMainField2("");
- newShow.setMainField3("");
- newShow.setMainField4("");
- newShow.setMediaTrack("");
- newShow.setTemplateTitle("");
-
- return newShow;
+ interface CurrentScreenDataUpdatedListener {
+ void onUpdate(Show show);
}
- private void updateCurrentScreenDataState(Show show){
-
- if (show == null){
- DebugTool.logError(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.getTemplateTitle() != null){
- currentScreenData.setTemplateTitle(show.getTemplateTitle());
- }
- 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(){
+ private List<String> findNonNullTextFields() {
List<String> array = new ArrayList<>();
- if (textField1 != null && textField1.length() > 0) {
+ if (textField1 != null) {
array.add(textField1);
}
- if (textField2 != null && textField2.length() > 0) {
+ if (textField2 != null) {
array.add(textField2);
}
- if (textField3 != null && textField3.length() > 0) {
+ if (textField3 != null) {
array.add(textField3);
}
- if (textField4 != null && textField4.length() > 0) {
+ if (textField4 != null) {
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 (title != null) {
+ array.add(title);
}
- if (textField3Type != null) {
- array.add(textField3Type);
- }
-
- if (textField4Type != null) {
- array.add(textField4Type);
+ if (mediaTrackTextField != null) {
+ array.add(mediaTrackTextField);
}
return array;
}
- abstract SdlArtwork getBlankArtwork();
+ Boolean hasData() {
+ boolean hasTextFields = (findNonNullTextFields().size() > 0);
+ boolean hasImageFields = (primaryGraphic != null) || (secondaryGraphic != null);
- @SuppressWarnings("BooleanMethodIsAlwaysInverted")
- private boolean sdlArtworkNeedsUpload(SdlArtwork artwork){
- if (fileManager.get() != null) {
- return artwork != null && !fileManager.get().hasUploadedFile(artwork) && !artwork.isStaticIcon();
- }
- return false;
+ return hasTextFields || hasImageFields;
}
- /**
- * Check to see if primaryGraphic should be updated
- * @return true if primaryGraphic should be updated, false if not
- */
- private boolean shouldUpdatePrimaryImage() {
- boolean templateSupportsPrimaryArtwork = templateSupportsImageField(ImageFieldName.graphic);
-
- String currentScreenDataPrimaryGraphicName = (currentScreenData != null && currentScreenData.getGraphic() != null) ? currentScreenData.getGraphic().getValue() : null;
- String primaryGraphicName = primaryGraphic != null ? primaryGraphic.getName() : null;
- return templateSupportsPrimaryArtwork
- && !CompareUtils.areStringsEqual(currentScreenDataPrimaryGraphicName, primaryGraphicName, true, true)
- && primaryGraphic != null;
- }
-
- /**
- * Check to see if secondaryGraphic should be updated
- * @return true if secondaryGraphic should be updated, false if not
- */
- private boolean shouldUpdateSecondaryImage() {
- boolean templateSupportsSecondaryArtwork = (templateSupportsImageField(ImageFieldName.graphic) || templateSupportsImageField(ImageFieldName.secondaryGraphic));
-
- String currentScreenDataSecondaryGraphicName = (currentScreenData != null && currentScreenData.getSecondaryGraphic() != null) ? currentScreenData.getSecondaryGraphic().getValue() : null;
- String secondaryGraphicName = secondaryGraphic != null ? secondaryGraphic.getName() : null;
- return templateSupportsSecondaryArtwork
- && !CompareUtils.areStringsEqual(currentScreenDataSecondaryGraphicName, secondaryGraphicName, true, true)
- && secondaryGraphic != null;
- }
-
- /**
- * Check to see if template supports the specified image field
- * @return true if image field is supported, false if not
- */
- private boolean templateSupportsImageField(ImageFieldName name) {
- return defaultMainWindowCapability == null || ManagerUtility.WindowCapabilityUtility.hasImageFieldOfName(defaultMainWindowCapability, name);
- }
+ abstract SdlArtwork getBlankArtwork();
- /**
- * Check to see if mediaTrackTextField should be updated
- * @return true if mediaTrackTextField should be updated, false if not
- */
- private boolean shouldUpdateMediaTrackField() {
- return templateSupportsTextField(TextFieldName.mediaTrack);
- }
- /**
- * Check to see if title should be updated
- * @return true if title should be updated, false if not
- */
- private boolean shouldUpdateTitleField() {
- return templateSupportsTextField(TextFieldName.templateTitle);
- }
+ // Convert to State
- /**
- * Check to see if field should be updated
- * @return true if field should be updated, false if not
- */
- private boolean templateSupportsTextField(TextFieldName name) {
- return defaultMainWindowCapability == null || ManagerUtility.WindowCapabilityUtility.hasTextFieldOfName(defaultMainWindowCapability, name);
+ private TextsAndGraphicsState currentState() {
+ return new TextsAndGraphicsState(textField1, textField2, textField3, textField4, mediaTrackTextField,
+ title, primaryGraphic, secondaryGraphic, textAlignment, textField1Type, textField2Type, textField3Type, textField4Type);
}
- // SCREEN ITEM SETTERS AND GETTERS
+ // Getters / Setters
- void setTextAlignment(TextAlignment textAlignment){
+ 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){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- TextAlignment getTextAlignment(){
+ TextAlignment getTextAlignment() {
return textAlignment;
}
- void setMediaTrackTextField(String mediaTrackTextField){
+ void setMediaTrackTextField(String mediaTrackTextField) {
this.mediaTrackTextField = mediaTrackTextField;
- if (!batchingUpdates){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- String getMediaTrackTextField(){
+ String getMediaTrackTextField() {
return mediaTrackTextField;
}
- void setTextField1(String textField1){
+ void setTextField1(String textField1) {
this.textField1 = textField1;
- if (!batchingUpdates){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- String getTextField1(){
+ String getTextField1() {
return textField1;
}
- void setTextField2(String textField2){
+ void setTextField2(String textField2) {
this.textField2 = textField2;
- if (!batchingUpdates){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- String getTextField2(){
+ String getTextField2() {
return textField2;
}
- void setTextField3(String textField3){
+ void setTextField3(String textField3) {
this.textField3 = textField3;
- if (!batchingUpdates){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- String getTextField3(){
+ String getTextField3() {
return textField3;
}
- void setTextField4(String textField4){
+ void setTextField4(String textField4) {
this.textField4 = textField4;
- if (!batchingUpdates){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- String getTextField4(){
+ String getTextField4() {
return textField4;
}
- void setTextField1Type(MetadataType textField1Type){
+ void setTextField1Type(MetadataType textField1Type) {
this.textField1Type = textField1Type;
- if (!batchingUpdates){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- MetadataType getTextField1Type(){
+ MetadataType getTextField1Type() {
return textField1Type;
}
- void setTextField2Type(MetadataType textField2Type){
+ void setTextField2Type(MetadataType textField2Type) {
this.textField2Type = textField2Type;
- if (!batchingUpdates){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- MetadataType getTextField2Type(){
+ MetadataType getTextField2Type() {
return textField2Type;
}
- void setTextField3Type(MetadataType textField3Type){
+ void setTextField3Type(MetadataType textField3Type) {
this.textField3Type = textField3Type;
- if (!batchingUpdates){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- MetadataType getTextField3Type(){
+ MetadataType getTextField3Type() {
return textField3Type;
}
- void setTextField4Type(MetadataType textField4Type){
+ void setTextField4Type(MetadataType textField4Type) {
this.textField4Type = textField4Type;
- if (!batchingUpdates){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- MetadataType getTextField4Type(){
+ MetadataType getTextField4Type() {
return textField4Type;
}
- void setTitle(String title){
+ void setTitle(String title) {
this.title = title;
- if (!batchingUpdates){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- String getTitle(){
+ String getTitle() {
return title;
}
- void setPrimaryGraphic(SdlArtwork primaryGraphic){
+ void setPrimaryGraphic(SdlArtwork primaryGraphic) {
this.primaryGraphic = primaryGraphic;
- if (!batchingUpdates){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- SdlArtwork getPrimaryGraphic(){
+ SdlArtwork getPrimaryGraphic() {
return primaryGraphic;
}
- void setSecondaryGraphic(SdlArtwork secondaryGraphic){
+ void setSecondaryGraphic(SdlArtwork secondaryGraphic) {
this.secondaryGraphic = secondaryGraphic;
- if (!batchingUpdates){
+ if (!batchingUpdates) {
sdlUpdate(null);
- }else{
+ } else {
isDirty = true;
}
}
- SdlArtwork getSecondaryGraphic(){
+ SdlArtwork getSecondaryGraphic() {
return secondaryGraphic;
}
- void setBatchUpdates(boolean batching){
+ void setBatchUpdates(boolean batching) {
this.batchingUpdates = batching;
}
+ private void addListeners() {
+ // add listener
+ hmiListener = new OnRPCNotificationListener() {
+ @Override
+ public void onNotified(RPCNotification notification) {
+ OnHMIStatus onHMIStatus = (OnHMIStatus) notification;
+ if (onHMIStatus.getWindowID() != null && onHMIStatus.getWindowID() != PredefinedWindows.DEFAULT_WINDOW.getValue()) {
+ return;
+ }
+ currentHMILevel = onHMIStatus.getHmiLevel();
+ updateTransactionQueueSuspended();
+ }
+ };
+ internalInterface.addOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
+
+ onDisplaysCapabilityListener = new OnSystemCapabilityListener() {
+ @Override
+ public void onCapabilityRetrieved(Object capability) {
+ // instead of using the parameter it's more safe to use the convenience method
+ List<DisplayCapability> capabilities = SystemCapabilityManager.convertToList(capability, DisplayCapability.class);
+ if (capabilities == null || capabilities.size() == 0) {
+ DebugTool.logError(TAG, "TextAndGraphic Manager - Capabilities sent here are null or empty");
+ defaultMainWindowCapability = null;
+ } else {
+ DisplayCapability display = capabilities.get(0);
+ for (WindowCapability windowCapability : display.getWindowCapabilities()) {
+ int currentWindowID = windowCapability.getWindowID() != null ? windowCapability.getWindowID() : PredefinedWindows.DEFAULT_WINDOW.getValue();
+ if (currentWindowID == PredefinedWindows.DEFAULT_WINDOW.getValue()) {
+ defaultMainWindowCapability = windowCapability;
+ }
+ }
+ }
+ // Update the queue's suspend state
+ updateTransactionQueueSuspended();
+ if (hasData()) {
+ sdlUpdate(null);
+ }
+ }
+
+ @Override
+ public void onError(String info) {
+ DebugTool.logError(TAG, "Display Capability cannot be retrieved");
+ defaultMainWindowCapability = null;
+ updateTransactionQueueSuspended();
+ }
+ };
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ this.internalInterface.getSystemCapabilityManager().addOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplaysCapabilityListener);
+ }
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java
index 7b5befb3d..6f8a9593e 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonObject.java
@@ -51,9 +51,9 @@ import java.util.List;
*/
public class SoftButtonObject {
private static final String TAG = "SoftButtonObject";
- static int SOFT_BUTTON_ID_NOT_SET_VALUE = -1;
- static int SOFT_BUTTON_ID_MIN_VALUE = 0;
- static int SOFT_BUTTON_ID_MAX_VALUE = 65535;
+ static final int SOFT_BUTTON_ID_NOT_SET_VALUE = -1;
+ static final int SOFT_BUTTON_ID_MIN_VALUE = 0;
+ static final int SOFT_BUTTON_ID_MAX_VALUE = 65535;
private String name;
private List<SoftButtonState> states;
private String currentStateName;
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonReplaceOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonReplaceOperation.java
index 106806562..73658b257 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonReplaceOperation.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonReplaceOperation.java
@@ -2,15 +2,14 @@ package com.smartdevicelink.managers.screen;
import com.livio.taskmaster.Task;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.file.FileManager;
import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.interfaces.ISdl;
import com.smartdevicelink.proxy.rpc.Show;
import com.smartdevicelink.proxy.rpc.SoftButton;
import com.smartdevicelink.proxy.rpc.SoftButtonCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.Result;
import com.smartdevicelink.proxy.rpc.enums.SoftButtonType;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
import com.smartdevicelink.util.DebugTool;
@@ -229,14 +228,6 @@ class SoftButtonReplaceOperation extends Task {
completionListener.onComplete(response.getSuccess());
}
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- DebugTool.logWarning(TAG, "Failed to update soft buttons with text buttons");
- if (completionListener != null) {
- completionListener.onComplete(false);
- }
- }
});
show.setMainField1(currentMainField1);
show.setSoftButtons(softButtons);
@@ -285,14 +276,6 @@ class SoftButtonReplaceOperation extends Task {
completionListener.onComplete(response.getSuccess());
}
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- DebugTool.logWarning(TAG, "Failed to update soft buttons with text buttons");
- if (completionListener != null) {
- completionListener.onComplete(false);
- }
- }
});
show.setMainField1(currentMainField1);
show.setSoftButtons(textButtons);
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonTransitionOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonTransitionOperation.java
index 355c6aeaf..458677269 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonTransitionOperation.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/SoftButtonTransitionOperation.java
@@ -1,11 +1,10 @@
package com.smartdevicelink.managers.screen;
import com.livio.taskmaster.Task;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.interfaces.ISdl;
import com.smartdevicelink.proxy.rpc.Show;
import com.smartdevicelink.proxy.rpc.SoftButton;
-import com.smartdevicelink.proxy.rpc.enums.Result;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
import com.smartdevicelink.util.DebugTool;
@@ -53,13 +52,6 @@ class SoftButtonTransitionOperation extends Task {
}
onFinished();
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- super.onError(correlationId, resultCode, info);
- DebugTool.logWarning(TAG, "Failed to transition soft button to new state. " + info);
- onFinished();
- }
});
show.setMainField1(currentMainField1);
show.setSoftButtons(currentStateSoftButtonsForObjects(softButtonObjects));
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
new file mode 100644
index 000000000..a4e1348c8
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicUpdateOperation.java
@@ -0,0 +1,638 @@
+package com.smartdevicelink.managers.screen;
+
+import com.livio.taskmaster.Task;
+import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
+import com.smartdevicelink.managers.ManagerUtility;
+import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.MetadataTags;
+import com.smartdevicelink.proxy.rpc.Show;
+import com.smartdevicelink.proxy.rpc.WindowCapability;
+import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
+import com.smartdevicelink.proxy.rpc.enums.MetadataType;
+import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
+import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
+import com.smartdevicelink.util.CompareUtils;
+import com.smartdevicelink.util.DebugTool;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by Julian Kast on 8/23/20.
+ */
+class TextAndGraphicUpdateOperation extends Task {
+
+ private static final String TAG = "TextAndGraphicUpdateOperation";
+ private final WeakReference<ISdl> internalInterface;
+ private final WeakReference<FileManager> fileManager;
+ WindowCapability defaultMainWindowCapability;
+ private Show currentScreenData;
+ private final TextsAndGraphicsState updatedState;
+ private final CompletionListener listener;
+ private final TextAndGraphicManager.CurrentScreenDataUpdatedListener currentScreenDataUpdateListener;
+
+ TextAndGraphicUpdateOperation(ISdl internalInterface, FileManager fileManager, WindowCapability currentCapabilities,
+ Show currentScreenData, TextsAndGraphicsState newState, CompletionListener listener, TextAndGraphicManager.CurrentScreenDataUpdatedListener currentScreenDataUpdateListener) {
+ super("TextAndGraphicUpdateOperation");
+ this.internalInterface = new WeakReference<>(internalInterface);
+ this.fileManager = new WeakReference<>(fileManager);
+ this.defaultMainWindowCapability = currentCapabilities;
+ this.currentScreenData = currentScreenData;
+ this.updatedState = newState;
+ this.listener = listener;
+ this.currentScreenDataUpdateListener = currentScreenDataUpdateListener;
+ }
+
+ @Override
+ public void onExecute() {
+ start();
+ }
+
+ private void start() {
+ if (getState() == Task.CANCELED) {
+ finishOperation(false);
+ return;
+ }
+
+ // Build a show with everything from `self.newState`, we'll pull things out later if we can.
+ Show fullShow = new Show();
+ fullShow.setAlignment(updatedState.getTextAlignment());
+ fullShow = assembleShowText(fullShow);
+ fullShow = assembleShowImages(fullShow);
+
+ if (!shouldUpdatePrimaryImage() && !shouldUpdateSecondaryImage()) {
+ DebugTool.logInfo(TAG, "No images to send, sending text");
+ // If there are no images to update, just send the text
+ sendShow(extractTextFromShow(fullShow), new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ finishOperation(success);
+ }
+ });
+
+ } else if (!sdlArtworkNeedsUpload(updatedState.getPrimaryGraphic()) && !sdlArtworkNeedsUpload(updatedState.getSecondaryGraphic())) {
+ DebugTool.logInfo(TAG, "Images already uploaded, sending full update");
+ // The files to be updated are already uploaded, send the full show immediately
+ sendShow(fullShow, new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ finishOperation(success);
+ }
+ });
+ } else {
+ DebugTool.logInfo(TAG, "Images need to be uploaded, sending text and uploading images");
+
+ sendShow(extractTextFromShow(fullShow), new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ if (getState() == Task.CANCELED) {
+ finishOperation(false);
+ return;
+ }
+ uploadImagesAndSendWhenDone(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ finishOperation(success);
+ }
+ });
+
+ }
+ });
+ }
+ }
+
+ private void sendShow(final Show show, final CompletionListener listener) {
+ show.setOnRPCResponseListener(new OnRPCResponseListener() {
+ @Override
+ public void onResponse(int correlationId, RPCResponse response) {
+ DebugTool.logInfo(TAG, "Text and Graphic update completed");
+ if (response.getSuccess()) {
+ updateCurrentScreenDataFromShow(show);
+ }
+ listener.onComplete(response.getSuccess());
+
+ }
+ });
+ internalInterface.get().sendRPC(show);
+ }
+
+
+ private void uploadImagesAndSendWhenDone(final CompletionListener listener) {
+ uploadImages(new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ Show showWithGraphics = createImageOnlyShowWithPrimaryArtwork(updatedState.getPrimaryGraphic(), updatedState.getSecondaryGraphic());
+ if (showWithGraphics != null) {
+ DebugTool.logInfo(TAG, "Sending update with the successfully uploaded images");
+ sendShow(showWithGraphics, new CompletionListener() {
+ @Override
+ public void onComplete(boolean success) {
+ listener.onComplete(success);
+ }
+ });
+ } else {
+ DebugTool.logWarning(TAG, "All images failed to upload. No graphics to show, skipping update.");
+ listener.onComplete(false);
+ }
+ }
+ });
+ }
+
+ private void uploadImages(final CompletionListener listener) {
+ List<SdlArtwork> artworksToUpload = new ArrayList<>();
+
+ // add primary image
+ if (shouldUpdatePrimaryImage() && !updatedState.getPrimaryGraphic().isStaticIcon()) {
+ artworksToUpload.add(updatedState.getPrimaryGraphic());
+ }
+
+ // add secondary image
+ if (shouldUpdateSecondaryImage() && !updatedState.getSecondaryGraphic().isStaticIcon()) {
+ artworksToUpload.add(updatedState.getSecondaryGraphic());
+ }
+
+ if (artworksToUpload.size() == 0) {
+ DebugTool.logInfo(TAG, "No artworks need an upload, 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 (getState() == Task.CANCELED) {
+ finishOperation(false);
+ return;
+ }
+ if (errors != null) {
+ DebugTool.logError(TAG, "Text and graphic manager artwork failed to upload with error: " + errors.toString());
+ listener.onComplete(false);
+ } else {
+ listener.onComplete(true);
+ }
+ }
+ });
+ }
+ }
+
+ private Show assembleShowImages(Show show) {
+ if (shouldUpdatePrimaryImage()) {
+ show.setGraphic(updatedState.getPrimaryGraphic().getImageRPC());
+ }
+
+ if (shouldUpdateSecondaryImage()) {
+ show.setSecondaryGraphic(updatedState.getSecondaryGraphic().getImageRPC());
+ }
+
+ return show;
+ }
+
+ Show createImageOnlyShowWithPrimaryArtwork(SdlArtwork primaryArtwork, SdlArtwork secondaryArtwork) {
+ Show newShow = new Show();
+ newShow.setGraphic((primaryArtwork != null && !(sdlArtworkNeedsUpload(primaryArtwork))) ? primaryArtwork.getImageRPC() : null);
+ newShow.setSecondaryGraphic((secondaryArtwork != null && !(sdlArtworkNeedsUpload(secondaryArtwork))) ? secondaryArtwork.getImageRPC() : null);
+ if (newShow.getGraphic() == null && newShow.getSecondaryGraphic() == null) {
+ DebugTool.logInfo(TAG, "No graphics to upload");
+ return null;
+ }
+ return newShow;
+ }
+
+ Show assembleShowText(Show show) {
+ show = setBlankTextFields(show);
+
+ if (updatedState.getMediaTrackTextField() != null && shouldUpdateMediaTrackField()) {
+ show.setMediaTrack(updatedState.getMediaTrackTextField());
+ }
+
+ if (updatedState.getTitle() != null && shouldUpdateTitleField()) {
+ show.setTemplateTitle(updatedState.getTitle());
+ }
+
+ List<String> nonNullFields = findValidMainTextFields();
+ if (nonNullFields.isEmpty()) {
+ return show;
+ }
+
+ int numberOfLines = defaultMainWindowCapability != null ? ManagerUtility.WindowCapabilityUtility.getMaxNumberOfMainFieldLines(defaultMainWindowCapability) : 4;
+
+ 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 (updatedState.getTextField1() != null && updatedState.getTextField1().length() > 0) {
+ tempString.append(updatedState.getTextField1());
+ if (updatedState.getTextField1Type() != null) {
+ tags.setMainField1(updatedState.getTextField1Type());
+ }
+ }
+
+ if (updatedState.getTextField2() != null && updatedState.getTextField2().length() > 0) {
+ if ((updatedState.getTextField3() == null || !(updatedState.getTextField3().length() > 0)) && (updatedState.getTextField4() == null || !(updatedState.getTextField4().length() > 0))) {
+ // text does not exist in slots 3 or 4, put text2 in slot 2
+ show.setMainField2(updatedState.getTextField2());
+ if (updatedState.getTextField2Type() != null) {
+ tags.setMainField2(updatedState.getTextField2Type());
+ }
+ } else if (updatedState.getTextField1() != null && updatedState.getTextField1().length() > 0) {
+ // If text 1 exists, put it in slot 1 formatted
+ tempString.append(" - ").append(updatedState.getTextField2());
+ if (updatedState.getTextField2Type() != null) {
+ List<MetadataType> typeList = new ArrayList<>();
+ typeList.add(updatedState.getTextField2Type());
+ if (updatedState.getTextField1Type() != null) {
+ typeList.add(updatedState.getTextField1Type());
+ }
+ tags.setMainField1(typeList);
+ }
+ } else {
+ // If text 1 does not exist, put it in slot 1 unformatted
+ tempString.append(updatedState.getTextField2());
+ if (updatedState.getTextField2Type() != null) {
+ tags.setMainField1(updatedState.getTextField2Type());
+ }
+ }
+ }
+
+ // set mainField1
+ show.setMainField1(tempString.toString());
+
+ // new stringBuilder object
+ tempString = new StringBuilder();
+
+ if (updatedState.getTextField3() != null && updatedState.getTextField3().length() > 0) {
+ // If text 3 exists, put it in slot 2
+ tempString.append(updatedState.getTextField3());
+ if (updatedState.getTextField3Type() != null) {
+ List<MetadataType> typeList = new ArrayList<>();
+ typeList.add(updatedState.getTextField3Type());
+ tags.setMainField2(typeList);
+ }
+ }
+
+ if (updatedState.getTextField4() != null && updatedState.getTextField4().length() > 0) {
+ if (updatedState.getTextField3() != null && updatedState.getTextField3().length() > 0) {
+ // If text 3 exists, put it in slot 2 formatted
+ tempString.append(" - ").append(updatedState.getTextField4());
+ if (updatedState.getTextField4Type() != null) {
+ List<MetadataType> typeList = new ArrayList<>();
+ typeList.add(updatedState.getTextField4Type());
+ if (updatedState.getTextField3Type() != null) {
+ typeList.add(updatedState.getTextField3Type());
+ }
+ tags.setMainField2(typeList);
+ }
+ } else {
+ // If text 3 does not exist, put it in slot 3 unformatted
+ tempString.append(updatedState.getTextField4());
+ if (updatedState.getTextField4Type() != null) {
+ tags.setMainField2(updatedState.getTextField4Type());
+ }
+ }
+ }
+
+ if (tempString.toString().length() > 0) {
+ show.setMainField2(tempString.toString());
+ }
+
+ show.setMetadataTags(tags);
+ return show;
+ }
+
+ private Show assembleThreeLineShowText(Show show) {
+ MetadataTags tags = new MetadataTags();
+
+ if (updatedState.getTextField1() != null && updatedState.getTextField1().length() > 0) {
+ show.setMainField1(updatedState.getTextField1());
+ if (updatedState.getTextField1Type() != null) {
+ tags.setMainField1(updatedState.getTextField1Type());
+ }
+ }
+
+ if (updatedState.getTextField2() != null && updatedState.getTextField2().length() > 0) {
+ show.setMainField2(updatedState.getTextField2());
+ if (updatedState.getTextField2Type() != null) {
+ tags.setMainField2(updatedState.getTextField2Type());
+ }
+ }
+
+ StringBuilder tempString = new StringBuilder();
+
+ if (updatedState.getTextField3() != null && updatedState.getTextField3().length() > 0) {
+ tempString.append(updatedState.getTextField3());
+ if (updatedState.getTextField3Type() != null) {
+ tags.setMainField3(updatedState.getTextField3Type());
+ }
+ }
+
+ if (updatedState.getTextField4() != null && updatedState.getTextField4().length() > 0) {
+ if (updatedState.getTextField3() != null && updatedState.getTextField3().length() > 0) {
+ // If text 3 exists, put it in slot 3 formatted
+ tempString.append(" - ").append(updatedState.getTextField4());
+ if (updatedState.getTextField4Type() != null) {
+ List<MetadataType> tags4 = new ArrayList<>();
+ if (updatedState.getTextField3Type() != null) {
+ tags4.add(updatedState.getTextField3Type());
+ }
+ tags4.add(updatedState.getTextField4Type());
+ tags.setMainField3(tags4);
+ }
+ } else {
+ // If text 3 does not exist, put it in slot 3 formatted
+ tempString.append(updatedState.getTextField4());
+ if (updatedState.getTextField4Type() != null) {
+ tags.setMainField3(updatedState.getTextField4Type());
+ }
+ }
+ }
+ show.setMainField3(tempString.toString());
+ show.setMetadataTags(tags);
+ return show;
+ }
+
+ private Show assembleFourLineShowText(Show show) {
+ MetadataTags tags = new MetadataTags();
+ if (updatedState.getTextField1() != null && updatedState.getTextField1().length() > 0) {
+ show.setMainField1(updatedState.getTextField1());
+ if (updatedState.getTextField1Type() != null) {
+ tags.setMainField1(updatedState.getTextField1Type());
+ }
+ }
+
+ if (updatedState.getTextField2() != null && updatedState.getTextField2().length() > 0) {
+ show.setMainField2(updatedState.getTextField2());
+ if (updatedState.getTextField2Type() != null) {
+ tags.setMainField2(updatedState.getTextField2Type());
+ }
+ }
+
+ if (updatedState.getTextField3() != null && updatedState.getTextField3().length() > 0) {
+ show.setMainField3(updatedState.getTextField3());
+ if (updatedState.getTextField3Type() != null) {
+ tags.setMainField3(updatedState.getTextField3Type());
+ }
+ }
+
+ if (updatedState.getTextField4() != null && updatedState.getTextField4().length() > 0) {
+ show.setMainField4(updatedState.getTextField4());
+ if (updatedState.getTextField4Type() != null) {
+ tags.setMainField4(updatedState.getTextField4Type());
+ }
+ }
+
+ 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());
+ newShow.setTemplateTitle(show.getTemplateTitle());
+ newShow.setMetadataTags(show.getMetadataTags());
+ newShow.setAlignment(show.getAlignment());
+
+ return newShow;
+ }
+
+ private Show setBlankTextFields(Show newShow) {
+ newShow.setMainField1("");
+ newShow.setMainField2("");
+ newShow.setMainField3("");
+ newShow.setMainField4("");
+ newShow.setMediaTrack("");
+ newShow.setTemplateTitle("");
+
+ return newShow;
+ }
+
+ private void updateCurrentScreenDataFromShow(Show show) {
+ if (show == null) {
+ DebugTool.logError(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.getTemplateTitle() != null) {
+ currentScreenData.setTemplateTitle(show.getTemplateTitle());
+ }
+ 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());
+ }
+ if (currentScreenDataUpdateListener != null) {
+ currentScreenDataUpdateListener.onUpdate(currentScreenData);
+ }
+ }
+
+ // Helpers
+
+ private List<String> findValidMainTextFields() {
+ List<String> array = new ArrayList<>();
+
+ if (updatedState.getTextField1() != null && updatedState.getTextField1().length() > 0) {
+ array.add(updatedState.getTextField1());
+ }
+
+ if (updatedState.getTextField2() != null && updatedState.getTextField2().length() > 0) {
+ array.add(updatedState.getTextField2());
+ }
+
+ if (updatedState.getTextField3() != null && updatedState.getTextField3().length() > 0) {
+ array.add(updatedState.getTextField3());
+ }
+
+ if (updatedState.getTextField4() != null && updatedState.getTextField4().length() > 0) {
+ array.add(updatedState.getTextField4());
+ }
+
+ return array;
+ }
+
+
+ private List<MetadataType> findNonNullMetadataFields() {
+ List<MetadataType> array = new ArrayList<>();
+
+ if (updatedState.getTextField1Type() != null) {
+ array.add(updatedState.getTextField1Type());
+ }
+
+ if (updatedState.getTextField2Type() != null) {
+ array.add(updatedState.getTextField2Type());
+ }
+
+ if (updatedState.getTextField3Type() != null) {
+ array.add(updatedState.getTextField3Type());
+ }
+
+ if (updatedState.getTextField4Type() != null) {
+ array.add(updatedState.getTextField4Type());
+ }
+
+ return array;
+ }
+
+ @SuppressWarnings("BooleanMethodIsAlwaysInverted")
+ private boolean sdlArtworkNeedsUpload(SdlArtwork artwork) {
+ if (fileManager.get() != null) {
+ return artwork != null && !fileManager.get().hasUploadedFile(artwork) && !artwork.isStaticIcon();
+ }
+ return false;
+ }
+
+ /**
+ * Check to see if primaryGraphic should be updated
+ *
+ * @return true if primaryGraphic should be updated, false if not
+ */
+ private boolean shouldUpdatePrimaryImage() {
+ boolean templateSupportsPrimaryArtwork = templateSupportsImageField(ImageFieldName.graphic);
+ String currentScreenDataPrimaryGraphicName = (currentScreenData != null && currentScreenData.getGraphic() != null) ? currentScreenData.getGraphic().getValue() : null;
+ String primaryGraphicName = updatedState.getPrimaryGraphic() != null ? updatedState.getPrimaryGraphic().getName() : null;
+
+ boolean graphicMatchesExisting = CompareUtils.areStringsEqual(currentScreenDataPrimaryGraphicName, primaryGraphicName, true, true);
+
+ return templateSupportsPrimaryArtwork && !graphicMatchesExisting;
+ }
+
+ /**
+ * Check to see if secondaryGraphic should be updated
+ *
+ * @return true if secondaryGraphic should be updated, false if not
+ */
+ private boolean shouldUpdateSecondaryImage() {
+ boolean templateSupportsSecondaryArtwork = templateSupportsImageField(ImageFieldName.secondaryGraphic);
+ String currentScreenDataSecondaryGraphicName = (currentScreenData != null && currentScreenData.getSecondaryGraphic() != null) ? currentScreenData.getSecondaryGraphic().getValue() : null;
+ String secondaryGraphicName = updatedState.getSecondaryGraphic() != null ? updatedState.getSecondaryGraphic().getName() : null;
+
+ boolean graphicMatchesExisting = CompareUtils.areStringsEqual(currentScreenDataSecondaryGraphicName, secondaryGraphicName, true, true);
+
+ // Cannot detect if there is a secondary image below v5.0, so we'll just try to detect if the primary image is allowed and allow the secondary image if it is.
+ if (internalInterface.get().getSdlMsgVersion().getMajorVersion() >= 5) {
+ return templateSupportsSecondaryArtwork && !graphicMatchesExisting;
+ } else {
+ return templateSupportsImageField(ImageFieldName.graphic) && !graphicMatchesExisting;
+ }
+ }
+
+ /**
+ * Check to see if template supports the specified image field
+ *
+ * @return true if image field is supported, false if not
+ */
+ private boolean templateSupportsImageField(ImageFieldName name) {
+ return defaultMainWindowCapability == null || ManagerUtility.WindowCapabilityUtility.hasImageFieldOfName(defaultMainWindowCapability, name);
+ }
+
+ /**
+ * Check to see if mediaTrackTextField should be updated
+ *
+ * @return true if mediaTrackTextField should be updated, false if not
+ */
+ private boolean shouldUpdateMediaTrackField() {
+ return templateSupportsTextField(TextFieldName.mediaTrack);
+ }
+
+ /**
+ * Check to see if title should be updated
+ *
+ * @return true if title should be updated, false if not
+ */
+ private boolean shouldUpdateTitleField() {
+ return templateSupportsTextField(TextFieldName.templateTitle);
+ }
+
+ /**
+ * Check to see if field should be updated
+ *
+ * @return true if field should be updated, false if not
+ */
+ private boolean templateSupportsTextField(TextFieldName name) {
+ return defaultMainWindowCapability == null || ManagerUtility.WindowCapabilityUtility.hasTextFieldOfName(defaultMainWindowCapability, name);
+ }
+
+ Show getCurrentScreenData() {
+ return currentScreenData;
+ }
+
+ void setCurrentScreenData(Show currentScreenData) {
+ this.currentScreenData = currentScreenData;
+ }
+
+ private void finishOperation(boolean success) {
+ DebugTool.logInfo(TAG, "Finishing text and graphic update operation");
+ if(listener != null){
+ listener.onComplete(success);
+ }
+ onFinished();
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/TextsAndGraphicsState.java b/base/src/main/java/com/smartdevicelink/managers/screen/TextsAndGraphicsState.java
new file mode 100644
index 000000000..601c98832
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/TextsAndGraphicsState.java
@@ -0,0 +1,123 @@
+package com.smartdevicelink.managers.screen;
+
+import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.proxy.rpc.enums.MetadataType;
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
+
+class TextsAndGraphicsState {
+ private String textField1, textField2, textField3, textField4, mediaTrackTextField, title;
+ private MetadataType textField1Type, textField2Type, textField3Type, textField4Type;
+ private final TextAlignment textAlignment;
+ private final SdlArtwork primaryGraphic;
+ private final SdlArtwork secondaryGraphic;
+
+ TextsAndGraphicsState(String textField1, String textField2, String textField3, String textField4, String mediaTrackTextField,
+ String title, SdlArtwork primaryGraphic, SdlArtwork secondaryGraphic, TextAlignment textAlignment,
+ MetadataType textField1Type, MetadataType textField2Type, MetadataType textField3Type, MetadataType textField4Type) {
+ this.textField1 = textField1;
+ this.textField2 = textField2;
+ this.textField3 = textField3;
+ this.textField4 = textField4;
+ this.mediaTrackTextField = mediaTrackTextField;
+ this.title = title;
+ this.primaryGraphic = primaryGraphic;
+ this.secondaryGraphic = secondaryGraphic;
+ this.textAlignment = textAlignment;
+ this.textField1Type = textField1Type;
+ this.textField2Type = textField2Type;
+ this.textField3Type = textField3Type;
+ this.textField4Type = textField4Type;
+ }
+
+ String getTextField1() {
+ return textField1;
+ }
+
+ void setTextField1(String textField1) {
+ this.textField1 = textField1;
+ }
+
+ String getTextField2() {
+ return textField2;
+ }
+
+ void setTextField2(String textField2) {
+ this.textField2 = textField2;
+ }
+
+ String getTextField3() {
+ return textField3;
+ }
+
+ void setTextField3(String textField3) {
+ this.textField3 = textField3;
+ }
+
+ String getTextField4() {
+ return textField4;
+ }
+
+ void setTextField4(String textField4) {
+ this.textField4 = textField4;
+ }
+
+ String getMediaTrackTextField() {
+ return mediaTrackTextField;
+ }
+
+ void setMediaTrackTextField(String mediaTrackTextField) {
+ this.mediaTrackTextField = mediaTrackTextField;
+ }
+
+ String getTitle() {
+ return title;
+ }
+
+ void setTitle(String title) {
+ this.title = title;
+ }
+
+ MetadataType getTextField1Type() {
+ return textField1Type;
+ }
+
+ void setTextField1Type(MetadataType textField1Type) {
+ this.textField1Type = textField1Type;
+ }
+
+ MetadataType getTextField2Type() {
+ return textField2Type;
+ }
+
+ void setTextField2Type(MetadataType textField2Type) {
+ this.textField2Type = textField2Type;
+ }
+
+ MetadataType getTextField3Type() {
+ return textField3Type;
+ }
+
+ void setTextField3Type(MetadataType textField3Type) {
+ this.textField3Type = textField3Type;
+ }
+
+ MetadataType getTextField4Type() {
+ return textField4Type;
+ }
+
+ void setTextField4Type(MetadataType textField4Type) {
+ this.textField4Type = textField4Type;
+ }
+
+ TextAlignment getTextAlignment() {
+ return textAlignment;
+ }
+
+ SdlArtwork getPrimaryGraphic() {
+ return primaryGraphic;
+ }
+
+ SdlArtwork getSecondaryGraphic() {
+ return secondaryGraphic;
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java
index 7de4f3434..b4a10ba33 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/BaseChoiceSetManager.java
@@ -41,12 +41,12 @@ import com.livio.taskmaster.Queue;
import com.livio.taskmaster.Task;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.file.FileManager;
+import com.smartdevicelink.managers.lifecycle.OnSystemCapabilityListener;
+import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
-import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
import com.smartdevicelink.proxy.rpc.DisplayCapability;
import com.smartdevicelink.proxy.rpc.KeyboardProperties;
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
@@ -89,7 +89,7 @@ abstract class BaseChoiceSetManager extends BaseSubManager {
ChoiceSet pendingPresentationSet;
// We will pass operations into this to be completed
- Queue transactionQueue;
+ final Queue transactionQueue;
Task pendingPresentOperation;
PresentKeyboardOperation currentlyPresentedKeyboardOperation;
@@ -149,7 +149,9 @@ abstract class BaseChoiceSetManager extends BaseSubManager {
// remove listeners
internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
- internalInterface.removeOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplayCapabilityListener);
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ internalInterface.getSystemCapabilityManager().removeOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplayCapabilityListener);
+ }
super.dispose();
}
@@ -537,8 +539,10 @@ abstract class BaseChoiceSetManager extends BaseSubManager {
defaultMainWindowCapability = null;
}
};
- this.internalInterface.addOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplayCapabilityListener);
-
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ this.internalInterface.getSystemCapabilityManager().addOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplayCapabilityListener);
+ }
+
// HMI UPDATES
hmiListener = new OnRPCNotificationListener() {
@Override
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperation.java
index 6e606b62d..f99eebc85 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperation.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/CheckChoiceVROptionalOperation.java
@@ -36,12 +36,11 @@
package com.smartdevicelink.managers.screen.choiceset;
import com.livio.taskmaster.Task;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.interfaces.ISdl;
import com.smartdevicelink.proxy.rpc.Choice;
import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet;
import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet;
-import com.smartdevicelink.proxy.rpc.enums.Result;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCResponseListener;
import com.smartdevicelink.util.DebugTool;
@@ -50,8 +49,8 @@ import java.util.Collections;
class CheckChoiceVROptionalOperation extends Task {
private static final String TAG = "CheckChoiceVROptionalOperation";
- private CheckChoiceVROptionalInterface checkChoiceVROptionalInterface;
- private WeakReference<ISdl> internalInterface;
+ private final CheckChoiceVROptionalInterface checkChoiceVROptionalInterface;
+ private final WeakReference<ISdl> internalInterface;
private boolean isVROptional;
CheckChoiceVROptionalOperation(ISdl internalInterface, CheckChoiceVROptionalInterface checkChoiceVROptionalInterface){
@@ -86,12 +85,6 @@ class CheckChoiceVROptionalOperation extends Task {
sendTestChoiceWithVR();
}
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info){
- DebugTool.logWarning(TAG, "Head unit doesn't support choices with no VR. Error: " + info + " resultCode: " + resultCode);
- sendTestChoiceWithVR();
- }
});
if (internalInterface.get() != null) {
@@ -123,17 +116,6 @@ class CheckChoiceVROptionalOperation extends Task {
CheckChoiceVROptionalOperation.super.onFinished();
}
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info){
- DebugTool.logError(TAG, "There was an error in the check choice vr optional operation. Send test choice with VR failed. Error: " + info + " resultCode: " + resultCode);
- isVROptional = false;
- if (checkChoiceVROptionalInterface != null){
- checkChoiceVROptionalInterface.onError(info);
- }
-
- CheckChoiceVROptionalOperation.super.onFinished();
- }
});
if (internalInterface.get() != null) {
@@ -146,24 +128,17 @@ class CheckChoiceVROptionalOperation extends Task {
delete.setOnRPCResponseListener(new OnRPCResponseListener() {
@Override
public void onResponse(int correlationId, RPCResponse response) {
- if (response.getSuccess() != null){
+ if (response.getSuccess()){
DebugTool.logInfo(TAG, "Delete choice test set: "+ response.getSuccess());
+ if (checkChoiceVROptionalInterface != null){
+ checkChoiceVROptionalInterface.onCheckChoiceVROperationComplete(isVROptional);
+ }
+ } else {
+ DebugTool.logError(TAG, "There was an error presenting the keyboard. Finishing operation - choice set manager - . Error: " + response.getInfo() + " resultCode: " + response.getResultCode());
+ if (checkChoiceVROptionalInterface != null){
+ checkChoiceVROptionalInterface.onError(response.getInfo());
+ }
}
-
- if (checkChoiceVROptionalInterface != null){
- checkChoiceVROptionalInterface.onCheckChoiceVROperationComplete(isVROptional);
- }
-
- CheckChoiceVROptionalOperation.super.onFinished();
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info){
- DebugTool.logError(TAG, "There was an error presenting the keyboard. Finishing operation - choice set manager - . Error: " + info + " resultCode: " + resultCode);
- if (checkChoiceVROptionalInterface != null){
- checkChoiceVROptionalInterface.onError(info);
- }
-
CheckChoiceVROptionalOperation.super.onFinished();
}
});
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java
index 6585ad810..f40b57c74 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSet.java
@@ -35,13 +35,14 @@ package com.smartdevicelink.managers.screen.choiceset;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import com.smartdevicelink.proxy.TTSChunkFactory;
import com.smartdevicelink.proxy.rpc.KeyboardProperties;
import com.smartdevicelink.proxy.rpc.TTSChunk;
import com.smartdevicelink.proxy.rpc.VrHelpItem;
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
import com.smartdevicelink.util.DebugTool;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Hashtable;
import java.util.List;
@@ -58,8 +59,8 @@ public class ChoiceSet {
ChoiceSetCanceledListener canceledListener;
// defaults
- private Integer defaultTimeout = 10;
- private ChoiceSetLayout defaultLayout = ChoiceSetLayout.CHOICE_SET_LAYOUT_LIST;
+ private final Integer defaultTimeout = 10;
+ private final ChoiceSetLayout defaultLayout = ChoiceSetLayout.CHOICE_SET_LAYOUT_LIST;
/**
* Initialize with a title, listener, and choices. It will use the default timeout and layout,
@@ -108,15 +109,15 @@ public class ChoiceSet {
// Help the dev by creating TTS chunks for them
if (initialPrompt != null){
- setInitialPrompt(TTSChunkFactory.createSimpleTTSChunks(initialPrompt));
+ setInitialPrompt(Collections.singletonList(new TTSChunk(initialPrompt, SpeechCapabilities.TEXT)));
}
if (timeoutPrompt != null){
- setTimeoutPrompt(TTSChunkFactory.createSimpleTTSChunks(timeoutPrompt));
+ setTimeoutPrompt(Collections.singletonList(new TTSChunk(timeoutPrompt, SpeechCapabilities.TEXT)));
}
if (helpPrompt != null){
- setHelpPrompt(TTSChunkFactory.createSimpleTTSChunks(helpPrompt));
+ setHelpPrompt(Collections.singletonList(new TTSChunk(helpPrompt, SpeechCapabilities.TEXT)));
}
// things to do
@@ -397,5 +398,4 @@ public class ChoiceSet {
}
return clonedHelpItems;
}
-
}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperation.java
index de328b8eb..ad35a1ea5 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperation.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/DeleteChoicesOperation.java
@@ -37,10 +37,9 @@ package com.smartdevicelink.managers.screen.choiceset;
import com.livio.taskmaster.Task;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.interfaces.ISdl;
import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet;
-import com.smartdevicelink.proxy.rpc.enums.Result;
import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
import com.smartdevicelink.util.DebugTool;
@@ -51,9 +50,9 @@ import java.util.List;
class DeleteChoicesOperation extends Task {
private static final String TAG = "DeleteChoicesOperation";
- private WeakReference<ISdl> internalInterface;
- private HashSet<ChoiceCell> cellsToDelete;
- private CompletionListener completionListener;
+ private final WeakReference<ISdl> internalInterface;
+ private final HashSet<ChoiceCell> cellsToDelete;
+ private final CompletionListener completionListener;
DeleteChoicesOperation(ISdl internalInterface, HashSet<ChoiceCell> cellsToDelete, CompletionListener completionListener){
super("DeleteChoicesOperation");
@@ -75,7 +74,7 @@ class DeleteChoicesOperation extends Task {
if (deleteChoices.size() > 0) {
if (internalInterface.get() != null) {
- internalInterface.get().sendRequests(deleteChoices, new OnMultipleRequestListener() {
+ internalInterface.get().sendRPCs(deleteChoices, new OnMultipleRequestListener() {
@Override
public void onUpdate(int remainingRequests) {
}
@@ -91,17 +90,15 @@ class DeleteChoicesOperation extends Task {
}
@Override
- public void onError(int correlationId, Result resultCode, String info) {
- if (completionListener != null) {
- completionListener.onComplete(false);
- }
- DebugTool.logError(TAG, "Failed to delete choice: " + info + " | Corr ID: " + correlationId);
-
- DeleteChoicesOperation.super.onFinished();
- }
-
- @Override
public void onResponse(int correlationId, RPCResponse response) {
+ if (!response.getSuccess()) {
+ if (completionListener != null) {
+ completionListener.onComplete(false);
+ }
+ DebugTool.logError(TAG, "Failed to delete choice: " + response.getInfo() + " | Corr ID: " + correlationId);
+
+ DeleteChoicesOperation.super.onFinished();
+ }
}
});
}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/KeyboardAutocompleteCompletionListener.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/KeyboardAutocompleteCompletionListener.java
index 13b19238d..9178e6c74 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/KeyboardAutocompleteCompletionListener.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/KeyboardAutocompleteCompletionListener.java
@@ -37,14 +37,6 @@ import java.util.List;
public interface KeyboardAutocompleteCompletionListener {
/**
- * This listener is called when you wish to update your autocomplete text in response to the user's input
- * @param updatedAutoCompleteText - The new autocomplete text to use
- * @deprecated use {@link #onUpdatedAutoCompleteList(List<String>)} instead
- */
- @Deprecated
- void onUpdatedAutoCompleteText(String updatedAutoCompleteText);
-
- /**
* This listener is called when you wish to update your autocomplete suggestions list in response to the user's input
* @param updatedAutoCompleteList - The new autocomplete suggestions list to use
*/
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperation.java
index ffce35694..7864ef8de 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperation.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PreloadChoicesOperation.java
@@ -39,19 +39,18 @@ import androidx.annotation.NonNull;
import com.livio.taskmaster.Task;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.managers.ManagerUtility;
import com.smartdevicelink.managers.file.FileManager;
import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.interfaces.ISdl;
import com.smartdevicelink.proxy.rpc.Choice;
import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet;
import com.smartdevicelink.proxy.rpc.Image;
import com.smartdevicelink.proxy.rpc.WindowCapability;
import com.smartdevicelink.proxy.rpc.enums.DisplayType;
import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
-import com.smartdevicelink.proxy.rpc.enums.Result;
import com.smartdevicelink.proxy.rpc.enums.TextFieldName;
import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
import com.smartdevicelink.util.DebugTool;
@@ -65,14 +64,14 @@ import java.util.Map;
class PreloadChoicesOperation extends Task {
private static final String TAG = "PreloadChoicesOperation";
- private WeakReference<ISdl> internalInterface;
- private WeakReference<FileManager> fileManager;
- private WindowCapability defaultMainWindowCapability;
- private String displayName;
- private HashSet<ChoiceCell> cellsToUpload;
- private CompletionListener completionListener;
+ private final WeakReference<ISdl> internalInterface;
+ private final WeakReference<FileManager> fileManager;
+ private final WindowCapability defaultMainWindowCapability;
+ private final String displayName;
+ private final HashSet<ChoiceCell> cellsToUpload;
+ private final CompletionListener completionListener;
private boolean isRunning;
- private boolean isVROptional;
+ private final boolean isVROptional;
private boolean choiceError = false;
PreloadChoicesOperation(ISdl internalInterface, FileManager fileManager, String displayName, WindowCapability defaultMainWindowCapability,
@@ -155,7 +154,7 @@ class PreloadChoicesOperation extends Task {
}
if (internalInterface.get() != null){
- internalInterface.get().sendRequests(choiceRPCs, new OnMultipleRequestListener() {
+ internalInterface.get().sendRPCs(choiceRPCs, new OnMultipleRequestListener() {
@Override
public void onUpdate(int remainingRequests) {
@@ -171,14 +170,11 @@ class PreloadChoicesOperation extends Task {
}
@Override
- public void onError(int correlationId, Result resultCode, String info) {
- DebugTool.logError(TAG, "There was an error uploading a choice cell: "+ info + " resultCode: " + resultCode);
- choiceError = true;
- }
-
- @Override
public void onResponse(int correlationId, RPCResponse response) {
-
+ if (!response.getSuccess()) {
+ DebugTool.logError(TAG, "There was an error uploading a choice cell: "+ response.getInfo() + " resultCode: " + response.getResultCode());
+ choiceError = true;
+ }
}
});
}else{
@@ -230,7 +226,7 @@ class PreloadChoicesOperation extends Task {
// HELPERS
boolean shouldSendChoiceText() {
- if (this.displayName != null && this.displayName.equals(DisplayType.GEN3_8_INCH)){
+ if (this.displayName != null && this.displayName.equals(DisplayType.GEN3_8_INCH.toString())){
return true;
}
return templateSupportsTextField(TextFieldName.menuName);
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperation.java
index 7038a48ab..6efa1b8d1 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperation.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentChoiceSetOperation.java
@@ -37,10 +37,10 @@ package com.smartdevicelink.managers.screen.choiceset;
import com.livio.taskmaster.Task;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
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.rpc.CancelInteraction;
import com.smartdevicelink.proxy.rpc.KeyboardProperties;
import com.smartdevicelink.proxy.rpc.OnKeyboardInput;
@@ -63,19 +63,20 @@ import java.util.List;
class PresentChoiceSetOperation extends Task {
private static final String TAG = "PresentChoiceSetOperation";
- private WeakReference<ISdl> internalInterface;
- private ChoiceSet choiceSet;
- private Integer cancelID;
- private InteractionMode presentationMode;
- private KeyboardProperties originalKeyboardProperties, keyboardProperties;
+ private final WeakReference<ISdl> internalInterface;
+ private final ChoiceSet choiceSet;
+ private final Integer cancelID;
+ private final InteractionMode presentationMode;
+ private final KeyboardProperties originalKeyboardProperties;
+ private KeyboardProperties keyboardProperties;
private ChoiceCell selectedCell;
private TriggerSource selectedTriggerSource;
private boolean updatedKeyboardProperties;
private OnRPCNotificationListener keyboardRPCListener;
- private ChoiceSetSelectionListener choiceSetSelectionListener;
+ private final ChoiceSetSelectionListener choiceSetSelectionListener;
Integer selectedCellRow;
KeyboardListener keyboardListener;
- SdlMsgVersion sdlMsgVersion;
+ final SdlMsgVersion sdlMsgVersion;
PresentChoiceSetOperation(ISdl internalInterface, ChoiceSet choiceSet, InteractionMode mode,
KeyboardProperties originalKeyboardProperties, KeyboardListener keyboardListener, ChoiceSetSelectionListener choiceSetSelectionListener, Integer cancelID){
@@ -159,14 +160,6 @@ class PresentChoiceSetOperation extends Task {
}
DebugTool.logInfo(TAG, "Success Setting keyboard properties in present choice set operation");
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- if (listener != null){
- listener.onComplete(false);
- }
- DebugTool.logError(TAG, "Error Setting keyboard properties in present keyboard operation - choice manager - " + info);
- }
});
if (internalInterface.get() != null){
internalInterface.get().sendRPC(setGlobalProperties);
@@ -187,6 +180,7 @@ class PresentChoiceSetOperation extends Task {
choiceSetSelectionListener.onError(response.getInfo());
}
finishOperation();
+ return;
}
PerformInteractionResponse performInteractionResponse = (PerformInteractionResponse) response;
@@ -199,16 +193,6 @@ class PresentChoiceSetOperation extends Task {
finishOperation();
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- DebugTool.logError(TAG, "Presenting Choice set failed: " + resultCode + ", " + info);
-
- if (choiceSetSelectionListener != null){
- choiceSetSelectionListener.onError(resultCode + ", " + info);
- }
- finishOperation();
- }
});
if (internalInterface.get() != null){
internalInterface.get().sendRPC(pi);
@@ -225,14 +209,12 @@ class PresentChoiceSetOperation extends Task {
setGlobalProperties.setOnRPCResponseListener(new OnRPCResponseListener() {
@Override
public void onResponse(int correlationId, RPCResponse response) {
- updatedKeyboardProperties = false;
- DebugTool.logInfo(TAG, "Successfully reset choice keyboard properties to original config");
- PresentChoiceSetOperation.super.onFinished();
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- DebugTool.logError(TAG, "Failed to reset choice keyboard properties to original config " + resultCode + ", " + info);
+ if (response.getSuccess()) {
+ updatedKeyboardProperties = false;
+ DebugTool.logInfo(TAG, "Successfully reset choice keyboard properties to original config");
+ } else {
+ DebugTool.logError(TAG, "Failed to reset choice keyboard properties to original config " + response.getResultCode() + ", " + response.getInfo());
+ }
PresentChoiceSetOperation.super.onFinished();
}
});
@@ -272,11 +254,6 @@ class PresentChoiceSetOperation extends Task {
public void onResponse(int correlationId, RPCResponse response) {
DebugTool.logInfo(TAG, "Canceled the presented choice set " + ((response.getResultCode() == Result.SUCCESS) ? "successfully" : "unsuccessfully"));
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info){
- DebugTool.logError(TAG, "Error canceling the presented choice set " + resultCode + " " + info);
- }
});
if (internalInterface.get() != null){
@@ -365,15 +342,8 @@ class PresentChoiceSetOperation extends Task {
// Notify of Keypress
keyboardListener.updateAutocompleteWithInput(onKeyboard.getData(), new KeyboardAutocompleteCompletionListener() {
@Override
- public void onUpdatedAutoCompleteText(String updatedAutoCompleteText) {
- keyboardProperties.setAutoCompleteText(updatedAutoCompleteText);
- updateKeyboardProperties(null);
- }
-
- @Override
public void onUpdatedAutoCompleteList(List<String> updatedAutoCompleteList) {
keyboardProperties.setAutoCompleteList(updatedAutoCompleteList != null ? updatedAutoCompleteList : new ArrayList<String>());
- keyboardProperties.setAutoCompleteText(updatedAutoCompleteList != null && !updatedAutoCompleteList.isEmpty() ? updatedAutoCompleteList.get(0) : null);
updateKeyboardProperties(null);
}
});
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperation.java b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperation.java
index 446826616..0dbcf0c39 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperation.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/choiceset/PresentKeyboardOperation.java
@@ -37,10 +37,10 @@ package com.smartdevicelink.managers.screen.choiceset;
import com.livio.taskmaster.Task;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
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.rpc.CancelInteraction;
import com.smartdevicelink.proxy.rpc.KeyboardProperties;
import com.smartdevicelink.proxy.rpc.OnKeyboardInput;
@@ -62,14 +62,16 @@ import java.util.List;
class PresentKeyboardOperation extends Task {
private static final String TAG = "PresentKeyboardOperation";
- private WeakReference<ISdl> internalInterface;
- private KeyboardListener keyboardListener;
- private KeyboardProperties originalKeyboardProperties, keyboardProperties, customConfig;
+ private final WeakReference<ISdl> internalInterface;
+ private final KeyboardListener keyboardListener;
+ private final KeyboardProperties originalKeyboardProperties;
+ private KeyboardProperties keyboardProperties;
+ private final KeyboardProperties customConfig;
private boolean updatedKeyboardProperties;
- private String initialText;
+ private final String initialText;
private OnRPCNotificationListener keyboardRPCListener;
- private Integer cancelID;
- SdlMsgVersion sdlMsgVersion;
+ private final Integer cancelID;
+ final SdlMsgVersion sdlMsgVersion;
PresentKeyboardOperation(ISdl internalInterface, KeyboardProperties originalKeyboardProperties, String initialText, KeyboardProperties customConfig, KeyboardListener keyboardListener, Integer cancelID){
super("PresentKeyboardOperation");
@@ -124,12 +126,9 @@ class PresentKeyboardOperation extends Task {
pi.setOnRPCResponseListener(new OnRPCResponseListener() {
@Override
public void onResponse(int correlationId, RPCResponse response) {
- finishOperation();
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info){
- DebugTool.logError(TAG, "There was an error presenting the keyboard. Finishing operation - choice set manager - . Error: " + info + " resultCode: " + resultCode);
+ if (!response.getSuccess()) {
+ DebugTool.logError(TAG, "There was an error presenting the keyboard. Finishing operation - choice set manager - . Error: " + response.getInfo() + " resultCode: " + response.getResultCode());
+ }
finishOperation();
}
});
@@ -167,11 +166,6 @@ class PresentKeyboardOperation extends Task {
public void onResponse(int correlationId, RPCResponse response) {
DebugTool.logInfo(TAG, "Canceled the presented keyboard " + ((response.getResultCode() == Result.SUCCESS) ? "successfully" : "unsuccessfully"));
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info){
- DebugTool.logError(TAG, "Error canceling the presented keyboard " + resultCode + " " + info);
- }
});
if (internalInterface.get() != null){
internalInterface.get().sendRPC(cancelInteraction);
@@ -213,15 +207,6 @@ class PresentKeyboardOperation extends Task {
}
DebugTool.logInfo(TAG, "Success Setting keyboard properties in present keyboard operation - choice manager");
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- if (listener != null){
- listener.onComplete(false);
- }
- DebugTool.logError(TAG, "Error Setting keyboard properties in present keyboard operation - choice manager - " + info);
- super.onError(correlationId, resultCode, info);
- }
});
if (internalInterface.get() != null){
@@ -239,14 +224,12 @@ class PresentKeyboardOperation extends Task {
setGlobalProperties.setOnRPCResponseListener(new OnRPCResponseListener() {
@Override
public void onResponse(int correlationId, RPCResponse response) {
- updatedKeyboardProperties = false;
- DebugTool.logInfo(TAG, "Successfully reset choice keyboard properties to original config");
- PresentKeyboardOperation.super.onFinished();
- }
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- DebugTool.logError(TAG, "Failed to reset choice keyboard properties to original config " + resultCode + ", " + info);
+ if (response.getSuccess()) {
+ updatedKeyboardProperties = false;
+ DebugTool.logInfo(TAG, "Successfully reset choice keyboard properties to original config");
+ } else {
+ DebugTool.logError(TAG, "Failed to reset choice keyboard properties to original config " + response.getResultCode() + ", " + response.getInfo());
+ }
PresentKeyboardOperation.super.onFinished();
}
});
@@ -305,12 +288,6 @@ class PresentKeyboardOperation extends Task {
// Notify of Keypress
keyboardListener.updateAutocompleteWithInput(onKeyboard.getData(), new KeyboardAutocompleteCompletionListener() {
@Override
- public void onUpdatedAutoCompleteText(String updatedAutoCompleteText) {
- keyboardProperties.setAutoCompleteText(updatedAutoCompleteText);
- updateKeyboardProperties(null);
- }
-
- @Override
public void onUpdatedAutoCompleteList(List<String> updatedAutoCompleteList) {
keyboardProperties.setAutoCompleteList(updatedAutoCompleteList != null ? updatedAutoCompleteList : new ArrayList<String>());
keyboardProperties.setAutoCompleteText(updatedAutoCompleteList != null && !updatedAutoCompleteList.isEmpty() ? updatedAutoCompleteList.get(0) : null);
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java
index 0fcfc2c4c..7224960ee 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseMenuManager.java
@@ -36,34 +36,33 @@ import androidx.annotation.NonNull;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
+import com.smartdevicelink.managers.ManagerUtility;
import com.smartdevicelink.managers.file.FileManager;
import com.smartdevicelink.managers.file.MultipleFileCompletionListener;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
+import com.smartdevicelink.managers.lifecycle.OnSystemCapabilityListener;
+import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCNotification;
import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.managers.lifecycle.SystemCapabilityManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-import com.smartdevicelink.proxy.interfaces.OnSystemCapabilityListener;
import com.smartdevicelink.proxy.rpc.AddCommand;
import com.smartdevicelink.proxy.rpc.AddSubMenu;
import com.smartdevicelink.proxy.rpc.DeleteCommand;
import com.smartdevicelink.proxy.rpc.DeleteSubMenu;
import com.smartdevicelink.proxy.rpc.DisplayCapability;
-import com.smartdevicelink.managers.ManagerUtility;
import com.smartdevicelink.proxy.rpc.MenuParams;
import com.smartdevicelink.proxy.rpc.OnCommand;
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
import com.smartdevicelink.proxy.rpc.SdlMsgVersion;
-import com.smartdevicelink.proxy.rpc.ShowAppMenu;
import com.smartdevicelink.proxy.rpc.SetGlobalProperties;
+import com.smartdevicelink.proxy.rpc.ShowAppMenu;
import com.smartdevicelink.proxy.rpc.WindowCapability;
import com.smartdevicelink.proxy.rpc.enums.DisplayType;
import com.smartdevicelink.proxy.rpc.enums.HMILevel;
import com.smartdevicelink.proxy.rpc.enums.ImageFieldName;
import com.smartdevicelink.proxy.rpc.enums.PredefinedWindows;
-import com.smartdevicelink.proxy.rpc.enums.Result;
import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType;
import com.smartdevicelink.proxy.rpc.enums.SystemContext;
import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
@@ -152,7 +151,9 @@ abstract class BaseMenuManager extends BaseSubManager {
// remove listeners
internalInterface.removeOnRPCNotificationListener(FunctionID.ON_HMI_STATUS, hmiListener);
internalInterface.removeOnRPCNotificationListener(FunctionID.ON_COMMAND, commandListener);
- internalInterface.removeOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplaysCapabilityListener);
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ internalInterface.getSystemCapabilityManager().removeOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplaysCapabilityListener);
+ }
super.dispose();
}
@@ -285,11 +286,6 @@ abstract class BaseMenuManager extends BaseSubManager {
DebugTool.logError(TAG, "Open Main Menu Request Failed");
}
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info){
- DebugTool.logError(TAG, "Open Main Menu onError: "+ resultCode+ " | Info: "+ info);
- }
});
internalInterface.sendRPC(showAppMenu);
return true;
@@ -334,11 +330,6 @@ abstract class BaseMenuManager extends BaseSubManager {
DebugTool.logError(TAG, "Open Sub Menu Request Failed");
}
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info){
- DebugTool.logError(TAG, "Open Sub Menu onError: "+ resultCode+ " | Info: "+ info);
- }
});
internalInterface.sendRPC(showAppMenu);
@@ -381,13 +372,10 @@ abstract class BaseMenuManager extends BaseSubManager {
public void onResponse(int correlationId, RPCResponse response) {
if (response.getSuccess()) {
DebugTool.logInfo(TAG, "Menu Configuration successfully set: " + menuConfiguration.toString());
+ } else {
+ DebugTool.logError(TAG, "onError: " + response.getResultCode() + " | Info: " + response.getInfo());
}
}
-
- @Override
- public void onError(int correlationId, Result resultCode, String info) {
- DebugTool.logError(TAG, "onError: " + resultCode + " | Info: " + info);
- }
});
internalInterface.sendRPC(setGlobalProperties);
} else {
@@ -1034,7 +1022,9 @@ abstract class BaseMenuManager extends BaseSubManager {
defaultMainWindowCapability = null;
}
};
- this.internalInterface.addOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplaysCapabilityListener);
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ this.internalInterface.getSystemCapabilityManager().addOnSystemCapabilityListener(SystemCapabilityType.DISPLAYS, onDisplaysCapabilityListener);
+ }
// HMI UPDATES
hmiListener = new OnRPCNotificationListener() {
@@ -1175,16 +1165,15 @@ abstract class BaseMenuManager extends BaseSubManager {
}
@Override
- public void onError(int correlationId, Result resultCode, String info) {
- DebugTool.logError(TAG, "Result: " + resultCode.toString() + " Info: " + info);
- }
-
- @Override
public void onResponse(int correlationId, RPCResponse response) {
- try {
- DebugTool.logInfo(TAG, "Main Menu response: " + response.serializeJSON().toString());
- } catch (JSONException e) {
- e.printStackTrace();
+ if (response.getSuccess()) {
+ try {
+ DebugTool.logInfo(TAG, "Main Menu response: " + response.serializeJSON().toString());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ } else {
+ DebugTool.logError(TAG, "Result: " + response.getResultCode() + " Info: " + response.getInfo());
}
}
});
@@ -1214,19 +1203,18 @@ abstract class BaseMenuManager extends BaseSubManager {
}
@Override
- public void onError(int correlationId, Result resultCode, String info) {
- DebugTool.logError(TAG, "Failed to send sub menu commands: "+ info);
- if (listener != null){
- listener.onComplete(false);
- }
- }
-
- @Override
public void onResponse(int correlationId, RPCResponse response) {
- try {
- DebugTool.logInfo(TAG, "Sub Menu response: "+ response.serializeJSON().toString());
- } catch (JSONException e) {
- e.printStackTrace();
+ if (response.getSuccess()) {
+ try {
+ DebugTool.logInfo(TAG, "Sub Menu response: " + response.serializeJSON().toString());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ } else {
+ DebugTool.logError(TAG, "Failed to send sub menu commands: "+ response.getInfo());
+ if (listener != null){
+ listener.onComplete(false);
+ }
}
}
});
@@ -1267,16 +1255,15 @@ abstract class BaseMenuManager extends BaseSubManager {
}
@Override
- public void onError(int correlationId, Result resultCode, String info) {
- DebugTool.logError(TAG, "Result: " + resultCode.toString() + " Info: " + info);
- }
-
- @Override
public void onResponse(int correlationId, RPCResponse response) {
- try {
- DebugTool.logInfo(TAG, "Dynamic Sub Menu response: " + response.serializeJSON().toString());
- } catch (JSONException e) {
- e.printStackTrace();
+ if (response.getSuccess()) {
+ try {
+ DebugTool.logInfo(TAG, "Dynamic Sub Menu response: " + response.serializeJSON().toString());
+ } catch (JSONException e) {
+ e.printStackTrace();
+ }
+ } else {
+ DebugTool.logError(TAG, "Result: " + response.getResultCode() + " Info: " + response.getInfo());
}
}
});
@@ -1316,7 +1303,7 @@ abstract class BaseMenuManager extends BaseSubManager {
return;
}
- internalInterface.sendRequests(deleteCommands, new OnMultipleRequestListener() {
+ internalInterface.sendRPCs(deleteCommands, new OnMultipleRequestListener() {
@Override
public void onUpdate(int remainingRequests) {
@@ -1331,10 +1318,6 @@ abstract class BaseMenuManager extends BaseSubManager {
}
@Override
- public void onError(int correlationId, Result resultCode, String info) {
- }
-
- @Override
public void onResponse(int correlationId, RPCResponse response) {
}
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseVoiceCommandManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseVoiceCommandManager.java
index c615408fd..6ddd37124 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseVoiceCommandManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/menu/BaseVoiceCommandManager.java
@@ -36,17 +36,16 @@ import androidx.annotation.NonNull;
import com.smartdevicelink.managers.BaseSubManager;
import com.smartdevicelink.managers.CompletionListener;
+import com.smartdevicelink.managers.ISdl;
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.rpc.AddCommand;
import com.smartdevicelink.proxy.rpc.DeleteCommand;
import com.smartdevicelink.proxy.rpc.OnCommand;
import com.smartdevicelink.proxy.rpc.OnHMIStatus;
import com.smartdevicelink.proxy.rpc.enums.HMILevel;
import com.smartdevicelink.proxy.rpc.enums.PredefinedWindows;
-import com.smartdevicelink.proxy.rpc.enums.Result;
import com.smartdevicelink.proxy.rpc.listeners.OnMultipleRequestListener;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
import com.smartdevicelink.util.DebugTool;
@@ -191,7 +190,7 @@ abstract class BaseVoiceCommandManager extends BaseSubManager {
List<DeleteCommand> deleteVoiceCommands = deleteCommandsForVoiceCommands(oldVoiceCommands);
oldVoiceCommands.clear();
- internalInterface.sendRequests(deleteVoiceCommands, new OnMultipleRequestListener() {
+ internalInterface.sendRPCs(deleteVoiceCommands, new OnMultipleRequestListener() {
@Override
public void onUpdate(int remainingRequests) {
@@ -206,11 +205,6 @@ abstract class BaseVoiceCommandManager extends BaseSubManager {
}
@Override
- public void onError(int correlationId, Result resultCode, String info) {
-
- }
-
- @Override
public void onResponse(int correlationId, RPCResponse response) {}
});
@@ -229,7 +223,7 @@ abstract class BaseVoiceCommandManager extends BaseSubManager {
inProgressUpdate = addCommandsForVoiceCommands(voiceCommands);
- internalInterface.sendRequests(inProgressUpdate, new OnMultipleRequestListener() {
+ internalInterface.sendRPCs(inProgressUpdate, new OnMultipleRequestListener() {
@Override
public void onUpdate(int remainingRequests) {
@@ -245,11 +239,6 @@ abstract class BaseVoiceCommandManager extends BaseSubManager {
}
@Override
- public void onError(int correlationId, Result resultCode, String info) {
-
- }
-
- @Override
public void onResponse(int correlationId, RPCResponse response) {
}
});
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java b/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java
index 20cc44d38..4eef7777f 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/menu/MenuCell.java
@@ -116,24 +116,6 @@ public class MenuCell implements Cloneable{
* Creates a new MenuCell Object with multiple parameters set
* <strong>NOTE: because this has sub-cells, there does not need to be a listener</strong>
* @param title The cell's primary text
- * @param icon The cell's image
- * @param subCells The sub-cells for the sub menu that will appear when the cell is selected
- *
- * @deprecated use {@link #MenuCell(String, MenuLayout, SdlArtwork, List)}
- */
- @Deprecated
- public MenuCell(@NonNull String title, @Nullable SdlArtwork icon, @Nullable List<MenuCell> subCells) {
- setTitle(title); // title is the only required param
- setIcon(icon);
- setSubCells(subCells);
- setCellId(MAX_ID);
- setParentCellId(MAX_ID);
- }
-
- /**
- * Creates a new MenuCell Object with multiple parameters set
- * <strong>NOTE: because this has sub-cells, there does not need to be a listener</strong>
- * @param title The cell's primary text
* @param subMenuLayout The submenu's layout that the subCells will be shown in. If `null`, the
* default submenu layout in the screen manager's `MenuConfiguration` will be used.
* @param icon The cell's image
diff --git a/base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java b/base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java
index d5a24766f..6f2153d13 100644
--- a/base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/video/BaseVideoStreamManager.java
@@ -34,7 +34,7 @@ package com.smartdevicelink.managers.video;
import androidx.annotation.NonNull;
import com.smartdevicelink.managers.BaseSubManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
abstract class BaseVideoStreamManager extends BaseSubManager {
BaseVideoStreamManager(@NonNull ISdl internalInterface) {
diff --git a/base/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java b/base/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java
index 8f74fbdaa..70759e3be 100644
--- a/base/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java
+++ b/base/src/main/java/com/smartdevicelink/marshal/JsonRPCMarshaller.java
@@ -31,6 +31,8 @@
*/
package com.smartdevicelink.marshal;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.proxy.RPCMessage;
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.trace.SdlTrace;
@@ -50,7 +52,7 @@ import java.util.List;
* Responsible for marshalling and unmarshing between RPC Objects and byte streams that are sent
* over transmission
*/
-
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class JsonRPCMarshaller {
private static final String TAG = "JsonRPCMarshaller";
private static final String SDL_LIB_PRIVATE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
@@ -86,12 +88,11 @@ public class JsonRPCMarshaller {
return ret;
}
- @SuppressWarnings("unchecked")
- public static Hashtable<String, Object> deserializeJSONObject(JSONObject jsonObject)
+ public static Hashtable<String, Object> deserializeJSONObject(JSONObject jsonObject)
throws JSONException {
- Hashtable<String, Object> ret = new Hashtable<String, Object>();
+ Hashtable<String, Object> ret = new Hashtable<>();
Iterator<String> it = jsonObject.keys();
- String key = null;
+ String key;
while (it.hasNext()) {
key = it.next();
Object value = jsonObject.get(key);
@@ -99,7 +100,7 @@ public class JsonRPCMarshaller {
ret.put(key, deserializeJSONObject((JSONObject)value));
} else if (value instanceof JSONArray) {
JSONArray arrayValue = (JSONArray) value;
- List<Object> putList = new ArrayList<Object>(arrayValue.length());
+ List<Object> putList = new ArrayList<>(arrayValue.length());
for (int i = 0; i < arrayValue.length(); i++) {
Object anObject = arrayValue.get(i);
if (anObject instanceof JSONObject) {
@@ -139,16 +140,14 @@ public class JsonRPCMarshaller {
@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();
+ for (String key : hash.keySet()) {
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));
+ obj.put(key, serializeHashtable((Hashtable<String, Object>) value));
} else {
obj.put(key, value);
}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/BaseSdlPacket.java b/base/src/main/java/com/smartdevicelink/protocol/BaseSdlPacket.java
index 21362b53e..2b47eca1c 100644
--- a/base/src/main/java/com/smartdevicelink/protocol/BaseSdlPacket.java
+++ b/base/src/main/java/com/smartdevicelink/protocol/BaseSdlPacket.java
@@ -288,13 +288,10 @@ class BaseSdlPacket {
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;
+ if (version == 1) {
+ builder = ByteBuffer.allocate(HEADER_SIZE_V1 + dataSize);
+ } else {
+ builder = ByteBuffer.allocate(HEADER_SIZE + dataSize);
}
builder.put((byte)((version<<4) + getEncryptionBit(encryption) + frameType));
diff --git a/base/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java b/base/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java
index ebf0353bc..eaabf27d7 100644
--- a/base/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java
+++ b/base/src/main/java/com/smartdevicelink/protocol/BinaryFrameHeader.java
@@ -32,9 +32,11 @@
package com.smartdevicelink.protocol;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.util.BitConverter;
import com.smartdevicelink.util.DebugTool;
-
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class BinaryFrameHeader {
private static final String TAG = "BinaryFrameHeader";
diff --git a/base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java b/base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java
deleted file mode 100644
index 37e7972f4..000000000
--- a/base/src/main/java/com/smartdevicelink/protocol/IProtocolListener.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
-
-@Deprecated
-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/proxy/interfaces/ISdlServiceListener.java b/base/src/main/java/com/smartdevicelink/protocol/ISdlServiceListener.java
index 06c324cb3..d5bc9ebb4 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/interfaces/ISdlServiceListener.java
+++ b/base/src/main/java/com/smartdevicelink/protocol/ISdlServiceListener.java
@@ -29,14 +29,14 @@
* 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;
+package com.smartdevicelink.protocol;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.session.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);
+ void onServiceStarted(SdlSession session, SessionType type, boolean isEncrypted);
+ void onServiceEnded(SdlSession session, SessionType type);
+ void onServiceError(SdlSession session, SessionType type, String reason);
}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java b/base/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java
index 23ceafbdb..6f65b55bd 100644
--- a/base/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java
+++ b/base/src/main/java/com/smartdevicelink/protocol/ISecondaryTransportListener.java
@@ -31,8 +31,11 @@
*/
package com.smartdevicelink.protocol;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.transport.utl.TransportRecord;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
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
index d5e14d940..33967b57f 100644
--- a/base/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java
+++ b/base/src/main/java/com/smartdevicelink/protocol/ProtocolMessage.java
@@ -1,39 +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.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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 androidx.annotation.RestrictTo;
+
import com.smartdevicelink.protocol.enums.MessageType;
import com.smartdevicelink.protocol.enums.SessionType;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class ProtocolMessage {
private byte version = 1;
private SessionType _sessionType = SessionType.RPC;
diff --git a/base/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java b/base/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java
index 306d94c2c..33ffad27f 100644
--- a/base/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java
+++ b/base/src/main/java/com/smartdevicelink/protocol/SdlPacketFactory.java
@@ -31,11 +31,14 @@
*/
package com.smartdevicelink.protocol;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.protocol.enums.ControlFrameTags;
import com.smartdevicelink.protocol.enums.FrameDataControlFrameType;
import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.util.BitConverter;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class SdlPacketFactory {
/*
diff --git a/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java b/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java
index 18eebbbbc..8a497cb53 100644
--- a/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java
+++ b/base/src/main/java/com/smartdevicelink/protocol/SdlProtocolBase.java
@@ -32,6 +32,7 @@
package com.smartdevicelink.protocol;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
import com.smartdevicelink.exception.SdlException;
import com.smartdevicelink.exception.SdlExceptionCause;
@@ -64,6 +65,7 @@ import java.util.Hashtable;
import java.util.List;
import java.util.Map;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class SdlProtocolBase {
private static final String TAG ="SdlProtocol";
private final static String FailurePropagating_Msg = "Failure propagating ";
@@ -83,7 +85,7 @@ public class SdlProtocolBase {
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);
+ private static final Version MAX_PROTOCOL_VERSION = new Version(5, 3, 0);
public static final int V1_V2_MTU_SIZE = 1500;
public static final int V3_V4_MTU_SIZE = 131072;
@@ -94,6 +96,8 @@ public class SdlProtocolBase {
// Lock to ensure all frames are sent uninterrupted
private final Object FRAME_LOCK = new Object();
+ private final Object TRANSPORT_MANAGER_LOCK = new Object();
+
private final ISdlProtocol iSdlProtocol;
private final Hashtable<Integer, SdlProtocol.MessageFrameAssembler> _assemblerForMessageID = new Hashtable<>();
private final Hashtable<Byte, Object> _messageLocks = new Hashtable<>();
@@ -155,16 +159,20 @@ public class SdlProtocolBase {
} // end-ctor
void setTransportManager(TransportManagerBase transportManager){
- this.transportManager = transportManager;
+ synchronized (TRANSPORT_MANAGER_LOCK) {
+ this.transportManager = transportManager;
+ }
}
- public void start(){
- if(transportManager == null){
- throw new IllegalStateException("Attempting to start without setting a transport manager.");
+ public void start() {
+ synchronized (TRANSPORT_MANAGER_LOCK) {
+ if (transportManager == null) {
+ throw new IllegalStateException("Attempting to start without setting a transport manager.");
+ }
+ transportManager.start();
}
- transportManager.start();
-
}
+
/**
* Retrieves the max payload size for a packet to be sent to the module
* @return the max transfer unit
@@ -184,15 +192,14 @@ public class SdlProtocolBase {
return mtu;
}
+ @Deprecated
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);
+ synchronized (TRANSPORT_MANAGER_LOCK) {
+ return transportManager != null && transportManager.isConnected(null, null);
+ }
}
/**
@@ -449,12 +456,14 @@ public class SdlProtocolBase {
if (supportedSecondaryTransports != null) {
for (TransportType supportedSecondary : supportedSecondaryTransports) {
if(!onlyHighBandwidth || supportedSecondary == TransportType.USB || supportedSecondary == TransportType.TCP) {
- if (transportManager != null && 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;
+ synchronized (TRANSPORT_MANAGER_LOCK) {
+ if (transportManager != null && 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;
+ }
}
}
}
@@ -534,10 +543,11 @@ public class SdlProtocolBase {
public void endSession(byte sessionID) {
SdlPacket header = SdlPacketFactory.createEndSession(SessionType.RPC, sessionID, hashID, (byte)protocolVersion.getMajor(), hashID);
handlePacketToSend(header);
- if(transportManager != null) {
- transportManager.close(sessionID);
+ synchronized (TRANSPORT_MANAGER_LOCK) {
+ if (transportManager != null) {
+ transportManager.close(sessionID);
+ }
}
-
} // end-method
public void sendMessage(ProtocolMessage protocolMsg) {
@@ -650,7 +660,8 @@ public class SdlProtocolBase {
}
} else {
messageID++;
- SdlPacket header = SdlPacketFactory.createSingleSendData(sessionType, sessionID, data.length, messageID, (byte)protocolVersion.getMajor(),data, protocolMsg.getPayloadProtected());
+ int dataLength = data != null ? data.length : 0;
+ SdlPacket header = SdlPacketFactory.createSingleSendData(sessionType, sessionID, dataLength, messageID, (byte)protocolVersion.getMajor(),data, protocolMsg.getPayloadProtected());
header.setPriorityCoefficient(protocolMsg.priorityCoefficient);
header.setTransportRecord(activeTransports.get(sessionType));
handlePacketToSend(header);
@@ -781,26 +792,27 @@ public class SdlProtocolBase {
}
};
- if (transportManager != null) {
- 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));
+ synchronized (TRANSPORT_MANAGER_LOCK) {
+ if (transportManager != null) {
+ 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 {
+ DebugTool.logWarning(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();
+ }
} else {
- DebugTool.logWarning(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();
+ DebugTool.logError(TAG, "transportManager is null");
}
- } else {
- DebugTool.logError(TAG, "transportManager is null");
}
-
}
}
}
@@ -836,11 +848,11 @@ public class SdlProtocolBase {
*/
protected void handlePacketToSend(SdlPacket packet) {
synchronized(FRAME_LOCK) {
-
- if(packet!=null && transportManager != null) {
- transportManager.sendPacket(packet);
+ synchronized (TRANSPORT_MANAGER_LOCK) {
+ if (packet != null && transportManager != null) {
+ transportManager.sendPacket(packet);
+ }
}
-
}
}
@@ -1058,7 +1070,7 @@ public class SdlProtocolBase {
activeTransports.put(SessionType.PCM, transportRecord);
if (protocolVersion.getMajor() > 1) {
- if (packet.payload != null && packet.dataSize == 4) { //hashid will be 4 bytes in length
+ if (packet.payload != null && packet.dataSize == 4) { //hashId will be 4 bytes in length
hashID = BitConverter.intFromByteArray(packet.payload, 0);
}
}
@@ -1067,12 +1079,14 @@ public class SdlProtocolBase {
iSdlProtocol.setAcceptedVideoParams(iSdlProtocol.getDesiredVideoParams());
}
}
- iSdlProtocol.onServiceStarted(packet, serviceType, (byte) packet.getSessionId(), protocolVersion, packet.isEncrypted());
+ if (iSdlProtocol != null) {
+ iSdlProtocol.onServiceStarted(packet, serviceType, (byte) packet.getSessionId(), protocolVersion, packet.isEncrypted());
+ }
}
protected void handleProtocolSessionNAKed(SdlPacket packet, SessionType serviceType) {
String error = "Service start NAK received for service type " + serviceType.getName();
- List<String> rejectedParams = null;
+ List<String> rejectedParams;
if(packet.version >= 5){
if(DebugTool.isDebugEnabled()) {
//Currently this is only during a debugging session. Might pass back in the future
@@ -1126,7 +1140,6 @@ public class SdlProtocolBase {
----------------------------------- TRANSPORT_TYPE LISTENER ---------------------------------
-------------------------------------------------------------------------------------------*/
- @SuppressWarnings("FieldCanBeLocal")
final TransportManagerBase.TransportEventListener transportEventListener = new TransportManagerBase.TransportEventListener() {
private boolean requestedSession = false;
@@ -1142,8 +1155,10 @@ public class SdlProtocolBase {
TransportRecord transportRecord = getTransportForSession(SessionType.RPC);
if(transportRecord == null && !requestedSession){ //There is currently no transport registered
requestedSession = true;
- if (transportManager != null) {
- transportManager.requestNewSession(getPreferredTransport(requestedPrimaryTransports, connectedTransports));
+ synchronized (TRANSPORT_MANAGER_LOCK) {
+ if (transportManager != null) {
+ transportManager.requestNewSession(getPreferredTransport(requestedPrimaryTransports, connectedTransports));
+ }
}
}
onTransportsConnectedUpdate(connectedTransports);
@@ -1156,8 +1171,10 @@ public class SdlProtocolBase {
public void onTransportDisconnected(String info, TransportRecord disconnectedTransport, List<TransportRecord> connectedTransports) {
if (disconnectedTransport == null) {
DebugTool.logInfo(TAG, "onTransportDisconnected");
- if (transportManager != null) {
- transportManager.close(iSdlProtocol.getSessionId());
+ synchronized (TRANSPORT_MANAGER_LOCK) {
+ if (transportManager != null) {
+ transportManager.close(iSdlProtocol.getSessionId());
+ }
}
iSdlProtocol.shutdown("No transports left connected");
return;
@@ -1185,45 +1202,49 @@ public class SdlProtocolBase {
for (TransportType transportType: requestedPrimaryTransports){
DebugTool.logInfo(TAG, "Checking " + transportType.name());
- if(!disconnectedTransport.getType().equals(transportType)
- && transportManager != null
- && transportManager.isConnected(transportType,null)){
-
- //There is currently a supported primary transport
-
- //See if any high bandwidth transport is available currently
- boolean highBandwidthAvailable = transportManager.isHighBandwidthAvailable();
-
- if (requiresHighBandwidth) {
- if (!highBandwidthAvailable) {
- if (TransportType.BLUETOOTH.equals(transportType)
- && requestedSecondaryTransports != null
- && supportedSecondaryTransports != null) {
- for (TransportType secondaryTransport : requestedSecondaryTransports) {
- DebugTool.logInfo(TAG, "Checking secondary " + secondaryTransport.name());
- if (supportedSecondaryTransports.contains(secondaryTransport)) {
- //Should only be USB or TCP
- highBandwidthAvailable = true;
- break;
+ synchronized (TRANSPORT_MANAGER_LOCK) {
+ if (!disconnectedTransport.getType().equals(transportType)
+ && transportManager != null
+ && transportManager.isConnected(transportType, null)) {
+
+ //There is currently a supported primary transport
+
+ //See if any high bandwidth transport is available currently
+ boolean highBandwidthAvailable = transportManager.isHighBandwidthAvailable();
+
+ if (requiresHighBandwidth) {
+ if (!highBandwidthAvailable) {
+ if (TransportType.BLUETOOTH.equals(transportType)
+ && requestedSecondaryTransports != null
+ && supportedSecondaryTransports != null) {
+ for (TransportType secondaryTransport : requestedSecondaryTransports) {
+ DebugTool.logInfo(TAG, "Checking secondary " + secondaryTransport.name());
+ if (supportedSecondaryTransports.contains(secondaryTransport)) {
+ //Should only be USB or TCP
+ highBandwidthAvailable = true;
+ break;
+ }
}
}
- }
- } // High bandwidth already available
- }
+ } // High bandwidth already available
+ }
- if(!requiresHighBandwidth || (requiresHighBandwidth && highBandwidthAvailable )) {
- primaryTransportAvailable = true;
- transportManager.updateTransportConfig(transportConfig);
- break;
+ if (!requiresHighBandwidth || (requiresHighBandwidth && highBandwidthAvailable)) {
+ primaryTransportAvailable = true;
+ transportManager.updateTransportConfig(transportConfig);
+ break;
+ }
}
}
}
}
connectedPrimaryTransport = null;
- if (transportManager != null) {
- transportManager.close(iSdlProtocol.getSessionId());
+ synchronized (TRANSPORT_MANAGER_LOCK) {
+ if (transportManager != null) {
+ transportManager.close(iSdlProtocol.getSessionId());
+ }
+ transportManager = null;
}
- transportManager = null;
requestedSession = false;
activeTransports.clear();
@@ -1310,8 +1331,8 @@ public class SdlProtocolBase {
try {
iSdlProtocol.onProtocolMessageReceived(message);
- } catch (Exception excp) {
- DebugTool.logError(TAG, FailurePropagating_Msg + "onProtocolMessageReceived: " + excp.toString(), excp);
+ } catch (Exception e) {
+ DebugTool.logError(TAG, FailurePropagating_Msg + "onProtocolMessageReceived: " + e.toString(), e);
} // end-catch
accumulator = null;
@@ -1395,6 +1416,8 @@ public class SdlProtocolBase {
} else if (frameInfo == FrameDataControlFrameType.StartSessionNACK.getValue()) {
+ String reason = (String) packet.getTag(ControlFrameTags.RPC.StartServiceNAK.REASON);
+ DebugTool.logWarning(TAG, reason);
handleProtocolSessionNAKed(packet, serviceType);
} else if (frameInfo == FrameDataControlFrameType.EndSession.getValue()
@@ -1404,6 +1427,8 @@ public class SdlProtocolBase {
} else if (frameInfo == FrameDataControlFrameType.EndSessionNACK.getValue()) {
+ String reason = (String) packet.getTag(ControlFrameTags.RPC.EndServiceNAK.REASON);
+ DebugTool.logWarning(TAG, reason);
handleServiceEndedNAK(packet, serviceType);
} else if (frameInfo == FrameDataControlFrameType.ServiceDataACK.getValue()) {
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java b/base/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java
index f5ea6836a..1b2595e2a 100644
--- a/base/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java
+++ b/base/src/main/java/com/smartdevicelink/protocol/enums/ControlFrameTags.java
@@ -44,6 +44,7 @@ public class ControlFrameTags {
private static class NAKBase{
/** An array of rejected parameters related to the corresponding request*/
public static final String REJECTED_PARAMS = "rejectedParams";
+ public static final String REASON = "reason";
}
/**
@@ -90,9 +91,7 @@ public class ControlFrameTags {
**/
public static class RegisterSecondaryTransport {}
public static class RegisterSecondaryTransportACK {}
- public static class RegisterSecondaryTransportNAK extends NAKBase {
- public static final String REASON = "reason";
- }
+ public static class RegisterSecondaryTransportNAK 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
deleted file mode 100644
index 745faf5f3..000000000
--- a/base/src/main/java/com/smartdevicelink/protocol/enums/FrameData.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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
index c0131d085..d31e45eac 100644
--- a/base/src/main/java/com/smartdevicelink/protocol/enums/FrameDataControlFrameType.java
+++ b/base/src/main/java/com/smartdevicelink/protocol/enums/FrameDataControlFrameType.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
@@ -36,11 +36,10 @@ import com.smartdevicelink.util.ByteEnumer;
import java.util.Vector;
public class FrameDataControlFrameType extends ByteEnumer {
- private static Vector<FrameDataControlFrameType> theList = new Vector<FrameDataControlFrameType>();
+ private static final Vector<FrameDataControlFrameType> theList = new Vector<>();
public static Vector<FrameDataControlFrameType> getList() { return theList; }
- @SuppressWarnings("unused")
- private byte _i = 0x00;
+ private byte _i = 0x00;
protected FrameDataControlFrameType(byte value, String name) {
super(value, name);
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java b/base/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java
index 085ae6b40..500549d3f 100644
--- a/base/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java
+++ b/base/src/main/java/com/smartdevicelink/protocol/enums/FrameType.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
@@ -37,7 +37,7 @@ import java.util.Vector;
public class FrameType extends ByteEnumer {
- private static Vector<FrameType> theList = new Vector<FrameType>();
+ private static final Vector<FrameType> theList = new Vector<>();
public static Vector<FrameType> getList() { return theList; }
byte i = 0x00;
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java b/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java
index b9471209c..c7ab5145a 100644
--- a/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java
+++ b/base/src/main/java/com/smartdevicelink/protocol/enums/FunctionID.java
@@ -159,7 +159,7 @@ public enum FunctionID{
}
private static void initFunctionMap(){
- functionMap = new HashMap<String, Integer>(values().length);
+ functionMap = new HashMap<>(values().length);
for(FunctionID value : EnumSet.allOf(FunctionID.class)){
functionMap.put(value.toString(), value.getId());
@@ -171,10 +171,8 @@ public enum FunctionID{
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())){
+ for (Entry<String, Integer> thisEntry : functionMap.entrySet()) {
+ if (Integer.valueOf(i).equals(thisEntry.getValue())) {
return thisEntry.getKey();
}
}
diff --git a/base/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java b/base/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java
index 158f4080c..5161b10f8 100644
--- a/base/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java
+++ b/base/src/main/java/com/smartdevicelink/protocol/enums/SessionType.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
@@ -38,7 +38,7 @@ import java.util.Vector;
public class SessionType extends ByteEnumer {
- private static Vector<SessionType> theList = new Vector<SessionType>();
+ private static final Vector<SessionType> theList = new Vector<>();
public static Vector<SessionType> getList() { return theList; }
byte i = 0x00;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/IProxyListener.java b/base/src/main/java/com/smartdevicelink/proxy/IProxyListener.java
deleted file mode 100644
index c8c2bbf42..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/IProxyListener.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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
index ac0d11506..fd80c6cca 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/RPCMessage.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/RPCMessage.java
@@ -47,8 +47,8 @@ public class RPCMessage extends RPCStruct {
this(functionName, "request");
}
- protected RPCMessage(RPCMessage rpcm) {
- this(cloneStore(rpcm));
+ protected RPCMessage(RPCMessage rpcMessage) {
+ this(cloneStore(rpcMessage));
}
protected RPCMessage(RPCStruct rpcs) {
@@ -57,8 +57,8 @@ public class RPCMessage extends RPCStruct {
}
public RPCMessage(String functionName, String messageType) {
- function = new Hashtable<String, Object>();
- parameters = new Hashtable<String, Object>();
+ function = new Hashtable<>();
+ parameters = new Hashtable<>();
this.messageType = messageType;
function.put(KEY_PARAMETERS, parameters);
@@ -94,14 +94,15 @@ public class RPCMessage extends RPCStruct {
protected String messageType;
protected Hashtable<String, Object> parameters;
- protected Hashtable<String, Object> function;
+ protected final Hashtable<String, Object> function;
public String getFunctionName() {
return (String)function.get(KEY_FUNCTION_NAME);
}
- protected void setFunctionName(String functionName) {
+ protected RPCMessage setFunctionName(String functionName) {
function.put(KEY_FUNCTION_NAME, functionName);
+ return this;
}
public String getMessageType() {
@@ -115,12 +116,13 @@ public class RPCMessage extends RPCStruct {
// Generalized Getters and Setters
- public void setParameters(String key, Object value) {
+ public RPCMessage setParameters(String key, Object value) {
if (value != null) {
parameters.put(key, value);
} else {
parameters.remove(key);
}
+ return this;
}
public Object getParameters(String key) {
diff --git a/base/src/main/java/com/smartdevicelink/proxy/RPCNotification.java b/base/src/main/java/com/smartdevicelink/proxy/RPCNotification.java
index dd8388142..dfcd283a6 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/RPCNotification.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/RPCNotification.java
@@ -29,29 +29,29 @@
* 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;
- }
+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 (!RPCMessage.KEY_NOTIFICATION.equals(rpcMsg.getMessageType())) {
+ 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
index 22ce1c2a5..7dc9de1d3 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/RPCRequest.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/RPCRequest.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * 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;
@@ -64,15 +64,17 @@ public class RPCRequest extends RPCMessage {
return (Integer)function.get(RPCMessage.KEY_CORRELATION_ID);
}
- public void setCorrelationID(Integer correlationID) {
+ public RPCRequest setCorrelationID(Integer correlationID) {
if (correlationID != null) {
function.put(RPCMessage.KEY_CORRELATION_ID, correlationID );
} else {
function.remove(RPCMessage.KEY_CORRELATION_ID);
}
+ return this;
}
- public void setOnRPCResponseListener(OnRPCResponseListener listener){
+ public RPCRequest setOnRPCResponseListener(OnRPCResponseListener listener){
onResponseListener = listener;
+ return this;
}
public OnRPCResponseListener getOnRPCResponseListener(){
diff --git a/base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java b/base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java
index 771ccfe7c..dd56b370f 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/RPCResponse.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * 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 androidx.annotation.NonNull;
@@ -100,7 +100,7 @@ public class RPCResponse extends RPCMessage {
}
static RPCMessage preprocessMsg (RPCMessage rpcMsg) {
- if (rpcMsg.getMessageType() != RPCMessage.KEY_RESPONSE) {
+ if (!RPCMessage.KEY_RESPONSE.equals(rpcMsg.getMessageType())) {
rpcMsg.messageType = RPCMessage.KEY_RESPONSE;
}
@@ -126,12 +126,13 @@ public class RPCResponse extends RPCMessage {
* @param correlationID
* the ID of the response
*/
- public void setCorrelationID(Integer correlationID) {
+ public RPCResponse setCorrelationID(Integer correlationID) {
if (correlationID != null) {
function.put(RPCMessage.KEY_CORRELATION_ID, correlationID );
} else {
function.remove(RPCMessage.KEY_CORRELATION_ID);
}
+ return this;
}
/**
* <p>
@@ -151,10 +152,11 @@ public class RPCResponse extends RPCMessage {
* @param success
* whether the request is successfully processed
*/
- public void setSuccess( @NonNull Boolean success ) {
+ public RPCResponse setSuccess( @NonNull Boolean success ) {
if (success != null) {
parameters.put(RPCResponse.KEY_SUCCESS, success );
}
+ return this;
}
/**
* <p>
@@ -180,10 +182,11 @@ public class RPCResponse extends RPCMessage {
* @param resultCode
* whether the request is successfully processed
*/
- public void setResultCode( @NonNull Result resultCode ) {
+ public RPCResponse setResultCode( @NonNull Result resultCode ) {
if (resultCode != null) {
parameters.put(RPCResponse.KEY_RESULT_CODE, resultCode );
}
+ return this;
}
/**
* <p>
@@ -203,9 +206,10 @@ public class RPCResponse extends RPCMessage {
* @param info
* a string of text representing additional information returned from SDL
*/
- public void setInfo( String info ) {
+ public RPCResponse setInfo( String info ) {
if (info != null) {
parameters.put(RPCResponse.KEY_INFO, info );
}
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/RPCStruct.java b/base/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
index 5eb293ba2..e7d915b1e 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/RPCStruct.java
@@ -57,7 +57,7 @@ public class RPCStruct {
private Version rpcSpecVersion = null;
- protected Hashtable<String, Object> store = null;
+ protected Hashtable<String, Object> store;
public boolean getStoreValue(String key) { // for unit testing
return store.contains(key);
@@ -68,7 +68,7 @@ public class RPCStruct {
}
public RPCStruct() {
- store = new Hashtable<String, Object>();
+ store = new Hashtable<>();
}
protected RPCStruct(RPCStruct rpcs) {
@@ -91,19 +91,11 @@ public class RPCStruct {
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) {
@@ -158,9 +150,9 @@ public class RPCStruct {
}
/**
- * Cycles through parameters in this RPC to ensure they all get formated
+ * Cycles through parameters in this RPC to ensure they all get formatted
* @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
+ * @param value the object to investigate if it needs to be formatted
*/
private void internalFormat(Version rpcVersion, Object value) {
if(value instanceof RPCStruct) {
@@ -180,7 +172,7 @@ public class RPCStruct {
return this._bulkData;
}
- public void setBulkData(byte[] bulkData) {
+ public RPCStruct setBulkData(byte[] bulkData) {
if (bulkData != null) {
this._bulkData = new byte[bulkData.length];
System.arraycopy(bulkData, 0, _bulkData, 0, bulkData.length);
@@ -188,10 +180,12 @@ public class RPCStruct {
else{
this._bulkData = null;
}
+ return this;
}
- public void setPayloadProtected(Boolean bVal) {
+ public RPCStruct setPayloadProtected(Boolean bVal) {
protectedPayload = bVal;
+ return this;
}
public Boolean isPayloadProtected() {
@@ -225,12 +219,13 @@ public class RPCStruct {
// Generalized Getters and Setters
- public void setValue(String key, Object value){
+ public RPCStruct setValue(String key, Object value){
if (value != null) {
store.put(key, value);
} else {
store.remove(key);
}
+ return this;
}
public Object getValue(String key) {
@@ -275,11 +270,21 @@ public class RPCStruct {
} else if (obj instanceof List<?>) {
List<?> list = (List<?>) obj;
if (list != null && list.size() > 0) {
- Object item = list.get(0);
- if (tClass.isInstance(item)) {
+ Object item = null;
+ //Iterate through list to find first non-null object
+ for(Object object: list){
+ if(object != null) {
+ item = object;
+ break;
+ }
+ }
+
+ if (item == null) {
+ return list;
+ } else if (tClass.isInstance(item)) {
return list;
} else if (item instanceof Hashtable) {
- List<Object> newList = new ArrayList<Object>();
+ List<Object> newList = new ArrayList<>();
Object customObject;
for (Object hashObj : list) {
try {
@@ -298,7 +303,7 @@ public class RPCStruct {
}
return newList;
} else if (item instanceof String){
- List<Object> newList = new ArrayList<Object>();
+ List<Object> newList = new ArrayList<>();
for (Object hashObj : list) {
Object toAdd = getValueForString(tClass, (String) hashObj);
if (toAdd != null) {
@@ -307,6 +312,10 @@ public class RPCStruct {
}
return newList;
}
+ } else {
+ //If the list is either null or empty it should be returned. It will keep the same
+ //behavior as it does today with null lists, but empty ones will now also be returned.
+ return list;
}
}
return null;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java b/base/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java
deleted file mode 100644
index d338a8f19..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/TTSChunkFactory.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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
deleted file mode 100644
index f05e3d49f..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/callbacks/InternalProxyMessage.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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
deleted file mode 100644
index 3992f4a31..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnError.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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
deleted file mode 100644
index 27c621a07..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyClosed.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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
deleted file mode 100644
index f56eff415..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnProxyOpened.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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
deleted file mode 100644
index cad213ca8..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceEnded.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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
deleted file mode 100644
index 6f719f615..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/callbacks/OnServiceNACKed.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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
deleted file mode 100644
index 73f7adeeb..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/constants/Jingles.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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
deleted file mode 100644
index fe63db715..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/constants/Names.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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/base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java b/base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java
deleted file mode 100644
index eb3d00c6b..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerALM.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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
deleted file mode 100644
index e00309fb5..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/interfaces/IProxyListenerBase.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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.CancelInteractionResponse;
-import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse;
-import com.smartdevicelink.proxy.rpc.CloseApplicationResponse;
-import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse;
-import com.smartdevicelink.proxy.rpc.CreateWindowResponse;
-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.DeleteWindowResponse;
-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.GetInteriorVehicleDataConsentResponse;
-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.OnPermissionsChange;
-import com.smartdevicelink.proxy.rpc.OnRCStatus;
-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.ReleaseInteriorVehicleDataModuleResponse;
-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.ShowAppMenuResponse;
-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.SubscribeButtonResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeWayPointsResponse;
-import com.smartdevicelink.proxy.rpc.SystemRequestResponse;
-import com.smartdevicelink.proxy.rpc.UnpublishAppServiceResponse;
-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;
-
-@Deprecated
-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 onCreateWindowResponse(CreateWindowResponse response);
-
- public void onDeleteWindowResponse(DeleteWindowResponse 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 onGetInteriorVehicleDataConsentResponse(GetInteriorVehicleDataConsentResponse response);
-
- public void onReleaseInteriorVehicleDataModuleResponse(ReleaseInteriorVehicleDataModuleResponse response);
-
- public void onOnSystemCapabilityUpdated(OnSystemCapabilityUpdated notification);
-
- /**
- * onCloseApplicationResponse being called indicates that SDL has
- * responded to a request to close the application on the module.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onCloseApplicationResponse(CloseApplicationResponse response);
-
- /**
- * onCancelInteractionResponse being called indicates that SDL has
- * responded to a request to dismiss a modal view on the module.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onCancelInteractionResponse(CancelInteractionResponse response);
-
- /**
- * UnpublishAppServiceResponse being called indicates that SDL has
- * responded to a request to close the application on the module.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onUnpublishAppServiceResponse(UnpublishAppServiceResponse response);
-
- /**
- * onShowAppMenuResponse being called indicates that SDL has
- * responded to a request to close the application on the module.
- *
- * @param response - Contains information about the response sent from SDL.
- */
- public void onShowAppMenuResponse(ShowAppMenuResponse response);
-}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java b/base/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java
deleted file mode 100644
index b0c557b8e..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/interfaces/IPutFileResponseListener.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * 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;
-
-@Deprecated
-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/rpc/AddCommand.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java
index c46fb4a7a..b3bb816e2 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddCommand.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -66,7 +66,7 @@ import java.util.List;
* <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>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
*
* <p><b>Parameter List</b></p>
* <table border="1" rules="all">
@@ -165,15 +165,16 @@ public class AddCommand extends RPCRequest {
* <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);
+ public AddCommand setCmdID(@NonNull Integer cmdID) {
+ setParameters(KEY_CMD_ID, cmdID);
+ return this;
}
/**
* <p>
@@ -184,7 +185,6 @@ public class AddCommand extends RPCRequest {
* @return MenuParams -a MenuParams object
*
*/
- @SuppressWarnings("unchecked")
public MenuParams getMenuParams() {
return (MenuParams) getObject(MenuParams.class, KEY_MENU_PARAMS);
}
@@ -195,12 +195,13 @@ public class AddCommand extends RPCRequest {
* 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) {
+ */
+ public AddCommand setMenuParams( MenuParams menuParams) {
setParameters(KEY_MENU_PARAMS, menuParams);
+ return this;
}
/**
* <p>
@@ -222,7 +223,7 @@ public class AddCommand extends RPCRequest {
* <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>
@@ -230,8 +231,9 @@ public class AddCommand extends RPCRequest {
* 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);
+ public AddCommand setVrCommands( List<String> vrCommands) {
+ setParameters(KEY_VR_COMMANDS, vrCommands);
+ return this;
}
/**
@@ -240,7 +242,6 @@ public class AddCommand extends RPCRequest {
* @return Image -an Image object
* @since SmartDeviceLink 2.0
*/
- @SuppressWarnings("unchecked")
public Image getCmdIcon() {
return (Image) getObject(Image.class, KEY_CMD_ICON);
}
@@ -256,7 +257,8 @@ public class AddCommand extends RPCRequest {
* default if applicable) icon will be displayed</p>
* @since SmartDeviceLink 2.0
*/
- public void setCmdIcon(Image cmdIcon) {
+ public AddCommand setCmdIcon( Image cmdIcon) {
setParameters(KEY_CMD_ICON, cmdIcon);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java
index 3751134e0..d989e8d36 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AddSubMenu.java
@@ -46,7 +46,7 @@ import java.util.Hashtable;
* 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>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
*
* <p><b>Parameter List</b></p>
* <table border="1" rules="all">
@@ -166,15 +166,16 @@ public class AddSubMenu extends RPCRequest {
* <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);
+ */
+ public AddSubMenu setMenuID(@NonNull Integer menuID) {
+ setParameters(KEY_MENU_ID, menuID);
+ return this;
}
/**
* <p>Returns an <i>Integer</i> object representing the position of menu</p>
@@ -187,7 +188,7 @@ public class AddSubMenu extends RPCRequest {
}
/**
* 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
@@ -204,9 +205,10 @@ public class AddSubMenu extends RPCRequest {
* <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);
+ */
+ public AddSubMenu setPosition( Integer position) {
+ setParameters(KEY_POSITION, position);
+ return this;
}
/**
* Returns String which is displayed representing this submenu item
@@ -218,12 +220,13 @@ public class AddSubMenu extends RPCRequest {
}
/**
* 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);
+ */
+ public AddSubMenu setMenuName(@NonNull String menuName) {
+ setParameters(KEY_MENU_NAME, menuName);
+ return this;
}
/**
* Returns Image to be be shown along with the submenu item
@@ -239,23 +242,24 @@ public class AddSubMenu extends RPCRequest {
* @param menuIcon
* Image to be be shown along with the submenu item
*/
- public void setMenuIcon(Image menuIcon) {
- setParameters(KEY_MENU_ICON, menuIcon);
- }
+ public AddSubMenu setMenuIcon( Image menuIcon) {
+ setParameters(KEY_MENU_ICON, menuIcon);
+ return this;
+ }
/**
* Sets the layout of the submenu screen.
* @param menuLayout - the menuLayout
*/
- public void setMenuLayout(MenuLayout menuLayout) {
- setParameters(KEY_MENU_LAYOUT, menuLayout);
- }
+ public AddSubMenu setMenuLayout( MenuLayout menuLayout) {
+ setParameters(KEY_MENU_LAYOUT, menuLayout);
+ return this;
+ }
/**
* Gets the layout of the submenu screen.
* @return the MenuLayout
*/
- @SuppressWarnings("unchecked")
public MenuLayout getMenuLayout() {
return (MenuLayout) getObject(MenuLayout.class, KEY_MENU_LAYOUT);
}
@@ -267,9 +271,10 @@ public class AddSubMenu extends RPCRequest {
* provided to the top level of the in application menu.
* @since SmartDeviceLink 7.0.0
*/
- public void setParentID(Integer parentID) {
- setParameters(KEY_PARENT_ID, parentID);
- }
+ public AddSubMenu setParentID( Integer parentID) {
+ setParameters(KEY_PARENT_ID, parentID);
+ return this;
+ }
/**
* Gets the parentID.
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java
index 49fdf959e..55498160a 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AirbagStatus.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -149,50 +149,58 @@ public class AirbagStatus extends RPCStruct {
setPassengerKneeAirbagDeployed(passengerKneeAirbagDeployed);
}
- public void setDriverAirbagDeployed(@NonNull VehicleDataEventStatus driverAirbagDeployed) {
+ public AirbagStatus setDriverAirbagDeployed(@NonNull VehicleDataEventStatus driverAirbagDeployed) {
setValue(KEY_DRIVER_AIRBAG_DEPLOYED, driverAirbagDeployed);
+ return this;
}
public VehicleDataEventStatus getDriverAirbagDeployed() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_AIRBAG_DEPLOYED);
}
- public void setDriverSideAirbagDeployed(@NonNull VehicleDataEventStatus driverSideAirbagDeployed) {
+ public AirbagStatus setDriverSideAirbagDeployed(@NonNull VehicleDataEventStatus driverSideAirbagDeployed) {
setValue(KEY_DRIVER_SIDE_AIRBAG_DEPLOYED, driverSideAirbagDeployed);
+ return this;
}
public VehicleDataEventStatus getDriverSideAirbagDeployed() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_SIDE_AIRBAG_DEPLOYED);
}
- public void setDriverCurtainAirbagDeployed(@NonNull VehicleDataEventStatus driverCurtainAirbagDeployed) {
+ public AirbagStatus setDriverCurtainAirbagDeployed(@NonNull VehicleDataEventStatus driverCurtainAirbagDeployed) {
setValue(KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED, driverCurtainAirbagDeployed);
+ return this;
}
public VehicleDataEventStatus getDriverCurtainAirbagDeployed() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_CURTAIN_AIRBAG_DEPLOYED);
}
- public void setPassengerAirbagDeployed(@NonNull VehicleDataEventStatus passengerAirbagDeployed) {
+ public AirbagStatus setPassengerAirbagDeployed(@NonNull VehicleDataEventStatus passengerAirbagDeployed) {
setValue(KEY_PASSENGER_AIRBAG_DEPLOYED, passengerAirbagDeployed);
+ return this;
}
public VehicleDataEventStatus getPassengerAirbagDeployed() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_AIRBAG_DEPLOYED);
}
- public void setPassengerCurtainAirbagDeployed(@NonNull VehicleDataEventStatus passengerCurtainAirbagDeployed) {
+ public AirbagStatus setPassengerCurtainAirbagDeployed(@NonNull VehicleDataEventStatus passengerCurtainAirbagDeployed) {
setValue(KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED, passengerCurtainAirbagDeployed);
+ return this;
}
public VehicleDataEventStatus getPassengerCurtainAirbagDeployed() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_CURTAIN_AIRBAG_DEPLOYED);
}
- public void setDriverKneeAirbagDeployed(@NonNull VehicleDataEventStatus driverKneeAirbagDeployed) {
+ public AirbagStatus setDriverKneeAirbagDeployed(@NonNull VehicleDataEventStatus driverKneeAirbagDeployed) {
setValue(KEY_DRIVER_KNEE_AIRBAG_DEPLOYED, driverKneeAirbagDeployed);
+ return this;
}
public VehicleDataEventStatus getDriverKneeAirbagDeployed() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_KNEE_AIRBAG_DEPLOYED);
}
- public void setPassengerSideAirbagDeployed(@NonNull VehicleDataEventStatus passengerSideAirbagDeployed) {
+ public AirbagStatus setPassengerSideAirbagDeployed(@NonNull VehicleDataEventStatus passengerSideAirbagDeployed) {
setValue(KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED, passengerSideAirbagDeployed);
+ return this;
}
public VehicleDataEventStatus getPassengerSideAirbagDeployed() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_SIDE_AIRBAG_DEPLOYED);
}
- public void setPassengerKneeAirbagDeployed(@NonNull VehicleDataEventStatus passengerKneeAirbagDeployed) {
+ public AirbagStatus setPassengerKneeAirbagDeployed(@NonNull VehicleDataEventStatus passengerKneeAirbagDeployed) {
setValue(KEY_PASSENGER_KNEE_AIRBAG_DEPLOYED, passengerKneeAirbagDeployed);
+ return this;
}
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
index a67484131..10a2039c8 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Alert.java
@@ -125,7 +125,7 @@ import java.util.List;
* <tr>
* <td>softButtons</td>
* <td>SoftButton[]</td>
- * <td>Specifies the softbuttons, the apps wants to use in this alert.</td>
+ * <td>Specifies the soft buttons, the apps wants to use in this alert.</td>
* <td>N</td>
* <td>If omitted on supported displays, the alert will not have any SoftButton.ArrayMin: 0; ArrayMax: 4</td>
* <td>SmartDeviceLink 1.0</td>
@@ -204,10 +204,10 @@ public class Alert extends RPCRequest {
/**
* 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>
@@ -215,9 +215,10 @@ public class Alert extends RPCRequest {
* <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);
+ */
+ public Alert setAlertText1( String alertText1) {
+ setParameters(KEY_ALERT_TEXT_1, alertText1);
+ return this;
}
/**
* Gets the text which is displayed in the second field of the display
@@ -232,10 +233,10 @@ public class Alert extends RPCRequest {
/**
* 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>
@@ -244,9 +245,10 @@ public class Alert extends RPCRequest {
* <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);
+ */
+ public Alert setAlertText2( String alertText2) {
+ setParameters(KEY_ALERT_TEXT_2, alertText2);
+ return this;
}
/**
@@ -265,10 +267,10 @@ public class Alert extends RPCRequest {
/**
* 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>
@@ -277,11 +279,12 @@ public class Alert extends RPCRequest {
* <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);
+ public Alert setAlertText3( String alertText3) {
+ setParameters(KEY_ALERT_TEXT_3, alertText3);
+ return this;
}
/**
* Gets TTSChunk[], the Array of type TTSChunk which, taken together,
@@ -297,13 +300,14 @@ public class Alert extends RPCRequest {
/**
* 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);
+ */
+ public Alert setTtsChunks( List<TTSChunk> ttsChunks) {
+ setParameters(KEY_TTS_CHUNKS, ttsChunks);
+ return this;
}
/**
* Gets the duration of the displayed portion of the alert, in milliseconds
@@ -319,8 +323,8 @@ public class Alert extends RPCRequest {
* 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
@@ -330,9 +334,10 @@ public class Alert extends RPCRequest {
* <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);
+ */
+ public Alert setDuration( Integer duration) {
+ setParameters(KEY_DURATION, duration);
+ return this;
}
/**
* Gets a Boolean value representing the alert tone
@@ -346,15 +351,16 @@ public class Alert extends RPCRequest {
/**
* 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);
+ */
+ public Alert setPlayTone( Boolean playTone) {
+ setParameters(KEY_PLAY_TONE, playTone);
+ return this;
}
/**
@@ -371,7 +377,7 @@ public class Alert extends RPCRequest {
/**
* Sets the SoftButtons
- *
+ *
* @param softButtons
* a List<SoftButton> value
* <p>
@@ -384,8 +390,9 @@ public class Alert extends RPCRequest {
* </ul>
* @since SmartDeviceLink 2.0
*/
- public void setSoftButtons(List<SoftButton> softButtons) {
- setParameters(KEY_SOFT_BUTTONS, softButtons);
+ public Alert setSoftButtons( List<SoftButton> softButtons) {
+ setParameters(KEY_SOFT_BUTTONS, softButtons);
+ return this;
}
/**
@@ -406,8 +413,9 @@ public class Alert extends RPCRequest {
*
* @since SmartDeviceLink 3.0
*/
- public void setProgressIndicator(Boolean progressIndicator) {
+ public Alert setProgressIndicator( Boolean progressIndicator) {
setParameters(KEY_PROGRESS_INDICATOR, progressIndicator);
+ return this;
}
/**
@@ -428,9 +436,10 @@ public class Alert extends RPCRequest {
*
* @since SmartDeviceLink 6.0
*/
- public void setCancelID(Integer cancelID) {
- setParameters(KEY_CANCEL_ID, cancelID);
- };
+ public Alert setCancelID( Integer cancelID) {
+ setParameters(KEY_CANCEL_ID, cancelID);
+ return this;
+ }
/**
* <p>Sets the Image
@@ -441,9 +450,10 @@ public class Alert extends RPCRequest {
* <b>Notes: </b>If omitted on supported displays, no (or the
* default if applicable) icon will be displayed</p>
*/
- public void setAlertIcon(Image alertIcon) {
- setParameters(KEY_ALERT_ICON, alertIcon);
- }
+ public Alert setAlertIcon( Image alertIcon) {
+ setParameters(KEY_ALERT_ICON, alertIcon);
+ return this;
+ }
/**
* <p>Gets the image to be shown along with the alert </p>
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java
index 37b6c2da3..9e5fb32b7 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertManeuver.java
@@ -86,7 +86,7 @@ public class AlertManeuver extends RPCRequest{
/**
* Sets the SoftButtons
- *
+ *
* @param softButtons
* a List<SoftButton> value
* <p>
@@ -99,8 +99,9 @@ public class AlertManeuver extends RPCRequest{
* @since SmartDeviceLink 2.0
*/
- public void setSoftButtons(List<SoftButton> softButtons){
+ public AlertManeuver setSoftButtons( List<SoftButton> softButtons) {
setParameters(KEY_SOFT_BUTTONS, softButtons);
+ return this;
}
/**
@@ -115,13 +116,14 @@ public class AlertManeuver extends RPCRequest{
/**
* 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){
+ public AlertManeuver setTtsChunks( List<TTSChunk> ttsChunks) {
setParameters(KEY_TTS_CHUNKS, ttsChunks);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java
index a2fae73be..3ad14972b 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AlertResponse.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -78,7 +78,8 @@ public class AlertResponse extends RPCResponse {
public Integer getTryAgainTime() {
return getInteger(KEY_TRY_AGAIN_TIME);
}
- public void setTryAgainTime(Integer tryAgainTime) {
+ public AlertResponse setTryAgainTime( Integer tryAgainTime) {
setParameters(KEY_TRY_AGAIN_TIME, tryAgainTime);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppInfo.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppInfo.java
index a71d7b6e2..b07e918d1 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppInfo.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppInfo.java
@@ -73,9 +73,10 @@ public class AppInfo extends RPCStruct {
/** Sets the name displayed for the mobile application on the mobile device (can differ from the app name set in the initial RAI request).
* @param appDisplayName - name displayed for the mobile application on the mobile device.
*/
- public void setAppDisplayName(@NonNull String appDisplayName) {
- setValue(KEY_APP_DISPLAY_NAME, appDisplayName);
- }
+ public AppInfo setAppDisplayName(@NonNull String appDisplayName) {
+ setValue(KEY_APP_DISPLAY_NAME, appDisplayName);
+ return this;
+ }
/** Gets the name displayed for the mobile application on the mobile device (can differ from the app name set in the initial RAI request).
* @return appDisplayName - name displayed for the mobile application on the mobile device.
@@ -87,9 +88,10 @@ public class AppInfo extends RPCStruct {
/** Sets package name of the Android application. This supports App Launch strategies for each platform.
* @param appBundleID - package name of the application
*/
- public void setAppBundleID(@NonNull String appBundleID) {
- setValue(KEY_APP_BUNDLE_ID, appBundleID);
- }
+ public AppInfo setAppBundleID(@NonNull String appBundleID) {
+ setValue(KEY_APP_BUNDLE_ID, appBundleID);
+ return this;
+ }
/** Gets package name of the Android application. This supports App Launch strategies for each platform.
* @return appBundleID - package name of the application.
@@ -101,9 +103,10 @@ public class AppInfo extends RPCStruct {
/** Sets build version number of this particular mobile app.
* @param appVersion - build version number of this particular mobile app.
*/
- public void setAppVersion(@NonNull String appVersion) {
- setValue(KEY_APP_VERSION, appVersion);
- }
+ public AppInfo setAppVersion(@NonNull String appVersion) {
+ setValue(KEY_APP_VERSION, appVersion);
+ return this;
+ }
/** Gets build version number of this particular mobile app.
* @return appVersion - build version number of this particular mobile app.
@@ -115,9 +118,10 @@ public class AppInfo extends RPCStruct {
/** Sets file reference to the icon utilized by this app (simplifies the process of setting an app icon during app registration).
* @param appIcon - file reference to the icon utilized by this app
*/
- public void setAppIcon(String appIcon) {
- setValue(KEY_APP_ICON, appIcon);
- }
+ public AppInfo setAppIcon( String appIcon) {
+ setValue(KEY_APP_ICON, appIcon);
+ return this;
+ }
/** Gets build version number of this particular mobile app.
* @return appIcon - build version number of this particular mobile app.
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java
index 780ac13ed..3f46cbb7a 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceCapability.java
@@ -69,9 +69,10 @@ public class AppServiceCapability extends RPCStruct {
* Only included in OnSystemCapabilityUpdated. Update reason for this service record.
* @param updateReason -
*/
- public void setUpdateReason(ServiceUpdateReason updateReason){
- setValue(KEY_UPDATE_REASON, updateReason);
- }
+ public AppServiceCapability setUpdateReason( ServiceUpdateReason updateReason) {
+ setValue(KEY_UPDATE_REASON, updateReason);
+ return this;
+ }
/**
* Only included in OnSystemCapabilityUpdated. Update reason for this service record.
@@ -85,9 +86,10 @@ public class AppServiceCapability extends RPCStruct {
* Only included in OnSystemCapabilityUpdated. Update reason for this service record.
* @param updatedAppServiceRecord -
*/
- public void setUpdatedAppServiceRecord(AppServiceRecord updatedAppServiceRecord){
- setValue(KEY_UPDATED_APP_SERVICE_RECORD, updatedAppServiceRecord);
- }
+ public AppServiceCapability setUpdatedAppServiceRecord( AppServiceRecord updatedAppServiceRecord) {
+ setValue(KEY_UPDATED_APP_SERVICE_RECORD, updatedAppServiceRecord);
+ return this;
+ }
/**
* Only included in OnSystemCapabilityUpdated. Update reason for this service record.
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java
index 1a441a7fa..529815cfc 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceData.java
@@ -68,9 +68,10 @@ public class AppServiceData extends RPCStruct {
/**
* @param serviceType -
*/
- public void setServiceType(@NonNull String serviceType) {
- setValue(KEY_SERVICE_TYPE, serviceType);
- }
+ public AppServiceData setServiceType(@NonNull String serviceType) {
+ setValue(KEY_SERVICE_TYPE, serviceType);
+ return this;
+ }
/**
* @return serviceType -
@@ -82,9 +83,10 @@ public class AppServiceData extends RPCStruct {
/**
* @param serviceId -
*/
- public void setServiceID(@NonNull String serviceId) {
- setValue(KEY_SERVICE_ID, serviceId);
- }
+ public AppServiceData setServiceID(@NonNull String serviceId) {
+ setValue(KEY_SERVICE_ID, serviceId);
+ return this;
+ }
/**
* @return serviceId -
@@ -96,9 +98,10 @@ public class AppServiceData extends RPCStruct {
/**
* @param mediaServiceData -
*/
- public void setMediaServiceData(MediaServiceData mediaServiceData) {
- setValue(KEY_MEDIA_SERVICE_DATA, mediaServiceData);
- }
+ public AppServiceData setMediaServiceData( MediaServiceData mediaServiceData) {
+ setValue(KEY_MEDIA_SERVICE_DATA, mediaServiceData);
+ return this;
+ }
/**
* @return mediaServiceData -
@@ -110,9 +113,10 @@ public class AppServiceData extends RPCStruct {
/**
* @param weatherServiceData -
*/
- public void setWeatherServiceData(WeatherServiceData weatherServiceData) {
- setValue(KEY_WEATHER_SERVICE_DATA, weatherServiceData);
- }
+ public AppServiceData setWeatherServiceData( WeatherServiceData weatherServiceData) {
+ setValue(KEY_WEATHER_SERVICE_DATA, weatherServiceData);
+ return this;
+ }
/**
* @return weatherServiceData -
@@ -124,9 +128,10 @@ public class AppServiceData extends RPCStruct {
/**
* @param navigationServiceData -
*/
- public void setNavigationServiceData(NavigationServiceData navigationServiceData) {
- setValue(KEY_NAVIGATION_SERVICE_DATA, navigationServiceData);
- }
+ public AppServiceData setNavigationServiceData( NavigationServiceData navigationServiceData) {
+ setValue(KEY_NAVIGATION_SERVICE_DATA, navigationServiceData);
+ return this;
+ }
/**
* @return navigationServiceData -
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java
index 9f2e4e2f6..9de0201b9 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceManifest.java
@@ -88,9 +88,10 @@ public class AppServiceManifest extends RPCStruct {
* Unique name of this service
* @param serviceName - the service name
*/
- public void setServiceName(String serviceName){
- setValue(KEY_SERVICE_NAME, serviceName);
- }
+ public AppServiceManifest setServiceName( String serviceName) {
+ setValue(KEY_SERVICE_NAME, serviceName);
+ return this;
+ }
/**
* Unique name of this service
@@ -102,12 +103,13 @@ public class AppServiceManifest extends RPCStruct {
/**
* 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
+ * @param serviceType - the serviceType use {@link AppServiceType}
+ * @see AppServiceType
*/
- public void setServiceType(@NonNull String serviceType){
- setValue(KEY_SERVICE_TYPE, serviceType);
- }
+ public AppServiceManifest setServiceType(@NonNull String serviceType) {
+ setValue(KEY_SERVICE_TYPE, serviceType);
+ return this;
+ }
/**
* The type of service that is to be offered by this app
@@ -122,9 +124,10 @@ public class AppServiceManifest extends RPCStruct {
* 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);
- }
+ public AppServiceManifest setServiceIcon( Image serviceIcon) {
+ setValue(KEY_SERVICE_ICON, serviceIcon);
+ return this;
+ }
/**
* The icon to be associated with this service Most likely the same as the appIcon.
@@ -139,9 +142,10 @@ public class AppServiceManifest extends RPCStruct {
* 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);
- }
+ public AppServiceManifest setAllowAppConsumers( Boolean allowAppConsumers) {
+ setValue(KEY_ALLOW_APP_CONSUMERS, allowAppConsumers);
+ return this;
+ }
/**
* If true, app service consumers beyond the IVI system will be able to access this service. If false,
@@ -157,9 +161,10 @@ public class AppServiceManifest extends RPCStruct {
* 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);
- }
+ public AppServiceManifest setRpcSpecVersion( SdlMsgVersion rpcSpecVersion) {
+ setValue(KEY_RPC_SPEC_VERSION, rpcSpecVersion);
+ return this;
+ }
/**
* This is the max RPC Spec version the app service understands. This is important during the RPC pass through functionality.
@@ -174,20 +179,21 @@ public class AppServiceManifest extends RPCStruct {
* 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)
+ * @see FunctionID
+ * @see #setHandledRpcsUsingFunctionIDs( List )
*/
- public void setHandledRpcs(List<Integer> handledRPCs){
- setValue(KEY_HANDLED_RPCS, handledRPCs);
- }
+ public AppServiceManifest setHandledRpcs( List<Integer> handledRPCs) {
+ setValue(KEY_HANDLED_RPCS, handledRPCs);
+ return this;
+ }
/**
* 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)
+ * @see #setHandledRpcs( List )
*/
- public void setHandledRpcsUsingFunctionIDs(List<FunctionID> handledRPCs){
- if(handledRPCs != null){
+ public AppServiceManifest setHandledRpcsUsingFunctionIDs( List<FunctionID> handledRPCs) {
+ if(handledRPCs != null){
List<Integer> rpcIds = new ArrayList<>();
for(FunctionID functionID : handledRPCs){
rpcIds.add(functionID.getId());
@@ -196,7 +202,8 @@ public class AppServiceManifest extends RPCStruct {
}else{
setValue(KEY_HANDLED_RPCS, null);
}
- }
+ return this;
+ }
/**
* This field contains the FunctionID integer ID values for the RPCs that this service intends to handle correctly.
@@ -213,9 +220,10 @@ public class AppServiceManifest extends RPCStruct {
* The MediaServiceManifest
* @param mediaServiceManifest - The mediaServiceManifest
*/
- public void setMediaServiceManifest(MediaServiceManifest mediaServiceManifest){
- setValue(KEY_MEDIA_SERVICE_MANIFEST, mediaServiceManifest);
- }
+ public AppServiceManifest setMediaServiceManifest( MediaServiceManifest mediaServiceManifest) {
+ setValue(KEY_MEDIA_SERVICE_MANIFEST, mediaServiceManifest);
+ return this;
+ }
/**
* The MediaServiceManifest
@@ -229,9 +237,10 @@ public class AppServiceManifest extends RPCStruct {
* The WeatherServiceManifest
* @param weatherServiceManifest - The weatherServiceManifest
*/
- public void setWeatherServiceManifest(WeatherServiceManifest weatherServiceManifest){
- setValue(KEY_WEATHER_SERVICE_MANIFEST, weatherServiceManifest);
- }
+ public AppServiceManifest setWeatherServiceManifest( WeatherServiceManifest weatherServiceManifest) {
+ setValue(KEY_WEATHER_SERVICE_MANIFEST, weatherServiceManifest);
+ return this;
+ }
/**
* The WeatherServiceManifest
@@ -245,9 +254,10 @@ public class AppServiceManifest extends RPCStruct {
* The NavigationServiceManifest
* @param navigationServiceManifest - The navigationServiceManifest
*/
- public void setNavigationServiceManifest(NavigationServiceManifest navigationServiceManifest){
- setValue(KEY_NAVIGATION_SERVICE_MANIFEST, navigationServiceManifest);
- }
+ public AppServiceManifest setNavigationServiceManifest( NavigationServiceManifest navigationServiceManifest) {
+ setValue(KEY_NAVIGATION_SERVICE_MANIFEST, navigationServiceManifest);
+ return this;
+ }
/**
* The NavigationServiceManifest
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java
index 198be4e26..d59cb8fe0 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServiceRecord.java
@@ -70,9 +70,10 @@ public class AppServiceRecord extends RPCStruct {
* ID of this service
* @param serviceID - the service ID
*/
- public void setServiceID(@NonNull String serviceID){
- setValue(KEY_SERVICE_ID, serviceID);
- }
+ public AppServiceRecord setServiceID(@NonNull String serviceID) {
+ setValue(KEY_SERVICE_ID, serviceID);
+ return this;
+ }
/**
* ID of this service
@@ -86,9 +87,10 @@ public class AppServiceRecord extends RPCStruct {
* the App Service Manifest
* @param serviceManifest - the App Service Manifest
*/
- public void setServiceManifest(@NonNull AppServiceManifest serviceManifest){
- setValue(KEY_SERVICE_MANIFEST, serviceManifest);
- }
+ public AppServiceRecord setServiceManifest(@NonNull AppServiceManifest serviceManifest) {
+ setValue(KEY_SERVICE_MANIFEST, serviceManifest);
+ return this;
+ }
/**
* the App Service Manifest
@@ -103,9 +105,10 @@ public class AppServiceRecord extends RPCStruct {
* unpublished, and should be considered unavailable.
* @param servicePublished - boolean
*/
- public void setServicePublished(@NonNull Boolean servicePublished){
- setValue(KEY_SERVICE_PUBLISHED, servicePublished);
- }
+ public AppServiceRecord setServicePublished(@NonNull Boolean servicePublished) {
+ setValue(KEY_SERVICE_PUBLISHED, servicePublished);
+ return this;
+ }
/**
* If true, the service is published and available. If false, the service has likely just been
@@ -122,9 +125,10 @@ public class AppServiceRecord extends RPCStruct {
* service of the supplied type. See servicePublished for its availability.
* @param serviceActive - boolean
*/
- public void setServiceActive(@NonNull Boolean serviceActive){
- setValue(KEY_SERVICE_ACTIVE, serviceActive);
- }
+ public AppServiceRecord setServiceActive(@NonNull Boolean serviceActive) {
+ setValue(KEY_SERVICE_ACTIVE, serviceActive);
+ return this;
+ }
/**
* If true, the service is the active primary service of the supplied service type. It will receive
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java
index 63d3dd6a5..30cac40fa 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AppServicesCapabilities.java
@@ -72,9 +72,10 @@ public class AppServicesCapabilities extends RPCStruct {
* 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);
- }
+ public AppServicesCapabilities setAppServices( List<AppServiceCapability> appServices) {
+ setValue(KEY_APP_SERVICES, appServices);
+ return this;
+ }
/**
* An array of currently available services. If this is an update to the
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java
index 7ee26175e..ecb6daef8 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlCapabilities.java
@@ -76,9 +76,10 @@ public class AudioControlCapabilities extends RPCStruct {
*
* @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);
- }
+ public AudioControlCapabilities setModuleName(@NonNull String moduleName) {
+ setValue(KEY_MODULE_NAME, moduleName);
+ return this;
+ }
/**
* Gets the moduleName portion of the AudioControlCapabilities class
@@ -94,9 +95,10 @@ public class AudioControlCapabilities extends RPCStruct {
*
* @param keepContextAvailable Availability of the keepContext parameter.
*/
- public void setKeepContextAvailable(Boolean keepContextAvailable) {
- setValue(KEY_KEEP_CONTEXT_AVAILABLE, keepContextAvailable);
- }
+ public AudioControlCapabilities setKeepContextAvailable( Boolean keepContextAvailable) {
+ setValue(KEY_KEEP_CONTEXT_AVAILABLE, keepContextAvailable);
+ return this;
+ }
/**
* Gets the keepContextAvailable portion of the AudioControlCapabilities class
@@ -112,9 +114,10 @@ public class AudioControlCapabilities extends RPCStruct {
*
* @param sourceAvailable Availability of the control of audio source.
*/
- public void setSourceAvailable(Boolean sourceAvailable) {
- setValue(KEY_SOURCE_AVAILABLE, sourceAvailable);
- }
+ public AudioControlCapabilities setSourceAvailable( Boolean sourceAvailable) {
+ setValue(KEY_SOURCE_AVAILABLE, sourceAvailable);
+ return this;
+ }
/**
* Gets the sourceAvailable portion of the AudioControlCapabilities class
@@ -130,9 +133,10 @@ public class AudioControlCapabilities extends RPCStruct {
*
* @param volumeAvailable Availability of the control of audio volume.
*/
- public void setVolumeAvailable(Boolean volumeAvailable) {
- setValue(KEY_VOLUME_AVAILABLE, volumeAvailable);
- }
+ public AudioControlCapabilities setVolumeAvailable( Boolean volumeAvailable) {
+ setValue(KEY_VOLUME_AVAILABLE, volumeAvailable);
+ return this;
+ }
/**
* Gets the volumeAvailable portion of the AudioControlCapabilities class
@@ -148,9 +152,10 @@ public class AudioControlCapabilities extends RPCStruct {
*
* @param equalizerAvailable Availability of the control of Equalizer Settings.
*/
- public void setEqualizerAvailable(Boolean equalizerAvailable) {
- setValue(KEY_EQUALIZER_AVAILABLE, equalizerAvailable);
- }
+ public AudioControlCapabilities setEqualizerAvailable( Boolean equalizerAvailable) {
+ setValue(KEY_EQUALIZER_AVAILABLE, equalizerAvailable);
+ return this;
+ }
/**
* Gets the equalizerAvailable portion of the AudioControlCapabilities class
@@ -166,9 +171,10 @@ public class AudioControlCapabilities extends RPCStruct {
*
* @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);
- }
+ public AudioControlCapabilities setEqualizerMaxChannelId( Integer equalizerMaxChannelId) {
+ setValue(KEY_EQUALIZER_MAX_CHANNEL_ID, equalizerMaxChannelId);
+ return this;
+ }
/**
* Gets the equalizerMaxChannelId portion of the AudioControlCapabilities class
@@ -183,9 +189,10 @@ public class AudioControlCapabilities extends RPCStruct {
* Sets ModuleInfo for this capability
* @param info the ModuleInfo to be set
*/
- public void setModuleInfo(ModuleInfo info) {
- setValue(KEY_MODULE_INFO, info);
- }
+ public AudioControlCapabilities setModuleInfo( ModuleInfo info) {
+ setValue(KEY_MODULE_INFO, info);
+ return this;
+ }
/**
* Gets a ModuleInfo of this capability
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java
index ff95186d5..2de646ff6 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioControlData.java
@@ -65,9 +65,10 @@ public class AudioControlData extends RPCStruct {
* 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);
- }
+ public AudioControlData setSource( PrimaryAudioSource source) {
+ setValue(KEY_SOURCE, source);
+ return this;
+ }
/**
* Gets the source portion of the AudioControlData class
@@ -89,9 +90,10 @@ public class AudioControlData extends RPCStruct {
* 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);
- }
+ public AudioControlData setKeepContext( Boolean keepContext) {
+ setValue(KEY_KEEP_CONTEXT, keepContext);
+ return this;
+ }
/**
* Gets the keepContext portion of the AudioControlData class
@@ -111,9 +113,10 @@ public class AudioControlData extends RPCStruct {
*
* @param volume Reflects the volume of audio, from 0%-100%.
*/
- public void setVolume(Integer volume) {
- setValue(KEY_VOLUME, volume);
- }
+ public AudioControlData setVolume( Integer volume) {
+ setValue(KEY_VOLUME, volume);
+ return this;
+ }
/**
* Gets the volume portion of the AudioControlData class
@@ -139,8 +142,9 @@ public class AudioControlData extends RPCStruct {
*
* @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);
- }
+ public AudioControlData setEqualizerSettings( List<EqualizerSettings> equalizerSettings) {
+ setValue(KEY_EQUALIZER_SETTINGS, equalizerSettings);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java
index 38f2f80bb..8311de9ac 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/AudioPassThruCapabilities.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -69,7 +69,7 @@ import java.util.Hashtable;
* <tr>
* <td>audioType</td>
* <td>AudioType</td>
- * <td>Describes the audiotype for AudioPassThru
+ * <td>Describes the audioType for AudioPassThru
* </td>
* <td>SmartDeviceLink 2.0</td>
* </tr>
@@ -97,7 +97,7 @@ public class AudioPassThruCapabilities extends RPCStruct {
* 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
+ * @param audioType the audioType for AudioPassThru
*/
public AudioPassThruCapabilities(@NonNull SamplingRate samplingRate, @NonNull BitsPerSample bitsPerSample, @NonNull AudioType audioType) {
this();
@@ -110,8 +110,9 @@ public class AudioPassThruCapabilities extends RPCStruct {
* set the sampling rate for AudioPassThru
* @param samplingRate the sampling rate for AudioPassThru
*/
- public void setSamplingRate(@NonNull SamplingRate samplingRate) {
- setValue(KEY_SAMPLING_RATE, samplingRate);
+ public AudioPassThruCapabilities setSamplingRate(@NonNull SamplingRate samplingRate) {
+ setValue(KEY_SAMPLING_RATE, samplingRate);
+ return this;
}
/**
@@ -126,8 +127,9 @@ public class AudioPassThruCapabilities extends RPCStruct {
* 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);
+ public AudioPassThruCapabilities setBitsPerSample(@NonNull BitsPerSample bitsPerSample) {
+ setValue(KEY_BITS_PER_SAMPLE, bitsPerSample);
+ return this;
}
/**
@@ -139,16 +141,17 @@ public class AudioPassThruCapabilities extends RPCStruct {
}
/**
- * set the audiotype for AudioPassThru
- * @param audioType the audiotype for AudioPassThru
+ * set the audioType for AudioPassThru
+ * @param audioType the audioType for AudioPassThru
*/
- public void setAudioType(@NonNull AudioType audioType) {
- setValue(KEY_AUDIO_TYPE, audioType);
+ public AudioPassThruCapabilities setAudioType(@NonNull AudioType audioType) {
+ setValue(KEY_AUDIO_TYPE, audioType);
+ return this;
}
/**
- * get the audiotype for AudioPassThru
- * @return the audiotype for AudioPassThru
+ * 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
index ff01b72e4..faa10d607 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/BeltStatus.java
@@ -200,92 +200,107 @@ public class BeltStatus extends RPCStruct {
setMiddleRow1BuckleBelted(middleRow1BuckleBelted);
}
- public void setDriverBeltDeployed(@NonNull VehicleDataEventStatus driverBeltDeployed) {
+ public BeltStatus setDriverBeltDeployed(@NonNull VehicleDataEventStatus driverBeltDeployed) {
setValue(KEY_DRIVER_BELT_DEPLOYED, driverBeltDeployed);
+ return this;
}
public VehicleDataEventStatus getDriverBeltDeployed() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BELT_DEPLOYED);
}
- public void setPassengerBeltDeployed(@NonNull VehicleDataEventStatus passengerBeltDeployed) {
+ public BeltStatus setPassengerBeltDeployed(@NonNull VehicleDataEventStatus passengerBeltDeployed) {
setValue(KEY_PASSENGER_BELT_DEPLOYED, passengerBeltDeployed);
+ return this;
}
public VehicleDataEventStatus getPassengerBeltDeployed() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_BELT_DEPLOYED);
}
- public void setPassengerBuckleBelted(@NonNull VehicleDataEventStatus passengerBuckleBelted) {
+ public BeltStatus setPassengerBuckleBelted(@NonNull VehicleDataEventStatus passengerBuckleBelted) {
setValue(KEY_PASSENGER_BUCKLE_BELTED, passengerBuckleBelted);
+ return this;
}
public VehicleDataEventStatus getPassengerBuckleBelted() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_BUCKLE_BELTED);
}
- public void setDriverBuckleBelted(VehicleDataEventStatus driverBuckleBelted) {
+ public BeltStatus setDriverBuckleBelted( VehicleDataEventStatus driverBuckleBelted) {
setValue(KEY_DRIVER_BUCKLE_BELTED, driverBuckleBelted);
+ return this;
}
public VehicleDataEventStatus getDriverBuckleBelted() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BUCKLE_BELTED);
}
- public void setLeftRow2BuckleBelted(VehicleDataEventStatus leftRow2BuckleBelted) {
+ public BeltStatus setLeftRow2BuckleBelted( VehicleDataEventStatus leftRow2BuckleBelted) {
setValue(KEY_LEFT_ROW_2_BUCKLE_BELTED, leftRow2BuckleBelted);
+ return this;
}
public VehicleDataEventStatus getLeftRow2BuckleBelted() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_LEFT_ROW_2_BUCKLE_BELTED);
}
- public void setPassengerChildDetected(@NonNull VehicleDataEventStatus passengerChildDetected) {
+ public BeltStatus setPassengerChildDetected(@NonNull VehicleDataEventStatus passengerChildDetected) {
setValue(KEY_PASSENGER_CHILD_DETECTED, passengerChildDetected);
+ return this;
}
public VehicleDataEventStatus getPassengerChildDetected() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_PASSENGER_CHILD_DETECTED);
}
- public void setRightRow2BuckleBelted(@NonNull VehicleDataEventStatus rightRow2BuckleBelted) {
+ public BeltStatus setRightRow2BuckleBelted(@NonNull VehicleDataEventStatus rightRow2BuckleBelted) {
setValue(KEY_RIGHT_ROW_2_BUCKLE_BELTED, rightRow2BuckleBelted);
+ return this;
}
public VehicleDataEventStatus getRightRow2BuckleBelted() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_RIGHT_ROW_2_BUCKLE_BELTED);
}
- public void setMiddleRow2BuckleBelted(@NonNull VehicleDataEventStatus middleRow2BuckleBelted) {
+ public BeltStatus setMiddleRow2BuckleBelted(@NonNull VehicleDataEventStatus middleRow2BuckleBelted) {
setValue(KEY_MIDDLE_ROW_2_BUCKLE_BELTED, middleRow2BuckleBelted);
+ return this;
}
public VehicleDataEventStatus getMiddleRow2BuckleBelted() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MIDDLE_ROW_2_BUCKLE_BELTED);
}
- public void setMiddleRow3BuckleBelted(@NonNull VehicleDataEventStatus middleRow3BuckleBelted) {
+ public BeltStatus setMiddleRow3BuckleBelted(@NonNull VehicleDataEventStatus middleRow3BuckleBelted) {
setValue(KEY_MIDDLE_ROW_3_BUCKLE_BELTED, middleRow3BuckleBelted);
+ return this;
}
public VehicleDataEventStatus getMiddleRow3BuckleBelted() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MIDDLE_ROW_3_BUCKLE_BELTED);
}
- public void setLeftRow3BuckleBelted(@NonNull VehicleDataEventStatus leftRow3BuckleBelted) {
+ public BeltStatus setLeftRow3BuckleBelted(@NonNull VehicleDataEventStatus leftRow3BuckleBelted) {
setValue(KEY_LEFT_ROW_3_BUCKLE_BELTED, leftRow3BuckleBelted);
+ return this;
}
public VehicleDataEventStatus getLeftRow3BuckleBelted() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_LEFT_ROW_3_BUCKLE_BELTED);
}
- public void setRightRow3BuckleBelted(@NonNull VehicleDataEventStatus rightRow3BuckleBelted) {
+ public BeltStatus setRightRow3BuckleBelted(@NonNull VehicleDataEventStatus rightRow3BuckleBelted) {
setValue(KEY_RIGHT_ROW_3_BUCKLE_BELTED, rightRow3BuckleBelted);
+ return this;
}
public VehicleDataEventStatus getRightRow3BuckleBelted() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_RIGHT_ROW_3_BUCKLE_BELTED);
}
- public void setLeftRearInflatableBelted(@NonNull VehicleDataEventStatus rearInflatableBelted) {
+ public BeltStatus setLeftRearInflatableBelted(@NonNull VehicleDataEventStatus rearInflatableBelted) {
setValue(KEY_LEFT_REAR_INFLATABLE_BELTED, rearInflatableBelted);
+ return this;
}
public VehicleDataEventStatus getLeftRearInflatableBelted() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_LEFT_REAR_INFLATABLE_BELTED);
}
- public void setRightRearInflatableBelted(@NonNull VehicleDataEventStatus rightRearInflatableBelted) {
+ public BeltStatus setRightRearInflatableBelted(@NonNull VehicleDataEventStatus rightRearInflatableBelted) {
setValue(KEY_RIGHT_REAR_INFLATABLE_BELTED, rightRearInflatableBelted);
+ return this;
}
public VehicleDataEventStatus getRightRearInflatableBelted() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_RIGHT_REAR_INFLATABLE_BELTED);
}
- public void setMiddleRow1BeltDeployed(@NonNull VehicleDataEventStatus middleRow1BeltDeployed) {
+ public BeltStatus setMiddleRow1BeltDeployed(@NonNull VehicleDataEventStatus middleRow1BeltDeployed) {
setValue(KEY_MIDDLE_ROW_1_BELT_DEPLOYED, middleRow1BeltDeployed);
+ return this;
}
public VehicleDataEventStatus getMiddleRow1BeltDeployed() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MIDDLE_ROW_1_BELT_DEPLOYED);
}
- public void setMiddleRow1BuckleBelted(@NonNull VehicleDataEventStatus middleRow1BuckleBelted) {
+ public BeltStatus setMiddleRow1BuckleBelted(@NonNull VehicleDataEventStatus middleRow1BuckleBelted) {
setValue(KEY_MIDDLE_ROW_1_BUCKLE_BELTED, middleRow1BuckleBelted);
+ return this;
}
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
index a502e1df6..391d2928d 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -56,7 +56,7 @@ import java.util.Hashtable;
* <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>Describes, if the park break is active. The information about the park brake: - true, if active - false if not.</td>
* <td>SmartDeviceLink 2.0</td>
* </tr>
* <tr>
@@ -142,50 +142,57 @@ public class BodyInformation extends RPCStruct {
setIgnitionStableStatus(ignitionStableStatus);
setIgnitionStatus(ignitionStatus);
}
- public void setParkBrakeActive(@NonNull Boolean parkBrakeActive) {
+ public BodyInformation setParkBrakeActive(@NonNull Boolean parkBrakeActive) {
setValue(KEY_PARK_BRAKE_ACTIVE, parkBrakeActive);
+ return this;
}
public Boolean getParkBrakeActive() {
return getBoolean(KEY_PARK_BRAKE_ACTIVE);
}
- public void setIgnitionStableStatus(@NonNull IgnitionStableStatus ignitionStableStatus) {
+ public BodyInformation setIgnitionStableStatus(@NonNull IgnitionStableStatus ignitionStableStatus) {
setValue(KEY_IGNITION_STABLE_STATUS, ignitionStableStatus);
+ return this;
}
public IgnitionStableStatus getIgnitionStableStatus() {
return (IgnitionStableStatus) getObject(IgnitionStableStatus.class, KEY_IGNITION_STABLE_STATUS);
}
- public void setIgnitionStatus(@NonNull IgnitionStatus ignitionStatus) {
+ public BodyInformation setIgnitionStatus(@NonNull IgnitionStatus ignitionStatus) {
setValue(KEY_IGNITION_STATUS, ignitionStatus);
+ return this;
}
public IgnitionStatus getIgnitionStatus() {
return (IgnitionStatus) getObject(IgnitionStatus.class, KEY_IGNITION_STATUS);
}
- public void setDriverDoorAjar(Boolean driverDoorAjar) {
+ public BodyInformation setDriverDoorAjar( Boolean driverDoorAjar) {
setValue(KEY_DRIVER_DOOR_AJAR, driverDoorAjar);
- }
+ return this;
+ }
public Boolean getDriverDoorAjar() {
return getBoolean(KEY_DRIVER_DOOR_AJAR);
}
- public void setPassengerDoorAjar(Boolean passengerDoorAjar) {
+ public BodyInformation setPassengerDoorAjar( Boolean passengerDoorAjar) {
setValue(KEY_PASSENGER_DOOR_AJAR, passengerDoorAjar);
- }
+ return this;
+ }
public Boolean getPassengerDoorAjar() {
return getBoolean(KEY_PASSENGER_DOOR_AJAR);
}
- public void setRearLeftDoorAjar(Boolean rearLeftDoorAjar) {
+ public BodyInformation setRearLeftDoorAjar( Boolean rearLeftDoorAjar) {
setValue(KEY_REAR_LEFT_DOOR_AJAR, rearLeftDoorAjar);
- }
+ return this;
+ }
public Boolean getRearLeftDoorAjar() {
return getBoolean(KEY_REAR_LEFT_DOOR_AJAR);
}
- public void setRearRightDoorAjar(Boolean rearRightDoorAjar) {
+ public BodyInformation setRearRightDoorAjar( Boolean rearRightDoorAjar) {
setValue(KEY_REAR_RIGHT_DOOR_AJAR, rearRightDoorAjar);
- }
+ return this;
+ }
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
index 1a8cb4df9..d2d5246be 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonCapabilities.java
@@ -133,9 +133,10 @@ public class ButtonCapabilities extends RPCStruct {
/**
* Set the name of theSDL HMI button.
* @param name the name of button
- */
- public void setName( @NonNull ButtonName name ) {
+ */
+ public ButtonCapabilities setName(@NonNull ButtonName name) {
setValue(KEY_NAME, name);
+ return this;
}
/**
* Whether the button supports a SHORT press. See <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode}</i> for more information.
@@ -147,9 +148,10 @@ public class ButtonCapabilities extends RPCStruct {
/**
* 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 ) {
+ */
+ public ButtonCapabilities setShortPressAvailable(@NonNull Boolean shortPressAvailable) {
setValue(KEY_SHORT_PRESS_AVAILABLE, shortPressAvailable);
+ return this;
}
/**
* Whether the button supports a LONG press. See <i>{@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonPressMode}</i> for more information.
@@ -161,9 +163,10 @@ public class ButtonCapabilities extends RPCStruct {
/**
* 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 ) {
+ */
+ public ButtonCapabilities setLongPressAvailable(@NonNull Boolean longPressAvailable) {
setValue(KEY_LONG_PRESS_AVAILABLE, longPressAvailable);
+ return this;
}
/**
* 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.
@@ -175,17 +178,19 @@ public class ButtonCapabilities extends RPCStruct {
/**
* 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 ) {
+ */
+ public ButtonCapabilities setUpDownAvailable(@NonNull Boolean upDownAvailable) {
setValue(KEY_UP_DOWN_AVAILABLE, upDownAvailable);
+ return this;
}
/**
* Sets ModuleInfo for this capability
* @param info the ModuleInfo to be set
*/
- public void setModuleInfo(ModuleInfo info) {
+ public ButtonCapabilities setModuleInfo( ModuleInfo info) {
setValue(KEY_MODULE_INFO, info);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java
index 645ae336d..ecdac7b95 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ButtonPress.java
@@ -96,8 +96,9 @@ public class ButtonPress extends RPCRequest {
* @param moduleType
* Represents module where the button should be pressed
*/
- public void setModuleType(@NonNull ModuleType moduleType) {
+ public ButtonPress setModuleType(@NonNull ModuleType moduleType) {
setParameters(KEY_MODULE_TYPE, moduleType);
+ return this;
}
/**
@@ -115,8 +116,9 @@ public class ButtonPress extends RPCRequest {
* @param buttonName
* Represents name of supported RC climate or radio button
*/
- public void setButtonName(@NonNull ButtonName buttonName) {
+ public ButtonPress setButtonName(@NonNull ButtonName buttonName) {
setParameters(KEY_BUTTON_NAME, buttonName);
+ return this;
}
/**
@@ -134,16 +136,18 @@ public class ButtonPress extends RPCRequest {
* @param buttonPressMode
* Indicates whether this is a LONG or SHORT button press event.
*/
- public void setButtonPressMode(@NonNull ButtonPressMode buttonPressMode) {
+ public ButtonPress setButtonPressMode(@NonNull ButtonPressMode buttonPressMode) {
setParameters(KEY_BUTTON_PRESS_MODE, buttonPressMode);
+ return this;
}
/**
* Sets the module id for this object
* @param id the id to be set
*/
- public void setModuleId(String id) {
+ public ButtonPress setModuleId( String id) {
setParameters(KEY_MODULE_ID, id);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteraction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteraction.java
index 9016458a6..16de2d9f7 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteraction.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CancelInteraction.java
@@ -104,8 +104,9 @@ public class CancelInteraction extends RPCRequest {
* Only values 10 (PerformInteractionID), 12 (AlertID), 25 (ScrollableMessageID), 26 (SliderID), and 64 (SubtleAlertID) are permitted.
* @param functionID - the functionID
*/
- public void setInteractionFunctionID(@NonNull Integer functionID) {
+ public CancelInteraction setInteractionFunctionID(@NonNull Integer functionID) {
setParameters(KEY_FUNCTION_ID, functionID);
+ return this;
}
/**
@@ -120,7 +121,8 @@ public class CancelInteraction extends RPCRequest {
* The ID of the specific interaction to dismiss. If not set, the most recent of the RPC type set in functionID will be dismissed.
* @param cancelID - the cancelID
*/
- public void setCancelID(Integer cancelID) {
+ public CancelInteraction setCancelID( Integer cancelID) {
setParameters(KEY_CANCEL_ID, cancelID);
+ return this;
}
} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java
index 2087ea886..41dbe6f78 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ChangeRegistration.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -170,12 +170,13 @@ public class ChangeRegistration extends RPCRequest {
/**
* Sets language
- *
+ *
* @param language
* a language value
*/
- public void setLanguage(@NonNull Language language) {
+ public ChangeRegistration setLanguage(@NonNull Language language) {
setParameters(KEY_LANGUAGE, language);
+ return this;
}
/**
@@ -189,12 +190,13 @@ public class ChangeRegistration extends RPCRequest {
/**
* Sets HMI display language
- *
+ *
* @param hmiDisplayLanguage
* a Language value
*/
- public void setHmiDisplayLanguage(@NonNull Language hmiDisplayLanguage) {
+ public ChangeRegistration setHmiDisplayLanguage(@NonNull Language hmiDisplayLanguage) {
setParameters(KEY_HMI_DISPLAY_LANGUAGE, hmiDisplayLanguage);
+ return this;
}
/**
@@ -208,11 +210,12 @@ public class ChangeRegistration extends RPCRequest {
/**
* Sets app name
- *
+ *
* @param appName App name to set
*/
- public void setAppName(String appName){
+ public ChangeRegistration setAppName( String appName) {
setParameters(KEY_APP_NAME, appName);
+ return this;
}
/**
@@ -226,11 +229,12 @@ public class ChangeRegistration extends RPCRequest {
/**
* Sets NGN media screen app name
- *
+ *
* @param ngnAppName The NGN app name
*/
- public void setNgnMediaScreenAppName(String ngnAppName){
+ public ChangeRegistration setNgnMediaScreenAppName( String ngnAppName) {
setParameters(KEY_NGN_MEDIA_SCREEN_NAME, ngnAppName);
+ return this;
}
/**
@@ -244,11 +248,12 @@ public class ChangeRegistration extends RPCRequest {
/**
* Sets the TTS name
- *
+ *
* @param ttsName The TTS name to set
*/
- public void setTtsName(List<TTSChunk> ttsName){
+ public ChangeRegistration setTtsName( List<TTSChunk> ttsName) {
setParameters(KEY_TTS_NAME, ttsName);
+ return this;
}
/**
@@ -277,7 +282,7 @@ public class ChangeRegistration extends RPCRequest {
/**
* 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
@@ -290,8 +295,9 @@ public class ChangeRegistration extends RPCRequest {
* the name or any synonym of any currently-registered
* application</li>
* </ul>
- */
- public void setVrSynonyms(List<String> vrSynonyms) {
+ */
+ public ChangeRegistration setVrSynonyms( List<String> vrSynonyms) {
setParameters(KEY_VR_SYNONYMS, vrSynonyms);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java
index 72fb49a91..819cb7c63 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Choice.java
@@ -171,9 +171,10 @@ public class Choice extends RPCStruct {
/**
* Set the application-scoped identifier that uniquely identifies this choice.
* @param choiceID Min: 0 Max: 65535
- */
- public void setChoiceID(@NonNull Integer choiceID) {
+ */
+ public Choice setChoiceID(@NonNull Integer choiceID) {
setValue(KEY_CHOICE_ID, choiceID);
+ return this;
}
/**
* Text which appears in menu, representing this choice.
@@ -189,9 +190,10 @@ public class Choice extends RPCStruct {
* Min: 1;
* Max: 100
* @param menuName the menu name
- */
- public void setMenuName(@NonNull String menuName) {
+ */
+ public Choice setMenuName(@NonNull String menuName) {
setValue(KEY_MENU_NAME, menuName);
+ return this;
}
/**
* 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
@@ -206,22 +208,23 @@ public class Choice extends RPCStruct {
* 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) {
+ */
+ public Choice setVrCommands( List<String> vrCommands) {
setValue(KEY_VR_COMMANDS, vrCommands);
+ return this;
}
/**
* Set the image
* @param image the image of the choice
- */
- public void setImage(Image image) {
+ */
+ public Choice setImage( Image image) {
setValue(KEY_IMAGE, image);
+ return this;
}
/**
* Get the image
* @return the image of the choice
*/
- @SuppressWarnings("unchecked")
public Image getImage() {
return (Image) getObject(Image.class, KEY_IMAGE);
}
@@ -230,23 +233,25 @@ public class Choice extends RPCStruct {
return getString(KEY_SECONDARY_TEXT);
}
- public void setSecondaryText(String secondaryText) {
+ public Choice setSecondaryText( String secondaryText) {
setValue(KEY_SECONDARY_TEXT, secondaryText);
+ return this;
}
public String getTertiaryText() {
return getString(KEY_TERTIARY_TEXT);
}
- public void setTertiaryText(String tertiaryText) {
+ public Choice setTertiaryText( String tertiaryText) {
setValue(KEY_TERTIARY_TEXT, tertiaryText);
+ return this;
}
- public void setSecondaryImage(Image image) {
+ public Choice setSecondaryImage( Image image) {
setValue(KEY_SECONDARY_IMAGE, image);
+ return this;
}
- @SuppressWarnings("unchecked")
public Image getSecondaryImage() {
return (Image) getObject(Image.class, KEY_SECONDARY_IMAGE);
}
@@ -255,7 +260,8 @@ public class Choice extends RPCStruct {
* This prevents the @{link Choice#format} method from adding VR commands if set to true
* @param ignoreAddingVRItems - whether or not to let the format method add vr commands
*/
- public void setIgnoreAddingVRItems(boolean ignoreAddingVRItems){
+ public Choice setIgnoreAddingVRItems( boolean ignoreAddingVRItems) {
this.ignoreAddingVRItems = ignoreAddingVRItems;
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java
index 856087fda..1c3140d6f 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlCapabilities.java
@@ -86,8 +86,9 @@ public class ClimateControlCapabilities extends RPCStruct{
*
* @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) {
+ public ClimateControlCapabilities setModuleName(@NonNull String moduleName) {
setValue(KEY_MODULE_NAME, moduleName);
+ return this;
}
/**
@@ -106,8 +107,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* Availability of the control of fan speed.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setFanSpeedAvailable(Boolean fanSpeedAvailable) {
+ public ClimateControlCapabilities setFanSpeedAvailable( Boolean fanSpeedAvailable) {
setValue(KEY_FAN_SPEED_AVAILABLE, fanSpeedAvailable);
+ return this;
}
/**
@@ -127,8 +129,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* Availability of the control of desired temperature.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setDesiredTemperatureAvailable(Boolean desiredTemperatureAvailable) {
+ public ClimateControlCapabilities setDesiredTemperatureAvailable( Boolean desiredTemperatureAvailable) {
setValue(KEY_DESIRED_TEMPERATURE_AVAILABLE, desiredTemperatureAvailable);
+ return this;
}
/**
@@ -148,8 +151,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* Availability of the control of turn on/off AC.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setAcEnableAvailable(Boolean acEnableAvailable) {
+ public ClimateControlCapabilities setAcEnableAvailable( Boolean acEnableAvailable) {
setValue(KEY_AC_ENABLE_AVAILABLE, acEnableAvailable);
+ return this;
}
/**
@@ -169,8 +173,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* 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) {
+ public ClimateControlCapabilities setAcMaxEnableAvailable( Boolean acMaxEnableAvailable) {
setValue(KEY_AC_MAX_ENABLE_AVAILABLE, acMaxEnableAvailable);
+ return this;
}
/**
@@ -190,8 +195,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* Availability of the control of enable/disable circulate Air mode.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setCirculateAirEnableAvailable(Boolean circulateAirEnableAvailable) {
+ public ClimateControlCapabilities setCirculateAirEnableAvailable( Boolean circulateAirEnableAvailable) {
setValue(KEY_CIRCULATE_AIR_ENABLE_AVAILABLE, circulateAirEnableAvailable);
+ return this;
}
/**
@@ -211,8 +217,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* Availability of the control of enable/disable auto mode.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setAutoModeEnableAvailable(Boolean autoModeEnableAvailable) {
+ public ClimateControlCapabilities setAutoModeEnableAvailable( Boolean autoModeEnableAvailable) {
setValue(KEY_AUTO_MODE_ENABLE_AVAILABLE, autoModeEnableAvailable);
+ return this;
}
/**
@@ -232,8 +239,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* Availability of the control of enable/disable dual mode.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setDualModeEnableAvailable(Boolean dualModeEnableAvailable) {
+ public ClimateControlCapabilities setDualModeEnableAvailable( Boolean dualModeEnableAvailable) {
setValue(KEY_DUAL_MODE_ENABLE_AVAILABLE, dualModeEnableAvailable);
+ return this;
}
/**
@@ -253,8 +261,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* Availability of the control of defrost zones.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setDefrostZoneAvailable(Boolean defrostZoneAvailable) {
+ public ClimateControlCapabilities setDefrostZoneAvailable( Boolean defrostZoneAvailable) {
setValue(KEY_DEFROST_ZONE_AVAILABLE, defrostZoneAvailable);
+ return this;
}
/**
@@ -282,8 +291,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* @param defrostZone
* A set of all defrost zones that are controllable.
*/
- public void setDefrostZone(List<DefrostZone> defrostZone) {
+ public ClimateControlCapabilities setDefrostZone( List<DefrostZone> defrostZone) {
setValue(KEY_DEFROST_ZONE, defrostZone);
+ return this;
}
/**
@@ -293,8 +303,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* Availability of the control of air ventilation mode.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setVentilationModeAvailable(Boolean ventilationModeAvailable) {
+ public ClimateControlCapabilities setVentilationModeAvailable( Boolean ventilationModeAvailable) {
setValue(KEY_VENTILATION_MODE_AVAILABLE, ventilationModeAvailable);
+ return this;
}
/**
@@ -322,8 +333,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* @param ventilationMode
* A set of all ventilation modes that are controllable.
*/
- public void setVentilationMode(List<VentilationMode> ventilationMode) {
+ public ClimateControlCapabilities setVentilationMode( List<VentilationMode> ventilationMode) {
setValue(KEY_VENTILATION_MODE, ventilationMode);
+ return this;
}
/**
@@ -332,8 +344,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* @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) {
+ public ClimateControlCapabilities setHeatedSteeringWheelAvailable( Boolean heatedSteeringWheelAvailable) {
setValue(KEY_HEATED_STEERING_WHEEL_AVAILABLE, heatedSteeringWheelAvailable);
+ return this;
}
/**
@@ -352,8 +365,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* @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) {
+ public ClimateControlCapabilities setHeatedWindshieldAvailable( Boolean heatedWindshieldAvailable) {
setValue(KEY_HEATED_WIND_SHIELD_AVAILABLE, heatedWindshieldAvailable);
+ return this;
}
/**
@@ -372,8 +386,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* @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) {
+ public ClimateControlCapabilities setHeatedRearWindowAvailable( Boolean heatedRearWindowAvailable) {
setValue(KEY_HEATED_REAR_WINDOW_AVAILABLE, heatedRearWindowAvailable);
+ return this;
}
/**
@@ -392,8 +407,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* @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) {
+ public ClimateControlCapabilities setHeatedMirrorsAvailable( Boolean heatedMirrorsAvailable) {
setValue(KEY_HEATED_MIRRORS_AVAILABLE, heatedMirrorsAvailable);
+ return this;
}
/**
@@ -410,8 +426,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* Sets ModuleInfo for this capability
* @param info the ModuleInfo to be set
*/
- public void setModuleInfo(ModuleInfo info) {
+ public ClimateControlCapabilities setModuleInfo( ModuleInfo info) {
setValue(KEY_MODULE_INFO, info);
+ return this;
}
/**
@@ -427,8 +444,9 @@ public class ClimateControlCapabilities extends RPCStruct{
* @param climateEnableAvailable Availability of the control of enable/disable climate control.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setClimateEnableAvailable(Boolean climateEnableAvailable) {
+ public ClimateControlCapabilities setClimateEnableAvailable( Boolean climateEnableAvailable) {
setValue(KEY_CLIMATE_ENABLE_AVAILABLE, climateEnableAvailable);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java
index 365a74044..de243bc8d 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClimateControlData.java
@@ -61,80 +61,90 @@ public class ClimateControlData extends RPCStruct{
super(hash);
}
- public void setFanSpeed(Integer fanSpeed) {
+ public ClimateControlData setFanSpeed( Integer fanSpeed) {
setValue(KEY_FAN_SPEED, fanSpeed);
+ return this;
}
public Integer getFanSpeed() {
return getInteger(KEY_FAN_SPEED);
}
- public void setCurrentTemperature(Temperature currentTemperature) {
+ public ClimateControlData setCurrentTemperature( Temperature currentTemperature) {
setValue(KEY_CURRENT_TEMPERATURE, currentTemperature);
+ return this;
}
public Temperature getCurrentTemperature() {
return (Temperature) getObject(Temperature.class, KEY_CURRENT_TEMPERATURE);
}
- public void setDesiredTemperature(Temperature desiredTemperature) {
+ public ClimateControlData setDesiredTemperature( Temperature desiredTemperature) {
setValue(KEY_DESIRED_TEMPERATURE, desiredTemperature);
+ return this;
}
public Temperature getDesiredTemperature() {
return (Temperature) getObject(Temperature.class, KEY_DESIRED_TEMPERATURE);
}
- public void setAcEnable(Boolean acEnable) {
+ public ClimateControlData setAcEnable( Boolean acEnable) {
setValue(KEY_AC_ENABLE, acEnable);
+ return this;
}
public Boolean getAcEnable() {
return getBoolean(KEY_AC_ENABLE);
}
- public void setCirculateAirEnable(Boolean circulateAirEnable) {
+ public ClimateControlData setCirculateAirEnable( Boolean circulateAirEnable) {
setValue(KEY_CIRCULATE_AIR_ENABLE, circulateAirEnable);
+ return this;
}
public Boolean getCirculateAirEnable() {
return getBoolean(KEY_CIRCULATE_AIR_ENABLE);
}
- public void setAutoModeEnable(Boolean autoModeEnable) {
+ public ClimateControlData setAutoModeEnable( Boolean autoModeEnable) {
setValue(KEY_AUTO_MODE_ENABLE, autoModeEnable);
+ return this;
}
public Boolean getAutoModeEnable() {
return getBoolean(KEY_AUTO_MODE_ENABLE);
}
- public void setDefrostZone(DefrostZone defrostZone) {
+ public ClimateControlData setDefrostZone( DefrostZone defrostZone) {
setValue(KEY_DEFROST_ZONE, defrostZone);
+ return this;
}
public DefrostZone getDefrostZone() {
return (DefrostZone) getObject(DefrostZone.class, KEY_DEFROST_ZONE);
}
- public void setDualModeEnable(Boolean dualModeEnable) {
+ public ClimateControlData setDualModeEnable( Boolean dualModeEnable) {
setValue(KEY_DUAL_MODE_ENABLE, dualModeEnable);
+ return this;
}
public Boolean getDualModeEnable() {
return getBoolean(KEY_DUAL_MODE_ENABLE);
}
- public void setAcMaxEnable(Boolean acMaxEnable) {
+ public ClimateControlData setAcMaxEnable( Boolean acMaxEnable) {
setValue(KEY_AC_MAX_ENABLE, acMaxEnable);
+ return this;
}
public Boolean getAcMaxEnable() {
return getBoolean(KEY_AC_MAX_ENABLE);
}
- public void setVentilationMode(VentilationMode ventilationMode) {
+ public ClimateControlData setVentilationMode( VentilationMode ventilationMode) {
setValue(KEY_VENTILATION_MODE, ventilationMode);
+ return this;
}
public VentilationMode getVentilationMode() {
@@ -146,8 +156,9 @@ public class ClimateControlData extends RPCStruct{
*
* @param heatedSteeringWheelEnable Value false means disabled/turn off, value true means enabled/turn on.
*/
- public void setHeatedSteeringWheelEnable(Boolean heatedSteeringWheelEnable) {
+ public ClimateControlData setHeatedSteeringWheelEnable( Boolean heatedSteeringWheelEnable) {
setValue(KEY_HEATED_STEERING_WHEEL_ENABLE, heatedSteeringWheelEnable);
+ return this;
}
/**
@@ -164,8 +175,9 @@ public class ClimateControlData extends RPCStruct{
*
* @param heatedWindshieldEnable Value false means disabled, value true means enabled.
*/
- public void setHeatedWindshieldEnable(Boolean heatedWindshieldEnable) {
+ public ClimateControlData setHeatedWindshieldEnable( Boolean heatedWindshieldEnable) {
setValue(KEY_HEATED_WIND_SHIELD_ENABLE, heatedWindshieldEnable);
+ return this;
}
/**
@@ -182,8 +194,9 @@ public class ClimateControlData extends RPCStruct{
*
* @param heatedRearWindowEnable Value false means disabled, value true means enabled.
*/
- public void setHeatedRearWindowEnable(Boolean heatedRearWindowEnable) {
+ public ClimateControlData setHeatedRearWindowEnable( Boolean heatedRearWindowEnable) {
setValue(KEY_HEATED_REAR_WINDOW_ENABLE, heatedRearWindowEnable);
+ return this;
}
/**
@@ -200,8 +213,9 @@ public class ClimateControlData extends RPCStruct{
*
* @param heatedMirrorsEnable Value false means disabled, value true means enabled.
*/
- public void setHeatedMirrorsEnable(Boolean heatedMirrorsEnable) {
+ public ClimateControlData setHeatedMirrorsEnable( Boolean heatedMirrorsEnable) {
setValue(KEY_HEATED_MIRRORS_ENABLE, heatedMirrorsEnable);
+ return this;
}
/**
@@ -218,8 +232,9 @@ public class ClimateControlData extends RPCStruct{
*
* @param climateEnable Value false means disabled, value true means enabled.
*/
- public void setClimateEnable(Boolean climateEnable) {
+ public ClimateControlData setClimateEnable( Boolean climateEnable) {
setValue(KEY_CLIMATE_ENABLE, climateEnable);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java
index 1c81ce95b..59035fc27 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CloudAppProperties.java
@@ -63,8 +63,9 @@ public class CloudAppProperties extends RPCStruct {
setValue(KEY_APP_ID, appID);
}
- public void setNicknames(List<String> nicknames){
+ public CloudAppProperties setNicknames( List<String> nicknames) {
setValue(KEY_NICKNAMES, nicknames);
+ return this;
}
@SuppressWarnings("unchecked")
@@ -72,8 +73,9 @@ public class CloudAppProperties extends RPCStruct {
return (List<String>) getObject(String.class, KEY_NICKNAMES);
}
- public void setAppID(@NonNull String appID){
+ public CloudAppProperties setAppID(@NonNull String appID) {
setValue(KEY_APP_ID, appID);
+ return this;
}
public String getAppID(){
@@ -84,8 +86,9 @@ public class CloudAppProperties extends RPCStruct {
* 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){
+ public CloudAppProperties setEnabled( boolean enabled) {
setValue(KEY_ENABLED, enabled);
+ return this;
}
/**
@@ -95,24 +98,27 @@ public class CloudAppProperties extends RPCStruct {
return getBoolean(KEY_ENABLED);
}
- public void setAuthToken(String token){
+ public CloudAppProperties setAuthToken( String token) {
setValue(KEY_AUTH_TOKEN, token);
+ return this;
}
public String getAuthToken(){
return getString(KEY_AUTH_TOKEN);
}
- public void setCloudTransportType(String transportType){
+ public CloudAppProperties setCloudTransportType( String transportType) {
setValue(KEY_CLOUD_TRANSPORT_TYPE, transportType);
+ return this;
}
public String getCloudTransportType(){
return getString(KEY_CLOUD_TRANSPORT_TYPE);
}
- public void setHybridAppPreference(HybridAppPreference hybridAppPreference){
+ public CloudAppProperties setHybridAppPreference( HybridAppPreference hybridAppPreference) {
setValue(KEY_HYBRID_APP_PREFERENCE, hybridAppPreference);
+ return this;
}
public HybridAppPreference getHybridAppPreference(){
@@ -122,8 +128,9 @@ public class CloudAppProperties extends RPCStruct {
/**
* @param token - max length ="65535"
*/
- public void setEndpoint(String token){
+ public CloudAppProperties setEndpoint( String token) {
setValue(KEY_ENDPOINT, token);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java
index 98aa2a060..f3113de0b 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ClusterModeStatus.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -67,13 +67,13 @@ import java.util.Hashtable;
* <td>carModeStatus</td>
* <td>CarModeStatus</td>
* <td></td>
- * <td>Describes the carmode the vehicle is in.</td>
+ * <td>Describes the car mode the vehicle is in.</td>
* </tr>
* <tr>
* <td>powerModeStatus</td>
* <td>PowerModeStatus</td>
* <td>true</td>
- * <td>Describes the different powermodes</td>
+ * <td>Describes the different power modes</td>
* </tr>
*
* </table>
@@ -109,27 +109,31 @@ public class ClusterModeStatus extends RPCStruct {
setPowerModeStatus(powerModeStatus);
}
- public void setPowerModeActive(@NonNull Boolean powerModeActive) {
- setValue(KEY_POWER_MODE_ACTIVE, powerModeActive);
- }
+ public ClusterModeStatus setPowerModeActive(@NonNull Boolean powerModeActive) {
+ setValue(KEY_POWER_MODE_ACTIVE, powerModeActive);
+ return this;
+ }
public Boolean getPowerModeActive() {
return getBoolean(KEY_POWER_MODE_ACTIVE);
}
- public void setPowerModeQualificationStatus(@NonNull PowerModeQualificationStatus powerModeQualificationStatus) {
- setValue(KEY_POWER_MODE_QUALIFICATION_STATUS, powerModeQualificationStatus);
- }
+ public ClusterModeStatus setPowerModeQualificationStatus(@NonNull PowerModeQualificationStatus powerModeQualificationStatus) {
+ setValue(KEY_POWER_MODE_QUALIFICATION_STATUS, powerModeQualificationStatus);
+ return this;
+ }
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 ClusterModeStatus setCarModeStatus(@NonNull CarModeStatus carModeStatus) {
+ setValue(KEY_CAR_MODE_STATUS, carModeStatus);
+ return this;
+ }
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 ClusterModeStatus setPowerModeStatus(@NonNull PowerModeStatus powerModeStatus) {
+ setValue(KEY_POWER_MODE_STATUS, powerModeStatus);
+ return this;
+ }
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
index 970692dab..bc41103d5 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Coordinate.java
@@ -60,8 +60,9 @@ public class Coordinate extends RPCStruct{
return SdlDataTypeConverter.objectToFloat(value);
}
- public void setLatitudeDegrees(@NonNull Float latitudeDegrees) {
+ public Coordinate setLatitudeDegrees(@NonNull Float latitudeDegrees) {
setValue(KEY_LATITUDE_DEGREES, latitudeDegrees);
+ return this;
}
public Float getLongitudeDegrees() {
@@ -69,7 +70,8 @@ public class Coordinate extends RPCStruct{
return SdlDataTypeConverter.objectToFloat(value);
}
- public void setLongitudeDegrees(@NonNull Float longitudeDegrees) {
+ public Coordinate setLongitudeDegrees(@NonNull Float longitudeDegrees) {
setValue(KEY_LONGITUDE_DEGREES, longitudeDegrees);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java
index be638065b..32e09dde3 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -148,14 +148,15 @@ public class CreateInteractionChoiceSet extends RPCRequest {
}
/**
* 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);
+ */
+ public CreateInteractionChoiceSet setInteractionChoiceSetID(@NonNull Integer interactionChoiceSetID) {
+ setParameters(KEY_INTERACTION_CHOICE_SET_ID, interactionChoiceSetID);
+ return this;
}
/**
* Gets Choice Set Array of one or more elements
@@ -169,14 +170,15 @@ public class CreateInteractionChoiceSet extends RPCRequest {
}
/**
* 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);
+ */
+ public CreateInteractionChoiceSet setChoiceSet(@NonNull List<Choice> choiceSet) {
+ setParameters(KEY_CHOICE_SET, choiceSet);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindow.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindow.java
index 6184bb059..976d00f9e 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindow.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/CreateWindow.java
@@ -60,8 +60,9 @@ public class CreateWindow extends RPCRequest {
*
* @param windowID A unique ID to identify the window. The value of '0' will always be the default main window on the main display and should not be used in this context as it will already be created for the app. See PredefinedWindows enum. Creating a window with an ID that is already in use will be rejected with `INVALID_ID`.
*/
- public void setWindowID(@NonNull Integer windowID) {
+ public CreateWindow setWindowID(@NonNull Integer windowID) {
setParameters(KEY_WINDOW_ID, windowID);
+ return this;
}
/**
@@ -83,8 +84,9 @@ public class CreateWindow extends RPCRequest {
* Multiple apps can share the same window name except for the default main window.
* {@code windowName.length() <= 100}
*/
- public void setWindowName(@NonNull String windowName) {
+ public CreateWindow setWindowName(@NonNull String windowName) {
setParameters(KEY_WINDOW_NAME, windowName);
+ return this;
}
/**
@@ -101,8 +103,9 @@ public class CreateWindow extends RPCRequest {
*
* @param type The type of the window to be created. Main window or widget.
*/
- public void setType(@NonNull WindowType type) {
+ public CreateWindow setType(@NonNull WindowType type) {
setParameters(KEY_TYPE, type);
+ return this;
}
/**
@@ -127,8 +130,9 @@ public class CreateWindow extends RPCRequest {
* @param associatedServiceType Allows an app to create a widget related to a specific service type.
* As an example if a `MEDIA` app becomes active, this app becomes audible and is allowed to play audio.
*/
- public void setAssociatedServiceType(String associatedServiceType) {
+ public CreateWindow setAssociatedServiceType( String associatedServiceType) {
setParameters(KEY_ASSOCIATED_SERVICE_TYPE, associatedServiceType);
+ return this;
}
/**
@@ -148,8 +152,9 @@ public class CreateWindow extends RPCRequest {
*
* @param duplicateUpdatesFromWindowID Specify whether the content sent to an existing window should be duplicated to the created window.
*/
- public void setDuplicateUpdatesFromWindowID(Integer duplicateUpdatesFromWindowID) {
+ public CreateWindow setDuplicateUpdatesFromWindowID( Integer duplicateUpdatesFromWindowID) {
setParameters(KEY_DUPLICATE_UPDATES_FROM_WINDOW_ID, duplicateUpdatesFromWindowID);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java
index 8cd8e9c18..73d45282d 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DIDResult.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -96,20 +96,23 @@ public class DIDResult extends RPCStruct {
setResultCode(resultCode);
setDidLocation(didLocation);
}
- public void setResultCode(@NonNull VehicleDataResultCode resultCode) {
- setValue(KEY_RESULT_CODE, resultCode);
+ public DIDResult setResultCode(@NonNull VehicleDataResultCode resultCode) {
+ setValue(KEY_RESULT_CODE, resultCode);
+ return this;
}
public VehicleDataResultCode getResultCode() {
return (VehicleDataResultCode) getObject(VehicleDataResultCode.class, KEY_RESULT_CODE);
}
- public void setDidLocation(@NonNull Integer didLocation) {
- setValue(KEY_DID_LOCATION, didLocation);
+ public DIDResult setDidLocation(@NonNull Integer didLocation) {
+ setValue(KEY_DID_LOCATION, didLocation);
+ return this;
}
public Integer getDidLocation() {
return getInteger(KEY_DID_LOCATION);
}
- public void setData(String data) {
- setValue(KEY_DATA, data);
+ public DIDResult setData( String data) {
+ setValue(KEY_DATA, data);
+ return this;
}
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
index 697514a08..9b7623129 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DTC.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DTC.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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;
@@ -78,8 +78,9 @@ public class DTC extends RPCStruct {
* set identifier
* @param identifier the hexadecimal id of the DTC
*/
- public void setIdentifier(String identifier) {
- setValue(KEY_IDENTIFIER, identifier);
+ public DTC setIdentifier( String identifier) {
+ setValue(KEY_IDENTIFIER, identifier);
+ return this;
}
/**
@@ -94,8 +95,9 @@ public class DTC extends RPCStruct {
* set Hexadecimal byte string
* @param statusByte Hexadecimal byte string
*/
- public void setStatusByte(String statusByte) {
- setValue(KEY_STATUS_BYTE, statusByte);
+ public DTC setStatusByte( String statusByte) {
+ setValue(KEY_STATUS_BYTE, statusByte);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java
index 2335743d0..ab3f61140 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DateTime.java
@@ -66,13 +66,14 @@ public class DateTime extends RPCStruct{
/**
* Sets the Milliseconds portion of the DateTime class
- *
+ *
* @param milliSecond
* The milliseconds associated with this DateTime class
- *
- */
- public void setMilliSecond(Integer milliSecond) {
+ *
+ */
+ public DateTime setMilliSecond( Integer milliSecond) {
setValue(KEY_MILLISECOND, milliSecond);
+ return this;
}
@@ -88,13 +89,14 @@ public class DateTime extends RPCStruct{
/**
* Sets the Seconds portion of the DateTime class
- *
+ *
* @param second
* The Seconds associated with this DateTime class
- *
+ *
*/
- public void setSecond(Integer second) {
+ public DateTime setSecond( Integer second) {
setValue(KEY_SECOND, second);
+ return this;
}
@@ -110,13 +112,14 @@ public class DateTime extends RPCStruct{
/**
* Sets the Minutes portion of the DateTime class
- *
+ *
* @param minute
* The Minutes associated with this DateTime class
- *
- */
- public void setMinute(Integer minute) {
+ *
+ */
+ public DateTime setMinute( Integer minute) {
setValue(KEY_MINUTE, minute);
+ return this;
}
/**
@@ -130,14 +133,15 @@ public class DateTime extends RPCStruct{
}
/**
- * Sets the Hours portion of the DateTime class.
- *
+ * 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) {
+ *
+ */
+ public DateTime setHour( Integer hour) {
setValue(KEY_HOUR, hour);
+ return this;
}
/**
@@ -152,13 +156,14 @@ public class DateTime extends RPCStruct{
/**
* 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) {
+ *
+ */
+ public DateTime setDay( Integer day) {
setValue(KEY_DAY, day);
+ return this;
}
/**
@@ -173,13 +178,14 @@ public class DateTime extends RPCStruct{
/**
* 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) {
+ *
+ */
+ public DateTime setMonth( Integer month) {
setValue(KEY_MONTH, month);
+ return this;
}
/**
@@ -194,13 +200,14 @@ public class DateTime extends RPCStruct{
/**
* 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) {
+ *
+ */
+ public DateTime setYear( Integer year) {
setValue(KEY_YEAR, year);
+ return this;
}
/**
@@ -215,13 +222,14 @@ public class DateTime extends RPCStruct{
/**
* 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) {
+ *
+ */
+ public DateTime setTzHour( Integer tzHour) {
setValue(KEY_TZ_HOUR, tzHour);
+ return this;
}
/**
@@ -236,11 +244,12 @@ public class DateTime extends RPCStruct{
/**
* 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) {
+ */
+ public DateTime setTzMinute( Integer tzMinute) {
setValue(KEY_TZ_MINUTE, tzMinute);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java
index e102e9427..35b96387f 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteCommand.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -125,13 +125,14 @@ public class DeleteCommand extends RPCRequest {
}
/**
* 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);
+ */
+ public DeleteCommand setCmdID(@NonNull Integer cmdID) {
+ setParameters(KEY_CMD_ID, cmdID);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java
index 177171027..b855f1bbf 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFile.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -105,12 +105,13 @@ public class DeleteFile extends RPCRequest {
/**
* 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);
+ public DeleteFile setSdlFileName(@NonNull String sdlFileName) {
+ setParameters(KEY_SDL_FILE_NAME, sdlFileName);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java
index e1076935b..bea9a1b65 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteFileResponse.java
@@ -90,8 +90,9 @@ public class DeleteFileResponse extends RPCResponse {
super.format(rpcVersion, formatParams);
}
- public void setSpaceAvailable(Integer spaceAvailable) {
+ public DeleteFileResponse setSpaceAvailable( Integer spaceAvailable) {
setParameters(KEY_SPACE_AVAILABLE, spaceAvailable);
+ return this;
}
public Integer getSpaceAvailable() {
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java
index e3d0d5c86..06c36e1de 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteInteractionChoiceSet.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -46,7 +46,7 @@ import java.util.Hashtable;
*
* <p>Function Group: Base</p>
*
- * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUD</b></p>
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
*
* <p>AudioStreamingState: Any</p>
*
@@ -131,8 +131,9 @@ public class DeleteInteractionChoiceSet extends RPCRequest {
* 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);
+ */
+ public DeleteInteractionChoiceSet setInteractionChoiceSetID(@NonNull Integer interactionChoiceSetID) {
+ setParameters(KEY_INTERACTION_CHOICE_SET_ID, interactionChoiceSetID);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java
index e526013c8..22306a668 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteSubMenu.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -118,12 +118,13 @@ public class DeleteSubMenu extends RPCRequest {
return getInteger( KEY_MENU_ID );
}
/**
- * Sets the MenuID that identifies the SubMenu to be delete
+ * 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 ) {
+ */
+ public DeleteSubMenu setMenuID(@NonNull Integer menuID) {
setParameters(KEY_MENU_ID, menuID);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindow.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindow.java
index 4e78b95a7..06c00736a 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindow.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeleteWindow.java
@@ -50,8 +50,9 @@ public class DeleteWindow extends RPCRequest {
*
* @param windowID A unique ID to identify the window. The value of '0' will always be the default main window on the main display and should not be used in this context as it will already be created for the app. See PredefinedWindows enum. Creating a window with an ID that is already in use will be rejected with `INVALID_ID`.
*/
- public void setWindowID(@NonNull Integer windowID) {
+ public DeleteWindow setWindowID(@NonNull Integer windowID) {
setParameters(KEY_WINDOW_ID, windowID);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java
index c19068eb0..7c98b1e84 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceInfo.java
@@ -119,41 +119,46 @@ public class DeviceInfo extends RPCStruct{
super(hash);
}
- public void setHardware(String hardware) {
+ public DeviceInfo setHardware( String hardware) {
setValue(KEY_HARDWARE, hardware);
- }
+ return this;
+ }
public String getHardware() {
return getString(KEY_HARDWARE);
}
- public void setFirmwareRev(String firmwareRev) {
- setValue(KEY_FIRMWARE_REV, firmwareRev);
- }
+ public DeviceInfo setFirmwareRev( String firmwareRev) {
+ setValue(KEY_FIRMWARE_REV, firmwareRev);
+ return this;
+ }
public String getFirmwareRev() {
return getString(KEY_FIRMWARE_REV);
}
- public void setOs(String os) {
- setValue(KEY_OS, os);
- }
+ public DeviceInfo setOs( String os) {
+ setValue(KEY_OS, os);
+ return this;
+ }
public String getOs() {
return getString(KEY_OS);
}
- public void setOsVersion(String osVersion) {
- setValue(KEY_OS_VERSION, osVersion);
-}
+ public DeviceInfo setOsVersion( String osVersion) {
+ setValue(KEY_OS_VERSION, osVersion);
+ return this;
+ }
public String getOsVersion() {
return getString(KEY_OS_VERSION);
}
-public void setCarrier(String carrier) {
- setValue(KEY_CARRIER, carrier);
-}
+public DeviceInfo setCarrier( String carrier) {
+ setValue(KEY_CARRIER, carrier);
+ return this;
+ }
public String getCarrier() {
return getString(KEY_CARRIER);
@@ -163,8 +168,9 @@ public Integer getMaxNumberRFCOMMPorts() {
return getInteger( KEY_MAX_NUMBER_RFCOMM_PORTS );
}
-public void setMaxNumberRFCOMMPorts( Integer maxNumberRFCOMMPorts ) {
- setValue(KEY_MAX_NUMBER_RFCOMM_PORTS, maxNumberRFCOMMPorts);
-}
+public DeviceInfo setMaxNumberRFCOMMPorts( Integer maxNumberRFCOMMPorts) {
+ setValue(KEY_MAX_NUMBER_RFCOMM_PORTS, maxNumberRFCOMMPorts);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java
index 8748014f2..e3459f002 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DeviceStatus.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -80,7 +80,7 @@ import java.util.Hashtable;
* <tr>
* <td>textMsgAvailable</td>
* <td>Boolean</td>
- * <td>A textmessage is available
+ * <td>A text message is available
* </td>
* <td>SmartDeviceLink 2.0</td>
* </tr>
@@ -166,7 +166,7 @@ public class DeviceStatus extends RPCStruct {
* @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 textMsgAvailable a text message 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
@@ -194,8 +194,9 @@ public class DeviceStatus extends RPCStruct {
* set the voice recognition on or off
* @param voiceRecOn
*/
- public void setVoiceRecOn(@NonNull Boolean voiceRecOn) {
+ public DeviceStatus setVoiceRecOn(@NonNull Boolean voiceRecOn) {
setValue(KEY_VOICE_REC_ON, voiceRecOn);
+ return this;
}
/**
@@ -210,8 +211,9 @@ public class DeviceStatus extends RPCStruct {
* set the bluetooth connection established
* @param btIconOn the bluetooth connection established
*/
- public void setBtIconOn(@NonNull Boolean btIconOn) {
+ public DeviceStatus setBtIconOn(@NonNull Boolean btIconOn) {
setValue(KEY_BT_ICON_ON, btIconOn);
+ return this;
}
/**
@@ -226,8 +228,9 @@ public class DeviceStatus extends RPCStruct {
* set a call is being active
* @param callActive a call is being active
*/
- public void setCallActive(@NonNull Boolean callActive) {
+ public DeviceStatus setCallActive(@NonNull Boolean callActive) {
setValue(KEY_CALL_ACTIVE, callActive);
+ return this;
}
/**
@@ -242,8 +245,9 @@ public class DeviceStatus extends RPCStruct {
* set the phone is in roaming mode
* @param phoneRoaming the phone is in roaming mode
*/
- public void setPhoneRoaming(@NonNull Boolean phoneRoaming) {
+ public DeviceStatus setPhoneRoaming(@NonNull Boolean phoneRoaming) {
setValue(KEY_PHONE_ROAMING, phoneRoaming);
+ return this;
}
/**
@@ -253,13 +257,14 @@ public class DeviceStatus extends RPCStruct {
public Boolean getPhoneRoaming() {
return getBoolean(KEY_PHONE_ROAMING);
}
- public void setTextMsgAvailable(@NonNull Boolean textMsgAvailable) {
+ public DeviceStatus setTextMsgAvailable(@NonNull Boolean textMsgAvailable) {
setValue(KEY_TEXT_MSG_AVAILABLE, textMsgAvailable);
+ return this;
}
/**
- * get a textmessage is available
- * @return a textmessage is available
+ * get a text message is available
+ * @return a text message is available
*/
public Boolean getTextMsgAvailable() {
return getBoolean(KEY_TEXT_MSG_AVAILABLE);
@@ -269,8 +274,9 @@ public class DeviceStatus extends RPCStruct {
* set battery level status
* @param battLevelStatus battery level status
*/
- public void setBattLevelStatus(@NonNull DeviceLevelStatus battLevelStatus) {
+ public DeviceStatus setBattLevelStatus(@NonNull DeviceLevelStatus battLevelStatus) {
setValue(KEY_BATT_LEVEL_STATUS, battLevelStatus);
+ return this;
}
/**
@@ -285,8 +291,9 @@ public class DeviceStatus extends RPCStruct {
* 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) {
+ public DeviceStatus setStereoAudioOutputMuted(@NonNull Boolean stereoAudioOutputMuted) {
setValue(KEY_STEREO_AUDIO_OUTPUT_MUTED, stereoAudioOutputMuted);
+ return this;
}
/**
@@ -301,8 +308,9 @@ public class DeviceStatus extends RPCStruct {
* 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) {
+ public DeviceStatus setMonoAudioOutputMuted(@NonNull Boolean monoAudioOutputMuted) {
setValue(KEY_MONO_AUDIO_OUTPUT_MUTED, monoAudioOutputMuted);
+ return this;
}
/**
@@ -317,8 +325,9 @@ public class DeviceStatus extends RPCStruct {
* set signal level status
* @param signalLevelStatus signal level status
*/
- public void setSignalLevelStatus(@NonNull DeviceLevelStatus signalLevelStatus) {
+ public DeviceStatus setSignalLevelStatus(@NonNull DeviceLevelStatus signalLevelStatus) {
setValue(KEY_SIGNAL_LEVEL_STATUS, signalLevelStatus);
+ return this;
}
/**
@@ -333,8 +342,9 @@ public class DeviceStatus extends RPCStruct {
* 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) {
+ public DeviceStatus setPrimaryAudioSource(@NonNull PrimaryAudioSource primaryAudioSource) {
setValue(KEY_PRIMARY_AUDIO_SOURCE, primaryAudioSource);
+ return this;
}
/**
@@ -344,8 +354,9 @@ public class DeviceStatus extends RPCStruct {
public PrimaryAudioSource getPrimaryAudioSource() {
return (PrimaryAudioSource) getObject(PrimaryAudioSource.class, KEY_PRIMARY_AUDIO_SOURCE);
}
- public void setECallEventActive(@NonNull Boolean eCallEventActive) {
+ public DeviceStatus setECallEventActive(@NonNull Boolean eCallEventActive) {
setValue(KEY_E_CALL_EVENT_ACTIVE, eCallEventActive);
+ return this;
}
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
index effba93a9..ddfcccf7c 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessage.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -123,8 +123,9 @@ public class DiagnosticMessage extends RPCRequest {
*
* @param targetID the target for this Diagnostic Message
*/
- public void setTargetID(@NonNull Integer targetID) {
- setParameters(KEY_TARGET_ID, targetID);
+ public DiagnosticMessage setTargetID(@NonNull Integer targetID) {
+ setParameters(KEY_TARGET_ID, targetID);
+ return this;
}
/**
@@ -138,8 +139,9 @@ public class DiagnosticMessage extends RPCRequest {
return getInteger(KEY_TARGET_ID);
}
- public void setMessageLength(@NonNull Integer messageLength) {
- setParameters(KEY_MESSAGE_LENGTH, messageLength);
+ public DiagnosticMessage setMessageLength(@NonNull Integer messageLength) {
+ setParameters(KEY_MESSAGE_LENGTH, messageLength);
+ return this;
}
public Integer getMessageLength() {
return getInteger(KEY_MESSAGE_LENGTH);
@@ -150,7 +152,8 @@ public class DiagnosticMessage extends RPCRequest {
return (List<Integer>) getObject(Integer.class, KEY_MESSAGE_DATA);
}
- public void setMessageData(@NonNull List<Integer> messageData) {
- setParameters(KEY_MESSAGE_DATA, messageData);
- }
+ public DiagnosticMessage setMessageData(@NonNull List<Integer> messageData) {
+ setParameters(KEY_MESSAGE_DATA, messageData);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java
index c1a1cf5cb..38aee38b0 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java
@@ -74,8 +74,9 @@ public class DiagnosticMessageResponse extends RPCResponse {
return (List<Integer>) getObject(Integer.class, KEY_MESSAGE_DATA_RESULT);
}
- public void setMessageDataResult(List<Integer> messageDataResult) {
+ public DiagnosticMessageResponse setMessageDataResult( List<Integer> messageDataResult) {
setParameters(KEY_MESSAGE_DATA_RESULT, messageDataResult);
+ return this;
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java
index 989617456..472bca08d 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DialNumber.java
@@ -68,11 +68,12 @@ public class DialNumber extends RPCRequest {
* <b>Notes: </b>Maxlength=40</p>
* All characters shall be stripped from string except digits 0-9 and * # , ; +
*/
- public void setNumber(@NonNull String number) {
+ public DialNumber setNumber(@NonNull String number) {
if (number != null) {
number = number.replaceAll("[^0-9*#,;+]", ""); //This will sanitize the input
}
setParameters(KEY_NUMBER, number);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java
index 43b4b408e..4fdc65560 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapabilities.java
@@ -167,8 +167,9 @@ public class DisplayCapabilities extends RPCStruct {
* @param displayType the display type
*/
@Deprecated
- public void setDisplayType( @NonNull DisplayType displayType ) {
+ public DisplayCapabilities setDisplayType(@NonNull DisplayType displayType) {
setValue(KEY_DISPLAY_TYPE, displayType);
+ return this;
}
/** Get the name of the display
* @return the name of the display
@@ -180,8 +181,9 @@ public class DisplayCapabilities extends RPCStruct {
* Set the name of the display
* @param displayName the name of the display
*/
- public void setDisplayName( String displayName ) {
+ public DisplayCapabilities setDisplayName( String displayName) {
setValue(KEY_DISPLAY_NAME, displayName);
+ return this;
}
/**
*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.
@@ -193,12 +195,13 @@ public class DisplayCapabilities extends RPCStruct {
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.
+ * 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 ) {
+ */
+ public DisplayCapabilities setTextFields(@NonNull List<TextField> textFields) {
setValue(KEY_TEXT_FIELDS, textFields);
+ return this;
}
@@ -208,21 +211,23 @@ public class DisplayCapabilities extends RPCStruct {
return (List<ImageField>) getObject(ImageField.class, KEY_IMAGE_FIELDS);
}
- public void setImageFields( List<ImageField> imageFields ) {
+ public DisplayCapabilities setImageFields( List<ImageField> imageFields) {
setValue(KEY_IMAGE_FIELDS, imageFields);
- }
+ return this;
+ }
public Integer getNumCustomPresetsAvailable() {
return getInteger(KEY_NUM_CUSTOM_PRESETS_AVAILABLE);
}
- public void setNumCustomPresetsAvailable(Integer numCustomPresetsAvailable) {
+ public DisplayCapabilities setNumCustomPresetsAvailable( Integer numCustomPresetsAvailable) {
setValue(KEY_NUM_CUSTOM_PRESETS_AVAILABLE, numCustomPresetsAvailable);
+ return this;
}
/**
* 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
+ * @return the Vector of mediaClockFormat
*/
@SuppressWarnings("unchecked")
public List<MediaClockFormat> getMediaClockFormats() {
@@ -231,9 +236,10 @@ public class DisplayCapabilities extends RPCStruct {
/**
* 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 ) {
+ */
+ public DisplayCapabilities setMediaClockFormats(@NonNull List<MediaClockFormat> mediaClockFormats) {
setValue(KEY_MEDIA_CLOCK_FORMATS, mediaClockFormats);
+ return this;
}
/**
@@ -241,8 +247,9 @@ public class DisplayCapabilities extends RPCStruct {
* @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);
+ public DisplayCapabilities setGraphicSupported(@NonNull Boolean graphicSupported) {
+ setValue(KEY_GRAPHIC_SUPPORTED, graphicSupported);
+ return this;
}
/**
@@ -259,15 +266,16 @@ public class DisplayCapabilities extends RPCStruct {
return (List<String>) getObject(String.class, KEY_TEMPLATES_AVAILABLE);
}
- public void setTemplatesAvailable(List<String> templatesAvailable) {
+ public DisplayCapabilities setTemplatesAvailable( List<String> templatesAvailable) {
setValue(KEY_TEMPLATES_AVAILABLE, templatesAvailable);
+ return this;
}
- public void setScreenParams(ScreenParams screenParams) {
+ public DisplayCapabilities setScreenParams( ScreenParams screenParams) {
setValue(KEY_SCREEN_PARAMS, screenParams);
+ return this;
}
- @SuppressWarnings("unchecked")
public ScreenParams getScreenParams() {
return (ScreenParams) getObject(ScreenParams.class, KEY_SCREEN_PARAMS);
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapability.java
index 992083689..10b740cae 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DisplayCapability.java
@@ -36,8 +36,9 @@ public class DisplayCapability extends RPCStruct {
*
* @param displayName the name of the display
*/
- public void setDisplayName(String displayName) {
+ public DisplayCapability setDisplayName( String displayName) {
setValue(KEY_DISPLAY_NAME, displayName);
+ return this;
}
/**
@@ -46,8 +47,9 @@ public class DisplayCapability extends RPCStruct {
*
* @param windowTypeSupported It informs the application how many windows the app is allowed to create per type.
*/
- public void setWindowTypeSupported(List<WindowTypeCapabilities> windowTypeSupported) {
+ public DisplayCapability setWindowTypeSupported( List<WindowTypeCapabilities> windowTypeSupported) {
setValue(KEY_WINDOW_TYPE_SUPPORTED, windowTypeSupported);
+ return this;
}
/**
@@ -70,10 +72,11 @@ public class DisplayCapability extends RPCStruct {
* After registration, only windows with capabilities changed will be included.
* Following cases will cause only affected windows to be included:
* 1. App creates a new window. After the window is created, a system capability notification will be sent related only to the created window.
- * 2. App sets a new template to the window. The new template changes window capabilties. The notification will reflect those changes to the single window.
+ * 2. App sets a new template to the window. The new template changes window capabilities. The notification will reflect those changes to the single window.
*/
- public void setWindowCapabilities(List<WindowCapability> windowCapabilities) {
+ public DisplayCapability setWindowCapabilities( List<WindowCapability> windowCapabilities) {
setValue(KEY_WINDOW_CAPABILITIES, windowCapabilities);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DriverDistractionCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DriverDistractionCapability.java
index c09a77f46..67d9bb434 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DriverDistractionCapability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DriverDistractionCapability.java
@@ -87,8 +87,9 @@ public class DriverDistractionCapability extends RPCStruct {
*
* @param menuLength The number of items allowed in a Choice Set or Command menu while the driver is distracted
*/
- public void setMenuLength(Integer menuLength) {
+ public DriverDistractionCapability setMenuLength( Integer menuLength) {
setValue(KEY_MENU_LENGTH, menuLength);
+ return this;
}
/**
@@ -106,8 +107,9 @@ public class DriverDistractionCapability extends RPCStruct {
* @param subMenuDepth The depth of submenus allowed when the driver is distracted. e.g. 3 == top level menu ->
* submenu -> submenu; 1 == top level menu only
*/
- public void setSubMenuDepth(Integer subMenuDepth) {
+ public DriverDistractionCapability setSubMenuDepth( Integer subMenuDepth) {
setValue(KEY_SUB_MENU_DEPTH, subMenuDepth);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DynamicUpdateCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DynamicUpdateCapabilities.java
index f8b16ce29..2468d369a 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DynamicUpdateCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DynamicUpdateCapabilities.java
@@ -52,14 +52,14 @@ import java.util.List;
* <tr>
* <td>supportedDynamicImageFieldNames</td>
* <td>List<ImageFieldName></td>
- * <td>An array of ImageFieldName values for which the system supports sending OnFileUpdatenotifications. If you send an Image struct for that image field with a name without havinguploaded the image data using PutFile that matches that name, the system will request thatyou upload the data with PutFile at a later point when the HMI needs it. The HMI will thendisplay the image in the appropriate field. If not sent, assume false.</td>
+ * <td>An array of ImageFieldName values for which the system supports sending OnFileUpdateNotifications. If you send an Image struct for that image field with a name without having uploaded the image data using PutFile that matches that name, the system will request that you upload the data with PutFile at a later point when the HMI needs it. The HMI will then display the image in the appropriate field. If not sent, assume false.</td>
* <td>N</td>
* <td></td>
* </tr>
* <tr>
* <td>supportsDynamicSubMenus</td>
* <td>Boolean</td>
- * <td>If true, the head unit supports dynamic sub-menus by sending OnUpdateSubMenunotifications. If true, you should not send AddCommands that attach to a parentID for anAddSubMenu until OnUpdateSubMenu is received with the menuID. At that point, you shouldsend all AddCommands with a parentID that match the menuID. If not set, assume false.</td>
+ * <td>If true, the head unit supports dynamic sub-menus by sending OnUpdateSubMenuNotifications. If true, you should not send AddCommands that attach to a parentID for anAddSubMenu until OnUpdateSubMenu is received with the menuID. At that point, you should send all AddCommands with a parentID that match the menuID. If not set, assume false.</td>
* <td>N</td>
* <td></td>
* </tr>
@@ -93,8 +93,9 @@ public class DynamicUpdateCapabilities extends RPCStruct {
* you upload the data with PutFile at a later point when the HMI needs it. The HMI will then
* display the image in the appropriate field. If not sent, assume false.
*/
- public void setSupportedDynamicImageFieldNames(List<ImageFieldName> supportedDynamicImageFieldNames) {
+ public DynamicUpdateCapabilities setSupportedDynamicImageFieldNames( List<ImageFieldName> supportedDynamicImageFieldNames) {
setValue(KEY_SUPPORTED_DYNAMIC_IMAGE_FIELD_NAMES, supportedDynamicImageFieldNames);
+ return this;
}
/**
@@ -119,8 +120,9 @@ public class DynamicUpdateCapabilities extends RPCStruct {
* AddSubMenu until OnUpdateSubMenu is received with the menuID. At that point, you should
* send all AddCommands with a parentID that match the menuID. If not set, assume false.
*/
- public void setSupportsDynamicSubMenus(Boolean supportsDynamicSubMenus) {
+ public DynamicUpdateCapabilities setSupportsDynamicSubMenus( Boolean supportsDynamicSubMenus) {
setValue(KEY_SUPPORTS_DYNAMIC_SUB_MENUS, supportsDynamicSubMenus);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java
index 03c69af0a..e4f6fbd38 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -62,7 +62,7 @@ import java.util.Hashtable;
* <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>References signal "eCallNotification". This is an alternative signal available on some car lines replacing the eCallNotificationStatus, but showing the same values.</td>
* <td></td>
* <td></td>
* <td>SmartDeviceLink 2.0</td>
@@ -107,20 +107,23 @@ public class ECallInfo extends RPCStruct {
setECallConfirmationStatus(eCallConfirmationStatus);
}
- public void setECallNotificationStatus(@NonNull VehicleDataNotificationStatus eCallNotificationStatus) {
+ public ECallInfo setECallNotificationStatus(@NonNull VehicleDataNotificationStatus eCallNotificationStatus) {
setValue(KEY_E_CALL_NOTIFICATION_STATUS, eCallNotificationStatus);
+ return this;
}
public VehicleDataNotificationStatus getECallNotificationStatus() {
return (VehicleDataNotificationStatus) getObject(VehicleDataNotificationStatus.class, KEY_E_CALL_NOTIFICATION_STATUS);
}
- public void setAuxECallNotificationStatus(@NonNull VehicleDataNotificationStatus auxECallNotificationStatus) {
+ public ECallInfo setAuxECallNotificationStatus(@NonNull VehicleDataNotificationStatus auxECallNotificationStatus) {
setValue(KEY_AUX_E_CALL_NOTIFICATION_STATUS, auxECallNotificationStatus);
+ return this;
}
public VehicleDataNotificationStatus getAuxECallNotificationStatus() {
return (VehicleDataNotificationStatus) getObject(VehicleDataNotificationStatus.class, KEY_AUX_E_CALL_NOTIFICATION_STATUS);
}
- public void setECallConfirmationStatus(@NonNull ECallConfirmationStatus eCallConfirmationStatus) {
+ public ECallInfo setECallConfirmationStatus(@NonNull ECallConfirmationStatus eCallConfirmationStatus) {
setValue(KEY_E_CALL_CONFIRMATION_STATUS, eCallConfirmationStatus);
+ return this;
}
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
index 6c22dc83d..923ad39fd 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -132,32 +132,37 @@ public class EmergencyEvent extends RPCStruct {
setMultipleEvents(multipleEvents);
}
- public void setEmergencyEventType(@NonNull EmergencyEventType emergencyEventType) {
+ public EmergencyEvent setEmergencyEventType(@NonNull EmergencyEventType emergencyEventType) {
setValue(KEY_EMERGENCY_EVENT_TYPE, emergencyEventType);
+ return this;
}
public EmergencyEventType getEmergencyEventType() {
return (EmergencyEventType) getObject(EmergencyEventType.class, KEY_EMERGENCY_EVENT_TYPE);
}
- public void setFuelCutoffStatus(@NonNull FuelCutoffStatus fuelCutoffStatus) {
+ public EmergencyEvent setFuelCutoffStatus(@NonNull FuelCutoffStatus fuelCutoffStatus) {
setValue(KEY_FUEL_CUTOFF_STATUS, fuelCutoffStatus);
+ return this;
}
public FuelCutoffStatus getFuelCutoffStatus() {
return (FuelCutoffStatus) getObject(FuelCutoffStatus.class, KEY_FUEL_CUTOFF_STATUS);
}
- public void setRolloverEvent(@NonNull VehicleDataEventStatus rolloverEvent) {
+ public EmergencyEvent setRolloverEvent(@NonNull VehicleDataEventStatus rolloverEvent) {
setValue(KEY_ROLLOVER_EVENT, rolloverEvent);
+ return this;
}
public VehicleDataEventStatus getRolloverEvent() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_ROLLOVER_EVENT);
}
- public void setMaximumChangeVelocity(@NonNull Integer maximumChangeVelocity) {
+ public EmergencyEvent setMaximumChangeVelocity(@NonNull Integer maximumChangeVelocity) {
setValue(KEY_MAXIMUM_CHANGE_VELOCITY, maximumChangeVelocity);
+ return this;
}
public Integer getMaximumChangeVelocity() {
return getInteger(KEY_MAXIMUM_CHANGE_VELOCITY);
}
- public void setMultipleEvents(@NonNull VehicleDataEventStatus multipleEvents) {
+ public EmergencyEvent setMultipleEvents(@NonNull VehicleDataEventStatus multipleEvents) {
setValue(KEY_MULTIPLE_EVENTS, multipleEvents);
+ return this;
}
public VehicleDataEventStatus getMultipleEvents() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_MULTIPLE_EVENTS);
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java
index 81c7f100c..430341342 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/EqualizerSettings.java
@@ -77,9 +77,10 @@ public class EqualizerSettings extends RPCStruct {
*
* @param channelId ID that represents the channel these settings should be applied
*/
- public void setChannelId(@NonNull Integer channelId) {
- setValue(KEY_CHANNEL_ID, channelId);
- }
+ public EqualizerSettings setChannelId(@NonNull Integer channelId) {
+ setValue(KEY_CHANNEL_ID, channelId);
+ return this;
+ }
/**
* Gets the channelId portion of the EqualizerSettings class
@@ -93,16 +94,17 @@ public class EqualizerSettings extends RPCStruct {
/**
* Sets the channelName portion of the EqualizerSettings class
*
- * @param channelName Read-only channel / frequency name (e.i. "Treble, Midrange, Bass" or "125 Hz").
+ * @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);
- }
+ public EqualizerSettings setChannelName( String channelName) {
+ setValue(KEY_CHANNEL_NAME, channelName);
+ return this;
+ }
/**
* Gets the channelName portion of the EqualizerSettings class
*
- * @return String - Read-only channel / frequency name (e.i. "Treble, Midrange, Bass" or "125 Hz").
+ * @return String - Read-only channel / frequency name (e.i. "Treble, MidRange, Bass" or "125 Hz").
*/
public String getChannelName() {
return getString(KEY_CHANNEL_NAME);
@@ -113,9 +115,10 @@ public class EqualizerSettings extends RPCStruct {
*
* @param channelSetting Reflects the setting, from 0%-100%.
*/
- public void setChannelSetting(@NonNull Integer channelSetting) {
- setValue(KEY_CHANNEL_SETTING, channelSetting);
- }
+ public EqualizerSettings setChannelSetting(@NonNull Integer channelSetting) {
+ setValue(KEY_CHANNEL_SETTING, channelSetting);
+ return this;
+ }
/**
* Gets the channelSetting portion of the EqualizerSettings class
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/FuelRange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/FuelRange.java
index 1457a7459..1c6885649 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/FuelRange.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/FuelRange.java
@@ -32,14 +32,84 @@
package com.smartdevicelink.proxy.rpc;
import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.CapacityUnit;
+import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
import com.smartdevicelink.proxy.rpc.enums.FuelType;
import com.smartdevicelink.util.SdlDataTypeConverter;
import java.util.Hashtable;
-public class FuelRange extends RPCStruct{
+/**
+ *
+ * <p><b>Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Required</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>type</td>
+ * <td>FuelType</td>
+ * <td></td>
+ * <td>N</td>
+ * <td></td>
+ * <td></td>
+ * </tr>
+ * <tr>
+ * <td>range</td>
+ * <td>Float</td>
+ * <td>The estimate range in KM the vehicle can travel based on fuel level and consumption.</td>
+ * <td>N</td>
+ * <td>{"num_min_value": 0.0, "num_max_value": 10000.0}</td>
+ * <td></td>
+ * </tr>
+ * <tr>
+ * <td>level</td>
+ * <td>Float</td>
+ * <td>The relative remaining capacity of this fuel type (percentage).</td>
+ * <td>N</td>
+ * <td>{"num_min_value": -6.0, "num_max_value": 1000000.0}</td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
+ * <tr>
+ * <td>levelState</td>
+ * <td>ComponentVolumeStatus</td>
+ * <td>The fuel level state</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
+ * <tr>
+ * <td>capacity</td>
+ * <td>Float</td>
+ * <td>The absolute capacity of this fuel type.</td>
+ * <td>N</td>
+ * <td>{"num_min_value": 0.0, "num_max_value": 1000000.0}</td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
+ * <tr>
+ * <td>capacityUnit</td>
+ * <td>CapacityUnit</td>
+ * <td>The unit of the capacity of this fuel type such as liters for gasoline or kWh for batteries.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 5.0.0
+ */
+public class FuelRange extends RPCStruct {
public static final String KEY_TYPE = "type";
public static final String KEY_RANGE = "range";
+ public static final String KEY_LEVEL = "level";
+ public static final String KEY_LEVEL_STATE = "levelState";
+ public static final String KEY_CAPACITY = "capacity";
+ public static final String KEY_CAPACITY_UNIT = "capacityUnit";
/**
* Constructs a new FuelRange object
@@ -62,10 +132,11 @@ public class FuelRange extends RPCStruct{
*
* @param fuelType the type of fuel related to this FuelRange object.
*
- * @see com.smartdevicelink.proxy.rpc.enums.FuelType
+ * @see FuelType
*/
- public void setType(FuelType fuelType) {
+ public FuelRange setType( FuelType fuelType) {
setValue(KEY_TYPE, fuelType);
+ return this;
}
/**
@@ -93,7 +164,100 @@ public class FuelRange extends RPCStruct{
* @param range
* The estimate range in KM the vehicle can travel based on fuel level and consumption.
*/
- public void setRange(Float range) {
+ public FuelRange setRange( Float range) {
setValue(KEY_RANGE, range);
+ return this;
+ }
+
+ /**
+ * Sets the level.
+ *
+ * @param level The relative remaining capacity of this fuel type (percentage).
+ * {"num_min_value": -6.0, "num_max_value": 1000000.0}
+ * @since SmartDeviceLink 7.0.0
+ */
+ public FuelRange setLevel( Float level) {
+ setValue(KEY_LEVEL, level);
+ return this;
+ }
+
+ /**
+ * Gets the level.
+ *
+ * @return Float The relative remaining capacity of this fuel type (percentage).
+ * {"num_min_value": -6.0, "num_max_value": 1000000.0}
+ * @since SmartDeviceLink 7.0.0
+ */
+ public Float getLevel() {
+ Object object = getValue(KEY_LEVEL);
+ return SdlDataTypeConverter.objectToFloat(object);
+ }
+
+ /**
+ * Sets the levelState.
+ *
+ * @param levelState The fuel level state
+ * @since SmartDeviceLink 7.0.0
+ */
+ public FuelRange setLevelState( ComponentVolumeStatus levelState) {
+ setValue(KEY_LEVEL_STATE, levelState);
+ return this;
+ }
+
+ /**
+ * Gets the levelState.
+ *
+ * @return ComponentVolumeStatus The fuel level state
+ * @since SmartDeviceLink 7.0.0
+ */
+ public ComponentVolumeStatus getLevelState() {
+ return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_LEVEL_STATE);
+ }
+
+ /**
+ * Sets the capacity.
+ *
+ * @param capacity The absolute capacity of this fuel type.
+ * {"num_min_value": 0.0, "num_max_value": 1000000.0}
+ * @since SmartDeviceLink 7.0.0
+ */
+ public FuelRange setCapacity( Float capacity) {
+ setValue(KEY_CAPACITY, capacity);
+ return this;
+ }
+
+ /**
+ * Gets the capacity.
+ *
+ * @return Float The absolute capacity of this fuel type.
+ * {"num_min_value": 0.0, "num_max_value": 1000000.0}
+ * @since SmartDeviceLink 7.0.0
+ */
+ public Float getCapacity() {
+ Object object = getValue(KEY_CAPACITY);
+ return SdlDataTypeConverter.objectToFloat(object);
+ }
+
+ /**
+ * Sets the capacityUnit.
+ *
+ * @param capacityUnit The unit of the capacity of this fuel type such as liters for gasoline or kWh for
+ * batteries.
+ * @since SmartDeviceLink 7.0.0
+ */
+ public FuelRange setCapacityUnit( CapacityUnit capacityUnit) {
+ setValue(KEY_CAPACITY_UNIT, capacityUnit);
+ return this;
+ }
+
+ /**
+ * Gets the capacityUnit.
+ *
+ * @return CapacityUnit The unit of the capacity of this fuel type such as liters for gasoline or kWh for
+ * batteries.
+ * @since SmartDeviceLink 7.0.0
+ */
+ public CapacityUnit getCapacityUnit() {
+ return (CapacityUnit) getObject(CapacityUnit.class, KEY_CAPACITY_UNIT);
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java
index f36cd6127..e259636e6 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GPSData.java
@@ -41,7 +41,7 @@ import com.smartdevicelink.util.SdlDataTypeConverter;
import java.util.Hashtable;
/**
- * Describes the GPS data. Not all data will be available on all carlines.
+ * Describes the GPS data. Not all data will be available on all car lines.
* <p><b>Parameter List</b></p>
* <table border="1" rules="all">
* <tr>
@@ -222,8 +222,9 @@ public class GPSData extends RPCStruct {
* set longitude degrees
* @param longitudeDegrees degrees of the longitudinal position
*/
- public void setLongitudeDegrees(@NonNull Double longitudeDegrees) {
- setValue(KEY_LONGITUDE_DEGREES, longitudeDegrees);
+ public GPSData setLongitudeDegrees(@NonNull Double longitudeDegrees) {
+ setValue(KEY_LONGITUDE_DEGREES, longitudeDegrees);
+ return this;
}
/**
@@ -239,8 +240,9 @@ public class GPSData extends RPCStruct {
* set latitude degrees
* @param latitudeDegrees degrees of the latitudinal position
*/
- public void setLatitudeDegrees(@NonNull Double latitudeDegrees) {
- setValue(KEY_LATITUDE_DEGREES, latitudeDegrees);
+ public GPSData setLatitudeDegrees(@NonNull Double latitudeDegrees) {
+ setValue(KEY_LATITUDE_DEGREES, latitudeDegrees);
+ return this;
}
/**
@@ -256,8 +258,9 @@ public class GPSData extends RPCStruct {
* set utc year
* @param utcYear utc year
*/
- public void setUtcYear(Integer utcYear) {
- setValue(KEY_UTC_YEAR, utcYear);
+ public GPSData setUtcYear( Integer utcYear) {
+ setValue(KEY_UTC_YEAR, utcYear);
+ return this;
}
/**
@@ -272,8 +275,9 @@ public class GPSData extends RPCStruct {
* set utc month
* @param utcMonth utc month
*/
- public void setUtcMonth(Integer utcMonth) {
- setValue(KEY_UTC_MONTH, utcMonth);
+ public GPSData setUtcMonth( Integer utcMonth) {
+ setValue(KEY_UTC_MONTH, utcMonth);
+ return this;
}
/**
@@ -288,8 +292,9 @@ public class GPSData extends RPCStruct {
* set utc day
* @param utcDay utc day
*/
- public void setUtcDay(Integer utcDay) {
- setValue(KEY_UTC_DAY, utcDay);
+ public GPSData setUtcDay( Integer utcDay) {
+ setValue(KEY_UTC_DAY, utcDay);
+ return this;
}
/**
@@ -304,8 +309,9 @@ public class GPSData extends RPCStruct {
* set utc hours
* @param utcHours utc hours
*/
- public void setUtcHours(Integer utcHours) {
- setValue(KEY_UTC_HOURS, utcHours);
+ public GPSData setUtcHours( Integer utcHours) {
+ setValue(KEY_UTC_HOURS, utcHours);
+ return this;
}
/**
@@ -320,8 +326,9 @@ public class GPSData extends RPCStruct {
* set utc minutes
* @param utcMinutes utc minutes
*/
- public void setUtcMinutes(Integer utcMinutes) {
- setValue(KEY_UTC_MINUTES, utcMinutes);
+ public GPSData setUtcMinutes( Integer utcMinutes) {
+ setValue(KEY_UTC_MINUTES, utcMinutes);
+ return this;
}
/**
@@ -336,8 +343,9 @@ public class GPSData extends RPCStruct {
* set utc seconds
* @param utcSeconds utc seconds
*/
- public void setUtcSeconds(Integer utcSeconds) {
- setValue(KEY_UTC_SECONDS, utcSeconds);
+ public GPSData setUtcSeconds( Integer utcSeconds) {
+ setValue(KEY_UTC_SECONDS, utcSeconds);
+ return this;
}
/**
@@ -347,8 +355,9 @@ public class GPSData extends RPCStruct {
public Integer getUtcSeconds() {
return getInteger(KEY_UTC_SECONDS);
}
- public void setCompassDirection(CompassDirection compassDirection) {
- setValue(KEY_COMPASS_DIRECTION, compassDirection);
+ public GPSData setCompassDirection( CompassDirection compassDirection) {
+ setValue(KEY_COMPASS_DIRECTION, compassDirection);
+ return this;
}
public CompassDirection getCompassDirection() {
return (CompassDirection) getObject(CompassDirection.class, KEY_COMPASS_DIRECTION);
@@ -358,8 +367,9 @@ public class GPSData extends RPCStruct {
* set the positional dilution of precision
* @param pdop the positional dilution of precision
*/
- public void setPdop(Double pdop) {
- setValue(KEY_PDOP, pdop);
+ public GPSData setPdop( Double pdop) {
+ setValue(KEY_PDOP, pdop);
+ return this;
}
/**
@@ -374,8 +384,9 @@ public class GPSData extends RPCStruct {
* set the horizontal dilution of precision
* @param hdop the horizontal dilution of precision
*/
- public void setHdop(Double hdop) {
- setValue(KEY_HDOP, hdop);
+ public GPSData setHdop( Double hdop) {
+ setValue(KEY_HDOP, hdop);
+ return this;
}
/**
@@ -391,8 +402,9 @@ public class GPSData extends RPCStruct {
* set the vertical dilution of precision
* @param vdop the vertical dilution of precision
*/
- public void setVdop(Double vdop) {
- setValue(KEY_VDOP, vdop);
+ public GPSData setVdop( Double vdop) {
+ setValue(KEY_VDOP, vdop);
+ return this;
}
/**
@@ -405,11 +417,12 @@ public class GPSData extends RPCStruct {
}
/**
- * set what coordinates based on
+ * 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);
+ public GPSData setActual( Boolean actual) {
+ setValue(KEY_ACTUAL, actual);
+ return this;
}
/**
@@ -424,8 +437,9 @@ public class GPSData extends RPCStruct {
* set the number of satellites in view
* @param satellites the number of satellites in view
*/
- public void setSatellites(Integer satellites) {
- setValue(KEY_SATELLITES, satellites);
+ public GPSData setSatellites( Integer satellites) {
+ setValue(KEY_SATELLITES, satellites);
+ return this;
}
/**
@@ -435,8 +449,9 @@ public class GPSData extends RPCStruct {
public Integer getSatellites() {
return getInteger(KEY_SATELLITES);
}
- public void setDimension(Dimension dimension) {
- setValue(KEY_DIMENSION, dimension);
+ public GPSData setDimension( Dimension dimension) {
+ setValue(KEY_DIMENSION, dimension);
+ return this;
}
public Dimension getDimension() {
return (Dimension) getObject(Dimension.class, KEY_DIMENSION);
@@ -446,8 +461,9 @@ public class GPSData extends RPCStruct {
* set altitude in meters
* @param altitude altitude in meters
*/
- public void setAltitude(Double altitude) {
- setValue(KEY_ALTITUDE, altitude);
+ public GPSData setAltitude( Double altitude) {
+ setValue(KEY_ALTITUDE, altitude);
+ return this;
}
/**
@@ -461,10 +477,11 @@ public class GPSData extends RPCStruct {
/**
* set the heading.North is 0, East is 90, etc.
- * @param heading the heading.
+ * @param heading the heading.
*/
- public void setHeading(Double heading) {
- setValue(KEY_HEADING, heading);
+ public GPSData setHeading( Double heading) {
+ setValue(KEY_HEADING, heading);
+ return this;
}
/**
@@ -479,8 +496,9 @@ public class GPSData extends RPCStruct {
* set speed in KPH
* @param speed the speed
*/
- public void setSpeed(Double speed) {
- setValue(KEY_SPEED, speed);
+ public GPSData setSpeed( Double speed) {
+ setValue(KEY_SPEED, speed);
+ return this;
}
/**
@@ -491,22 +509,23 @@ public class GPSData extends RPCStruct {
Object object = getValue(KEY_SPEED);
return SdlDataTypeConverter.objectToDouble(object);
}
-
- /**
- * Sets the shifted param for GPSData.
- * @param shifted True, if GPS lat/long, time, and altitude have been purposefully shifted (requires a proprietary algorithm to unshift).
- * False, if the GPS data is raw and un-shifted.
- * If not provided, then value is assumed False.
- */
- public void setShifted(Boolean shifted) {
- setValue(KEY_SHIFTED, shifted);
- }
-
- /**
- * Gets the shifted param for GPSData.
- * @return Boolean - True, if GPS lat/long, time, and altitude have been purposefully shifted (requires a proprietary algorithm to unshift).
- */
- public Boolean getShifted() {
- return getBoolean(KEY_SHIFTED);
- }
-}
+
+ /**
+ * Sets the shifted param for GPSData.
+ * @param shifted True, if GPS lat/long, time, and altitude have been purposefully shifted (requires a proprietary algorithm to unshift).
+ * False, if the GPS data is raw and un-shifted.
+ * If not provided, then value is assumed False.
+ */
+ public GPSData setShifted( Boolean shifted) {
+ setValue(KEY_SHIFTED, shifted);
+ return this;
+ }
+
+ /**
+ * Gets the shifted param for GPSData.
+ * @return Boolean - True, if GPS lat/long, time, and altitude have been purposefully shifted (requires a proprietary algorithm to unshift).
+ */
+ public Boolean getShifted() {
+ return getBoolean(KEY_SHIFTED);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GearStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GearStatus.java
index 131e7f831..b1dac965c 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GearStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GearStatus.java
@@ -95,10 +95,11 @@ public class GearStatus extends RPCStruct {
/**
* Sets the userSelectedGear.
*
- * @param userSelectedGear Gear position selected by the user i.e. Park, Drive, Reverse
+ * @param selectedGear Gear position selected by the user i.e. Park, Drive, Reverse
*/
- public void setUserSelectedGear(PRNDL selectedGear){
+ public GearStatus setUserSelectedGear( PRNDL selectedGear) {
setValue(KEY_USER_SELECTED_GEAR, selectedGear);
+ return this;
}
/**
@@ -106,7 +107,6 @@ public class GearStatus extends RPCStruct {
*
* @return PRNDL Gear position selected by the user i.e. Park, Drive, Reverse
*/
- @SuppressWarnings("unchecked")
public PRNDL getUserSelectedGear(){
return (PRNDL)getObject(PRNDL.class, KEY_USER_SELECTED_GEAR);
}
@@ -116,8 +116,9 @@ public class GearStatus extends RPCStruct {
*
* @param actualGear Actual Gear in use by the transmission
*/
- public void setActualGear(PRNDL actualGear){
+ public GearStatus setActualGear( PRNDL actualGear) {
setValue(KEY_ACTUAL_GEAR, actualGear);
+ return this;
}
/**
@@ -125,7 +126,6 @@ public class GearStatus extends RPCStruct {
*
* @return PRNDL Actual Gear in use by the transmission
*/
- @SuppressWarnings("unchecked")
public PRNDL getActualGear(){
return (PRNDL)getObject(PRNDL.class, KEY_ACTUAL_GEAR);
}
@@ -135,8 +135,9 @@ public class GearStatus extends RPCStruct {
*
* @param transmissionType Tells the transmission type
*/
- public void setTransmissionType(TransmissionType transmissionType){
+ public GearStatus setTransmissionType( TransmissionType transmissionType) {
setValue(KEY_TRANSMISSION_TYPE, transmissionType);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java
index 9946de27a..77a423af9 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceData.java
@@ -78,9 +78,10 @@ public class GetAppServiceData extends RPCRequest {
/**
* @param appServiceType - the appServiceType
*/
- public void setServiceType(@NonNull String appServiceType){
- setParameters(KEY_SERVICE_TYPE, appServiceType);
- }
+ public GetAppServiceData setServiceType(@NonNull String appServiceType) {
+ setParameters(KEY_SERVICE_TYPE, appServiceType);
+ return this;
+ }
/**
* @return appServiceType
@@ -95,9 +96,10 @@ public class GetAppServiceData extends RPCRequest {
* if it was previously subscribed.
* @param subscribe -
*/
- public void setSubscribe(Boolean subscribe){
- setParameters(KEY_SUBSCRIBE, subscribe);
- }
+ public GetAppServiceData setSubscribe( Boolean subscribe) {
+ setParameters(KEY_SUBSCRIBE, subscribe);
+ return this;
+ }
/**
* If true, the consumer is requesting to subscribe to all future updates from the service
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java
index 253626e9b..0739e9e58 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetAppServiceDataResponse.java
@@ -67,9 +67,10 @@ public class GetAppServiceDataResponse extends RPCResponse {
/**
* @param serviceData -
*/
- public void setServiceData(AppServiceData serviceData){
- setParameters(KEY_SERVICE_DATA, serviceData);
- }
+ public GetAppServiceDataResponse setServiceData( AppServiceData serviceData) {
+ setParameters(KEY_SERVICE_DATA, serviceData);
+ return this;
+ }
/**
* @return serviceData
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java
index 3348d4cb1..11913954b 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppProperties.java
@@ -55,8 +55,9 @@ public class GetCloudAppProperties extends RPCRequest {
setParameters(KEY_APP_ID, appID);
}
- public void setAppID(String appId){
+ public GetCloudAppProperties setAppID( String appId) {
setParameters(KEY_APP_ID, appId);
+ return this;
}
public String getAppID(){
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java
index 2c4eddeda..04e576353 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetCloudAppPropertiesResponse.java
@@ -62,8 +62,9 @@ public class GetCloudAppPropertiesResponse extends RPCResponse {
setResultCode(resultCode);
}
- public void setCloudAppProperties(CloudAppProperties cloudAppProperties){
+ public GetCloudAppPropertiesResponse setCloudAppProperties( CloudAppProperties cloudAppProperties) {
setParameters(KEY_PROPERTIES, cloudAppProperties);
+ return this;
}
public CloudAppProperties getCloudAppProperties(){
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java
index 939e1cdb6..63b0d716b 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -120,15 +120,16 @@ public class GetDTCs extends RPCRequest {
/**
* 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);
+ public GetDTCs setEcuName(@NonNull Integer ecuName) {
+ setParameters(KEY_ECU_NAME, ecuName);
+ return this;
}
/**
@@ -140,8 +141,9 @@ public class GetDTCs extends RPCRequest {
public Integer getEcuName() {
return getInteger(KEY_ECU_NAME);
}
- public void setDtcMask(Integer dtcMask) {
- setParameters(KEY_DTC_MASK, dtcMask);
+ public GetDTCs setDtcMask( Integer dtcMask) {
+ setParameters(KEY_DTC_MASK, dtcMask);
+ return this;
}
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
index e7c54c02b..87ae47ab8 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java
@@ -74,16 +74,18 @@ public class GetDTCsResponse extends RPCResponse{
return (List<String>) getObject(String.class, KEY_DTC);
}
- public void setDtc(List<String> dtc){
+ public GetDTCsResponse setDtc( List<String> dtc) {
setParameters(KEY_DTC, dtc);
+ return this;
}
public Integer getEcuHeader(){
return getInteger(KEY_ECU_HEADER);
}
- public void setEcuHeader(Integer ecuHeader){
+ public GetDTCsResponse setEcuHeader( Integer ecuHeader) {
setParameters(KEY_ECU_HEADER, ecuHeader);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java
index d1453ded1..ea8d41c04 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFile.java
@@ -72,9 +72,10 @@ public class GetFile extends RPCRequest {
* maxlength="255"
* @param fileName -
*/
- public void setFileName(@NonNull String fileName){
- setParameters(KEY_FILE_NAME, fileName);
- }
+ public GetFile setFileName(@NonNull String fileName) {
+ setParameters(KEY_FILE_NAME, fileName);
+ return this;
+ }
/**
* File name that should be retrieved.
@@ -89,9 +90,10 @@ public class GetFile extends RPCRequest {
* ID of the service that should have uploaded the requested file
* @param appServiceId -
*/
- public void setAppServiceId(String appServiceId){
- setParameters(KEY_APP_SERVICE_ID, appServiceId);
- }
+ public GetFile setAppServiceId( String appServiceId) {
+ setParameters(KEY_APP_SERVICE_ID, appServiceId);
+ return this;
+ }
/**
* ID of the service that should have uploaded the requested file
@@ -105,9 +107,10 @@ public class GetFile extends RPCRequest {
* Selected file type.
* @param fileType -
*/
- public void setFileType(FileType fileType){
- setParameters(KEY_FILE_TYPE, fileType);
- }
+ public GetFile setFileType( FileType fileType) {
+ setParameters(KEY_FILE_TYPE, fileType);
+ return this;
+ }
/**
* Selected file type.
@@ -122,9 +125,10 @@ public class GetFile extends RPCRequest {
* minvalue="0" maxvalue="2000000000"
* @param offset -
*/
- public void setOffset(Integer offset){
- setParameters(KEY_OFFSET, offset);
- }
+ public GetFile setOffset( Integer offset) {
+ setParameters(KEY_OFFSET, offset);
+ return this;
+ }
/**
* Optional offset in bytes for resuming partial data chunks
@@ -141,9 +145,10 @@ public class GetFile extends RPCRequest {
* minvalue="0" maxvalue="2000000000"
* @param length -
*/
- public void setLength(Integer length){
- setParameters(KEY_LENGTH, length);
- }
+ public GetFile setLength( Integer length) {
+ setParameters(KEY_LENGTH, length);
+ return this;
+ }
/**
* Optional length in bytes for resuming partial data chunks if offset is set to 0, then 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
index 711de294c..17b5473c4 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFileResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetFileResponse.java
@@ -73,9 +73,10 @@ public class GetFileResponse extends RPCResponse {
* File type that is being sent in response
* @param fileType -
*/
- public void setFileType(FileType fileType){
- setParameters(KEY_FILE_TYPE, fileType);
- }
+ public GetFileResponse setFileType( FileType fileType) {
+ setParameters(KEY_FILE_TYPE, fileType);
+ return this;
+ }
/**
* File type that is being sent in response
@@ -90,9 +91,10 @@ public class GetFileResponse extends RPCResponse {
* minvalue="0" maxvalue="2000000000"
* @param offset -
*/
- public void setOffset(Integer offset){
- setParameters(KEY_OFFSET, offset);
- }
+ public GetFileResponse setOffset( Integer offset) {
+ setParameters(KEY_OFFSET, offset);
+ return this;
+ }
/**
* Optional offset in bytes for resuming partial data chunks
@@ -109,9 +111,10 @@ public class GetFileResponse extends RPCResponse {
* minvalue="0" maxvalue="2000000000"
* @param length -
*/
- public void setLength(Integer length){
- setParameters(KEY_LENGTH, length);
- }
+ public GetFileResponse setLength( Integer length) {
+ setParameters(KEY_LENGTH, length);
+ return this;
+ }
/**
* Optional length in bytes for resuming partial data chunks if offset is set to 0, then length
@@ -128,9 +131,10 @@ public class GetFileResponse extends RPCResponse {
* minvalue="0" maxvalue="4294967295"
* @param crc -
*/
- public void setCRC(Integer crc){
- setParameters(KEY_CRC, crc);
- }
+ public GetFileResponse setCRC( Integer crc) {
+ setParameters(KEY_CRC, crc);
+ return this;
+ }
/**
* Additional CRC32 checksum to protect data integrity up to 512 Mbits
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java
index a6a323646..f5bc028ff 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java
@@ -95,19 +95,21 @@ public class GetInteriorVehicleData extends RPCRequest {
* 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) {
+ public GetInteriorVehicleData setModuleType(@NonNull ModuleType moduleType) {
setParameters(KEY_MODULE_TYPE, moduleType);
+ return this;
}
/**
* 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.
+ * 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.
*/
- public void setSubscribe(Boolean subscribe) {
+ public GetInteriorVehicleData setSubscribe( Boolean subscribe) {
setParameters(KEY_SUBSCRIBE, subscribe);
+ return this;
}
/**
@@ -124,8 +126,9 @@ public class GetInteriorVehicleData extends RPCRequest {
* Sets the Module ID for this class
* @param id the id to be set
*/
- public void setModuleId(String id) {
+ public GetInteriorVehicleData setModuleId( String id) {
setParameters(KEY_MODULE_ID, id);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsent.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsent.java
index b4d3e02f3..46a40b5dd 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsent.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsent.java
@@ -35,8 +35,9 @@ public class GetInteriorVehicleDataConsent extends RPCRequest {
* Sets the Module Type for this class
* @param type the Module Type to be set
*/
- public void setModuleType(@NonNull ModuleType type) {
+ public GetInteriorVehicleDataConsent setModuleType(@NonNull ModuleType type) {
setParameters(KEY_MODULE_TYPE, type);
+ return this;
}
/**
@@ -51,8 +52,9 @@ public class GetInteriorVehicleDataConsent extends RPCRequest {
* Sets the Module Ids for this class
* @param ids the ids to be set
*/
- public void setModuleIds(@NonNull List<String> ids) {
+ public GetInteriorVehicleDataConsent setModuleIds(@NonNull List<String> ids) {
setParameters(KEY_MODULE_ID, ids);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsentResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsentResponse.java
index 5c2b5c7e9..91df49d4a 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsentResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataConsentResponse.java
@@ -31,8 +31,9 @@ public class GetInteriorVehicleDataConsentResponse extends RPCResponse {
* Sets the list of allowances for this class
* @param allowances the allowances to be set
*/
- public void setAllowances(@NonNull List<Boolean> allowances) {
+ public GetInteriorVehicleDataConsentResponse setAllowances(@NonNull List<Boolean> allowances) {
setParameters(KEY_ALLOWED, allowances);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java
index ccf1e7913..7fb081f30 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java
@@ -87,9 +87,10 @@ public class GetInteriorVehicleDataResponse extends RPCResponse {
*
* @param moduleData specific data for the module that was requested
*/
- public void setModuleData(ModuleData moduleData) {
- setParameters(KEY_MODULE_DATA, moduleData);
- }
+ public GetInteriorVehicleDataResponse setModuleData( ModuleData moduleData) {
+ setParameters(KEY_MODULE_DATA, moduleData);
+ return this;
+ }
/**
* Sets isSubscribed parameter
@@ -99,9 +100,10 @@ public class GetInteriorVehicleDataResponse extends RPCResponse {
* 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);
- }
+ public GetInteriorVehicleDataResponse setIsSubscribed( Boolean isSubscribed) {
+ setParameters(KEY_IS_SUBSCRIBED, isSubscribed);
+ return this;
+ }
/**
* Gets isSubscribed parameter
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java
index 8cb70d7aa..173360d64 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java
@@ -84,8 +84,9 @@ public class GetSystemCapability extends RPCRequest {
* Used to set the SystemCapabilityType being requested
* @param value SystemCapabilityType being requested
*/
- public void setSystemCapabilityType(@NonNull SystemCapabilityType value){
+ public GetSystemCapability setSystemCapabilityType(@NonNull SystemCapabilityType value) {
setParameters(KEY_SYSTEM_CAPABILITY_TYPE, value);
+ return this;
}
/**
@@ -104,7 +105,8 @@ public class GetSystemCapability extends RPCRequest {
* subscriber if it was previously subscribed.
* @param subscribe to changes in the SystemCapabilityType
*/
- public void setSubscribe(Boolean subscribe){
+ public GetSystemCapability setSubscribe( Boolean subscribe) {
setParameters(KEY_SUBSCRIBE, subscribe);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java
index 29803499e..f48e095e7 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java
@@ -87,7 +87,8 @@ public class GetSystemCapabilityResponse extends RPCResponse {
* Set a SystemCapability object in the response
* @param value SystemCapability object
*/
- public void setSystemCapability(SystemCapability value){
+ public GetSystemCapabilityResponse setSystemCapability( SystemCapability value) {
setParameters(KEY_SYSTEM_CAPABILITY, value);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java
index 4699de61f..654089853 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleData.java
@@ -76,23 +76,31 @@ import java.util.Hashtable;
* <tr>
* <td>fuelLevel</td>
* <td>Boolean</td>
- * <td>The fuel level in the tank (percentage)</td>
+ * <td>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec7.0, please see fuelRange.</td>
* <td>N</td>
* <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
+ * <td>SmartDeviceLink 7.0.0</td>
* </tr>
* <tr>
* <td>fuelLevel_State</td>
* <td>Boolean</td>
- * <td>The fuel level state</td>
+ * <td>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange.</td>
* <td>N</td>
* <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
+ * <tr>
+ * <td>fuelRange</td>
+ * <td>Boolean</td>
+ * <td>The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle. See struct FuelRange for details.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 5.0.0</td>
* </tr>
* <tr>
* <td>instantFuelConsumption</td>
* <td>Boolean</td>
- * <td>The instantaneous fuel consumption in microlitres</td>
+ * <td>The instantaneous fuel consumption in micro litres</td>
* <td>N</td>
* <td>Subscribable</td>
* <td>SmartDeviceLink 2.0</td>
@@ -239,6 +247,13 @@ import java.util.Hashtable;
* <td>N</td>
* <td>Subscribable</td>
* <td>SmartDeviceLink 5.1 </td>
+ * <tr>
+ * <td>stabilityControlsStatus</td>
+ * <td>Boolean</td>
+ * <td>See StabilityControlsStatus</td>
+ * <td>N</td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
* </tr>
* <tr>
* <td>handsOffSteering</td>
@@ -281,7 +296,6 @@ 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";
@@ -289,7 +303,6 @@ public class GetVehicleData extends RPCRequest {
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";
@@ -311,6 +324,18 @@ public class GetVehicleData extends RPCRequest {
public static final String KEY_WINDOW_STATUS = "windowStatus";
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
public static final String KEY_GEAR_STATUS = "gearStatus";
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
/**
* Constructs a new GetVehicleData object
@@ -332,51 +357,89 @@ public class GetVehicleData extends RPCRequest {
public GetVehicleData(Hashtable<String, Object> hash) {
super(hash);
}
- public void setGps(Boolean gps) {
+ public GetVehicleData setGps( Boolean gps) {
setParameters(KEY_GPS, gps);
+ return this;
}
public Boolean getGps() {
return getBoolean(KEY_GPS);
}
- public void setSpeed(Boolean speed) {
+ public GetVehicleData setSpeed( Boolean speed) {
setParameters(KEY_SPEED, speed);
+ return this;
}
public Boolean getSpeed() {
return getBoolean(KEY_SPEED);
}
- public void setRpm(Boolean rpm) {
+ public GetVehicleData setRpm( Boolean rpm) {
setParameters(KEY_RPM, rpm);
+ return this;
}
public Boolean getRpm() {
return getBoolean(KEY_RPM);
}
- public void setFuelLevel(Boolean fuelLevel) {
+
+ /**
+ * Sets the fuelLevel.
+ *
+ * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
+ */
+ @Deprecated
+ public GetVehicleData setFuelLevel( Boolean fuelLevel) {
setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ return this;
}
+
+ /**
+ * Gets the fuelLevel.
+ *
+ * @return Boolean The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
+ */
+ @Deprecated
public Boolean getFuelLevel() {
return getBoolean(KEY_FUEL_LEVEL);
}
- public void setFuelLevelState(Boolean fuelLevelState) {
+
+ @Deprecated
+ public GetVehicleData setFuelLevelState( Boolean fuelLevelState) {
setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ return this;
}
+
+ @Deprecated
public Boolean getFuelLevelState() {
return getBoolean(KEY_FUEL_LEVEL_STATE);
}
- public void setInstantFuelConsumption(Boolean instantFuelConsumption) {
+ public GetVehicleData setInstantFuelConsumption( Boolean instantFuelConsumption) {
setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ return this;
}
public Boolean getInstantFuelConsumption() {
return getBoolean(KEY_INSTANT_FUEL_CONSUMPTION);
}
- public void setExternalTemperature(Boolean externalTemperature) {
+
+ public GetVehicleData setFuelRange( Boolean fuelRange) {
+ setParameters(KEY_FUEL_RANGE, fuelRange);
+ return this;
+ }
+
+ public Boolean getFuelRange() {
+ return getBoolean(KEY_FUEL_RANGE);
+ }
+
+ public GetVehicleData setExternalTemperature( Boolean externalTemperature) {
setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ return this;
}
public Boolean getExternalTemperature() {
return getBoolean(KEY_EXTERNAL_TEMPERATURE);
}
- public void setVin(Boolean vin) {
+ public GetVehicleData setVin( Boolean vin) {
setParameters(KEY_VIN, vin);
+ return this;
}
public Boolean getVin() {
return getBoolean(KEY_VIN);
@@ -389,8 +452,9 @@ public class GetVehicleData extends RPCRequest {
* @deprecated in SmartDeviceLink 7.0.0
*/
@Deprecated
- public void setPrndl(Boolean prndl) {
+ public GetVehicleData setPrndl( Boolean prndl) {
setParameters(KEY_PRNDL, prndl);
+ return this;
}
/**
@@ -403,136 +467,137 @@ public class GetVehicleData extends RPCRequest {
public Boolean getPrndl() {
return getBoolean(KEY_PRNDL);
}
- public void setTirePressure(Boolean tirePressure) {
+ public GetVehicleData setTirePressure( Boolean tirePressure) {
setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ return this;
}
public Boolean getTirePressure() {
return getBoolean(KEY_TIRE_PRESSURE);
}
- public void setOdometer(Boolean odometer) {
+ public GetVehicleData setOdometer( Boolean odometer) {
setParameters(KEY_ODOMETER, odometer);
+ return this;
}
public Boolean getOdometer() {
return getBoolean(KEY_ODOMETER);
}
- public void setBeltStatus(Boolean beltStatus) {
+ public GetVehicleData setBeltStatus( Boolean beltStatus) {
setParameters(KEY_BELT_STATUS, beltStatus);
+ return this;
}
public Boolean getBeltStatus() {
return getBoolean(KEY_BELT_STATUS);
}
- public void setBodyInformation(Boolean bodyInformation) {
+ public GetVehicleData setBodyInformation( Boolean bodyInformation) {
setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ return this;
}
public Boolean getBodyInformation() {
return getBoolean(KEY_BODY_INFORMATION);
}
- public void setDeviceStatus(Boolean deviceStatus) {
+ public GetVehicleData setDeviceStatus( Boolean deviceStatus) {
setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ return this;
}
public Boolean getDeviceStatus() {
return getBoolean(KEY_DEVICE_STATUS);
}
- public void setDriverBraking(Boolean driverBraking) {
+ public GetVehicleData setDriverBraking( Boolean driverBraking) {
setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ return this;
}
public Boolean getDriverBraking() {
return getBoolean(KEY_DRIVER_BRAKING);
}
- public void setWiperStatus(Boolean wiperStatus) {
+ public GetVehicleData setWiperStatus( Boolean wiperStatus) {
setParameters(KEY_WIPER_STATUS, wiperStatus);
+ return this;
}
public Boolean getWiperStatus() {
return getBoolean(KEY_WIPER_STATUS);
}
- public void setHeadLampStatus(Boolean headLampStatus) {
+ public GetVehicleData setHeadLampStatus( Boolean headLampStatus) {
setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ return this;
}
public Boolean getHeadLampStatus() {
return getBoolean(KEY_HEAD_LAMP_STATUS);
}
- public void setEngineTorque(Boolean engineTorque) {
+ public GetVehicleData setEngineTorque( Boolean engineTorque) {
setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ return this;
}
public Boolean getEngineTorque() {
return getBoolean(KEY_ENGINE_TORQUE);
}
- public void setEngineOilLife(Boolean engineOilLife) {
+ public GetVehicleData setEngineOilLife( Boolean engineOilLife) {
setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ return this;
}
public Boolean getEngineOilLife() {
return getBoolean(KEY_ENGINE_OIL_LIFE);
}
- public void setAccPedalPosition(Boolean accPedalPosition) {
+ public GetVehicleData setAccPedalPosition( Boolean accPedalPosition) {
setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ return this;
}
public Boolean getAccPedalPosition() {
return getBoolean(KEY_ACC_PEDAL_POSITION);
}
- public void setSteeringWheelAngle(Boolean steeringWheelAngle) {
+ public GetVehicleData setSteeringWheelAngle( Boolean steeringWheelAngle) {
setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ return this;
}
public Boolean getSteeringWheelAngle() {
return getBoolean(KEY_STEERING_WHEEL_ANGLE);
}
- public void setECallInfo(Boolean eCallInfo) {
+ public GetVehicleData setECallInfo( Boolean eCallInfo) {
setParameters(KEY_E_CALL_INFO, eCallInfo);
+ return this;
}
public Boolean getECallInfo() {
return getBoolean(KEY_E_CALL_INFO);
}
- public void setAirbagStatus(Boolean airbagStatus) {
+ public GetVehicleData setAirbagStatus( Boolean airbagStatus) {
setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ return this;
}
public Boolean getAirbagStatus() {
return getBoolean(KEY_AIRBAG_STATUS);
}
- public void setEmergencyEvent(Boolean emergencyEvent) {
+ public GetVehicleData setEmergencyEvent( Boolean emergencyEvent) {
setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ return this;
}
public Boolean getEmergencyEvent() {
return getBoolean(KEY_EMERGENCY_EVENT);
}
- public void setClusterModeStatus(Boolean clusterModeStatus) {
+ public GetVehicleData setClusterModeStatus( Boolean clusterModeStatus) {
setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ return this;
}
public Boolean getClusterModeStatus() {
return getBoolean(KEY_CLUSTER_MODE_STATUS);
}
- public void setMyKey(Boolean myKey) {
+ public GetVehicleData setMyKey( Boolean myKey) {
setParameters(KEY_MY_KEY, myKey);
+ return this;
}
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); }
+ public GetVehicleData setTurnSignal( Boolean turnSignal) {
+ setParameters(KEY_TURN_SIGNAL, turnSignal);
+ return this;
+ }
/**
* Gets a boolean value. If true, means the turnSignal data has been subscribed.
@@ -544,8 +609,9 @@ public class GetVehicleData extends RPCRequest {
* Sets a boolean value. If true, subscribes electronicParkBrakeStatus data
* @param electronicParkBrakeStatus a boolean value
*/
- public void setElectronicParkBrakeStatus(Boolean electronicParkBrakeStatus){
+ public GetVehicleData setElectronicParkBrakeStatus( Boolean electronicParkBrakeStatus) {
setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ return this;
}
/**
@@ -560,8 +626,9 @@ public class GetVehicleData extends RPCRequest {
* Sets a boolean value. If true, gets the cloudAppVehicleID data
* @param cloudAppVehicleID a boolean value
*/
- public void setCloudAppVehicleID(boolean cloudAppVehicleID){
+ public GetVehicleData setCloudAppVehicleID( boolean cloudAppVehicleID) {
setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ return this;
}
/**
@@ -577,8 +644,9 @@ public class GetVehicleData extends RPCRequest {
* @param vehicleDataName a String value
* @param vehicleDataState a boolean value
*/
- public void setOEMCustomVehicleData(String vehicleDataName, Boolean vehicleDataState){
+ public GetVehicleData setOEMCustomVehicleData( String vehicleDataName, Boolean vehicleDataState) {
setParameters(vehicleDataName, vehicleDataState);
+ return this;
}
/**
@@ -595,8 +663,9 @@ public class GetVehicleData extends RPCRequest {
* @param windowStatus See WindowStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setWindowStatus(Boolean windowStatus) {
+ public GetVehicleData setWindowStatus( Boolean windowStatus) {
setParameters(KEY_WINDOW_STATUS, windowStatus);
+ return this;
}
/**
@@ -615,8 +684,9 @@ public class GetVehicleData extends RPCRequest {
* @param handsOffSteering To indicate whether driver hands are off the steering wheel
* @since SmartDeviceLink 7.0.0
*/
- public void setHandsOffSteering(Boolean handsOffSteering) {
+ public GetVehicleData setHandsOffSteering( Boolean handsOffSteering) {
setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
+ return this;
}
/**
@@ -635,8 +705,9 @@ public class GetVehicleData extends RPCRequest {
* @param gearStatus See GearStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setGearStatus(Boolean gearStatus) {
+ public GetVehicleData setGearStatus( Boolean gearStatus) {
setParameters(KEY_GEAR_STATUS, gearStatus);
+ return this;
}
/**
@@ -648,4 +719,25 @@ public class GetVehicleData extends RPCRequest {
public Boolean getGearStatus() {
return getBoolean(KEY_GEAR_STATUS);
}
+
+ /**
+ * Sets the stabilityControlsStatus.
+ *
+ * @param stabilityControlsStatus See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public GetVehicleData setStabilityControlsStatus( Boolean stabilityControlsStatus) {
+ setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
+ return this;
+ }
+
+ /**
+ * Gets the stabilityControlsStatus.
+ *
+ * @return Boolean See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public Boolean getStabilityControlsStatus() {
+ return getBoolean(KEY_STABILITY_CONTROLS_STATUS);
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java
index 1226baa45..fc1abcf53 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java
@@ -54,39 +54,48 @@ import java.util.List;
* @since SmartDeviceLink 2.0
*/
public class GetVehicleDataResponse extends RPCResponse {
+ public static final String KEY_GPS = "gps";
public static final String KEY_SPEED = "speed";
public static final String KEY_RPM = "rpm";
- public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
+ /**
+ * @deprecated
+ */
+ @Deprecated
public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_INSTANT_FUEL_CONSUMPTION = "instantFuelConsumption";
+ public static final String KEY_FUEL_RANGE = "fuelRange";
+ public static final String KEY_EXTERNAL_TEMPERATURE = "externalTemperature";
+ public static final String KEY_TURN_SIGNAL = "turnSignal";
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_ENGINE_TORQUE = "engineTorque";
public static final String KEY_ACC_PEDAL_POSITION = "accPedalPosition";
public static final String KEY_STEERING_WHEEL_ANGLE = "steeringWheelAngle";
+ public static final String KEY_ENGINE_OIL_LIFE = "engineOilLife";
+ public static final String KEY_ELECTRONIC_PARK_BRAKE_STATUS = "electronicParkBrakeStatus";
+ public static final String KEY_CLOUD_APP_VEHICLE_ID = "cloudAppVehicleID";
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 static final String KEY_WINDOW_STATUS = "windowStatus";
public static final String KEY_GEAR_STATUS = "gearStatus";
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
+ public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
/**
* Constructs a new GetVehicleDataResponse object
@@ -108,55 +117,91 @@ public class GetVehicleDataResponse extends RPCResponse {
setSuccess(success);
setResultCode(resultCode);
}
- public void setGps(GPSData gps) {
+ public GetVehicleDataResponse setGps( GPSData gps) {
setParameters(KEY_GPS, gps);
+ return this;
}
- @SuppressWarnings("unchecked")
public GPSData getGps() {
return (GPSData) getObject(GPSData.class, KEY_GPS);
}
- public void setSpeed(Double speed) {
+ public GetVehicleDataResponse setSpeed( Double speed) {
setParameters(KEY_SPEED, speed);
+ return this;
}
public Double getSpeed() {
Object object = getParameters(KEY_SPEED);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setRpm(Integer rpm) {
+ public GetVehicleDataResponse setRpm( Integer rpm) {
setParameters(KEY_RPM, rpm);
+ return this;
}
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);
- }
- public void setFuelLevelState(ComponentVolumeStatus fuelLevelState) {
+
+ /**
+ * Sets Fuel Level State
+ * @param fuelLevelState a ComponentVolumeStatus related to FuelLevel State
+ */
+ @Deprecated
+ public GetVehicleDataResponse setFuelLevelState( ComponentVolumeStatus fuelLevelState) {
setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ return this;
}
+ /**
+ * Gets Fuel Level State
+ * @return a ComponentVolumeStatus related to FuelLevel State
+ */
+ @Deprecated
public ComponentVolumeStatus getFuelLevelState() {
return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_FUEL_LEVEL_STATE);
}
- public void setInstantFuelConsumption(Double instantFuelConsumption) {
+
+ /**
+ * Sets the fuelLevel.
+ *
+ * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
+ * @since SmartDeviceLink 7.0.0
+ */
+ @Deprecated
+ public GetVehicleDataResponse setFuelLevel( Double fuelLevel) {
+ setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ return this;
+ }
+
+ /**
+ * Gets the fuelLevel.
+ *
+ * @return Double The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
+ * @since SmartDeviceLink 7.0.0
+ */
+ @Deprecated
+ public Double getFuelLevel() {
+ Object object = getParameters(KEY_FUEL_LEVEL);
+ return SdlDataTypeConverter.objectToDouble(object);
+ }
+ public GetVehicleDataResponse setInstantFuelConsumption( Double instantFuelConsumption) {
setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ return this;
}
public Double getInstantFuelConsumption() {
Object object = getParameters(KEY_INSTANT_FUEL_CONSUMPTION);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setExternalTemperature(Double externalTemperature) {
+ public GetVehicleDataResponse setExternalTemperature( Double externalTemperature) {
setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ return this;
}
public Double getExternalTemperature() {
Object object = getParameters(KEY_EXTERNAL_TEMPERATURE);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setVin(String vin) {
+ public GetVehicleDataResponse setVin( String vin) {
setParameters(KEY_VIN, vin);
+ return this;
}
public String getVin() {
return getString(KEY_VIN);
@@ -169,8 +214,9 @@ public class GetVehicleDataResponse extends RPCResponse {
* @deprecated in SmartDeviceLink 7.0.0
*/
@Deprecated
- public void setPrndl(PRNDL prndl) {
+ public GetVehicleDataResponse setPrndl( PRNDL prndl) {
setParameters(KEY_PRNDL, prndl);
+ return this;
}
/**
@@ -183,125 +229,132 @@ public class GetVehicleDataResponse extends RPCResponse {
public PRNDL getPrndl() {
return (PRNDL) getObject(PRNDL.class, KEY_PRNDL);
}
- public void setTirePressure(TireStatus tirePressure) {
+ public GetVehicleDataResponse setTirePressure( TireStatus tirePressure) {
setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ return this;
}
- @SuppressWarnings("unchecked")
public TireStatus getTirePressure() {
return (TireStatus) getObject(TireStatus.class, KEY_TIRE_PRESSURE);
}
- public void setOdometer(Integer odometer) {
+ public GetVehicleDataResponse setOdometer( Integer odometer) {
setParameters(KEY_ODOMETER, odometer);
+ return this;
}
public Integer getOdometer() {
return getInteger(KEY_ODOMETER);
}
- public void setBeltStatus(BeltStatus beltStatus) {
+ public GetVehicleDataResponse setBeltStatus( BeltStatus beltStatus) {
setParameters(KEY_BELT_STATUS, beltStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public BeltStatus getBeltStatus() {
return (BeltStatus) getObject(BeltStatus.class, KEY_BELT_STATUS);
}
- public void setBodyInformation(BodyInformation bodyInformation) {
+ public GetVehicleDataResponse setBodyInformation( BodyInformation bodyInformation) {
setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ return this;
}
- @SuppressWarnings("unchecked")
public BodyInformation getBodyInformation() {
return (BodyInformation) getObject(BodyInformation.class, KEY_BODY_INFORMATION);
}
- public void setDeviceStatus(DeviceStatus deviceStatus) {
+ public GetVehicleDataResponse setDeviceStatus( DeviceStatus deviceStatus) {
setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public DeviceStatus getDeviceStatus() {
return (DeviceStatus) getObject(DeviceStatus.class, KEY_DEVICE_STATUS);
}
- public void setDriverBraking(VehicleDataEventStatus driverBraking) {
+ public GetVehicleDataResponse setDriverBraking( VehicleDataEventStatus driverBraking) {
setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ return this;
}
public VehicleDataEventStatus getDriverBraking() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BRAKING);
}
- public void setWiperStatus(WiperStatus wiperStatus) {
+ public GetVehicleDataResponse setWiperStatus( WiperStatus wiperStatus) {
setParameters(KEY_WIPER_STATUS, wiperStatus);
+ return this;
}
public WiperStatus getWiperStatus() {
return (WiperStatus) getObject(WiperStatus.class, KEY_WIPER_STATUS);
}
- public void setHeadLampStatus(HeadLampStatus headLampStatus) {
+ public GetVehicleDataResponse setHeadLampStatus( HeadLampStatus headLampStatus) {
setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public HeadLampStatus getHeadLampStatus() {
return (HeadLampStatus) getObject(HeadLampStatus.class, KEY_HEAD_LAMP_STATUS);
}
- public void setEngineTorque(Double engineTorque) {
+ public GetVehicleDataResponse setEngineTorque( Double engineTorque) {
setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ return this;
}
public Double getEngineTorque() {
Object object = getParameters(KEY_ENGINE_TORQUE);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setEngineOilLife(Float engineOilLife) {
+ public GetVehicleDataResponse setEngineOilLife( Float engineOilLife) {
setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ return this;
}
public Float getEngineOilLife() {
Object object = getParameters(KEY_ENGINE_OIL_LIFE);
return SdlDataTypeConverter.objectToFloat(object);
}
- public void setAccPedalPosition(Double accPedalPosition) {
+ public GetVehicleDataResponse setAccPedalPosition( Double accPedalPosition) {
setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ return this;
}
public Double getAccPedalPosition() {
Object object = getParameters(KEY_ACC_PEDAL_POSITION);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setSteeringWheelAngle(Double steeringWheelAngle) {
+ public GetVehicleDataResponse setSteeringWheelAngle( Double steeringWheelAngle) {
setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ return this;
}
public Double getSteeringWheelAngle() {
Object object = getParameters(KEY_STEERING_WHEEL_ANGLE);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setECallInfo(ECallInfo eCallInfo) {
+ public GetVehicleDataResponse setECallInfo( ECallInfo eCallInfo) {
setParameters(KEY_E_CALL_INFO, eCallInfo);
+ return this;
}
- @SuppressWarnings("unchecked")
public ECallInfo getECallInfo() {
return (ECallInfo) getObject(ECallInfo.class, KEY_E_CALL_INFO);
}
- public void setAirbagStatus(AirbagStatus airbagStatus) {
+ public GetVehicleDataResponse setAirbagStatus( AirbagStatus airbagStatus) {
setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public AirbagStatus getAirbagStatus() {
return (AirbagStatus) getObject(AirbagStatus.class, KEY_AIRBAG_STATUS);
}
- public void setEmergencyEvent(EmergencyEvent emergencyEvent) {
+ public GetVehicleDataResponse setEmergencyEvent( EmergencyEvent emergencyEvent) {
setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ return this;
}
- @SuppressWarnings("unchecked")
public EmergencyEvent getEmergencyEvent() {
return (EmergencyEvent) getObject(EmergencyEvent.class, KEY_EMERGENCY_EVENT);
}
- public void setClusterModeStatus(ClusterModeStatus clusterModeStatus) {
+ public GetVehicleDataResponse setClusterModeStatus( ClusterModeStatus clusterModeStatus) {
setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public ClusterModeStatus getClusterModeStatus() {
return (ClusterModeStatus) getObject(ClusterModeStatus.class, KEY_CLUSTER_MODE_STATUS);
}
- public void setMyKey(MyKey myKey) {
+ public GetVehicleDataResponse setMyKey( MyKey myKey) {
setParameters(KEY_MY_KEY, myKey);
+ return this;
}
- @SuppressWarnings("unchecked")
public MyKey getMyKey() {
return (MyKey) getObject(MyKey.class, KEY_MY_KEY);
}
@@ -310,11 +363,12 @@ public class GetVehicleDataResponse extends RPCResponse {
* 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 FuelRange
* @see com.smartdevicelink.proxy.rpc.enums.FuelType
*/
- public void setFuelRange(List<FuelRange> fuelRange) {
+ public GetVehicleDataResponse setFuelRange( List<FuelRange> fuelRange) {
setParameters(KEY_FUEL_RANGE, fuelRange);
+ return this;
}
/**
@@ -331,10 +385,11 @@ public class GetVehicleDataResponse extends RPCResponse {
* Sets turnSignal
* @param turnSignal status of the turn signals
*
- * @see com.smartdevicelink.proxy.rpc.enums.TurnSignal
+ * @see TurnSignal
*/
- public void setTurnSignal(TurnSignal turnSignal) {
+ public GetVehicleDataResponse setTurnSignal( TurnSignal turnSignal) {
setParameters(KEY_TURN_SIGNAL, turnSignal);
+ return this;
}
/**
@@ -343,7 +398,6 @@ public class GetVehicleDataResponse extends RPCResponse {
*
* @see com.smartdevicelink.proxy.rpc.enums.TurnSignal
*/
- @SuppressWarnings("unchecked")
public TurnSignal getTurnSignal() {
return (TurnSignal) getObject(TurnSignal.class, KEY_TURN_SIGNAL);
}
@@ -352,10 +406,11 @@ public class GetVehicleDataResponse extends RPCResponse {
* Sets electronicParkBrakeStatus
* @param electronicParkBrakeStatus status of the electronic park brake of the connected vehicle
*
- * @see com.smartdevicelink.proxy.rpc.enums.ElectronicParkBrakeStatus
+ * @see ElectronicParkBrakeStatus
*/
- public void setElectronicParkBrakeStatus(ElectronicParkBrakeStatus electronicParkBrakeStatus){
+ public GetVehicleDataResponse setElectronicParkBrakeStatus( ElectronicParkBrakeStatus electronicParkBrakeStatus) {
setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ return this;
}
/**
@@ -372,8 +427,9 @@ public class GetVehicleDataResponse extends RPCResponse {
* Sets a string value for the cloud app vehicle ID
* @param cloudAppVehicleID a string value
*/
- public void setCloudAppVehicleID(String cloudAppVehicleID){
+ public GetVehicleDataResponse setCloudAppVehicleID( String cloudAppVehicleID) {
setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ return this;
}
/**
@@ -390,8 +446,9 @@ public class GetVehicleDataResponse extends RPCResponse {
* @param vehicleDataName a String value
* @param vehicleDataState a VehicleDataResult value
*/
- public void setOEMCustomVehicleData(String vehicleDataName, Object vehicleDataState){
+ public GetVehicleDataResponse setOEMCustomVehicleData( String vehicleDataName, Object vehicleDataState) {
setParameters(vehicleDataName, vehicleDataState);
+ return this;
}
/**
@@ -408,8 +465,9 @@ public class GetVehicleDataResponse extends RPCResponse {
* @param windowStatus See WindowStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setWindowStatus(List<WindowStatus> windowStatus) {
+ public GetVehicleDataResponse setWindowStatus( List<WindowStatus> windowStatus) {
setParameters(KEY_WINDOW_STATUS, windowStatus);
+ return this;
}
/**
@@ -429,8 +487,9 @@ public class GetVehicleDataResponse extends RPCResponse {
* @param handsOffSteering To indicate whether driver hands are off the steering wheel
* @since SmartDeviceLink 7.0.0
*/
- public void setHandsOffSteering(Boolean handsOffSteering) {
+ public GetVehicleDataResponse setHandsOffSteering( Boolean handsOffSteering) {
setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
+ return this;
}
/**
@@ -449,8 +508,9 @@ public class GetVehicleDataResponse extends RPCResponse {
* @param gearStatus See GearStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setGearStatus(GearStatus gearStatus) {
+ public GetVehicleDataResponse setGearStatus( GearStatus gearStatus) {
setParameters(KEY_GEAR_STATUS, gearStatus);
+ return this;
}
/**
@@ -462,4 +522,25 @@ public class GetVehicleDataResponse extends RPCResponse {
public GearStatus getGearStatus() {
return (GearStatus) getObject(GearStatus.class, KEY_GEAR_STATUS);
}
+
+ /**
+ * Gets the stabilityControlsStatus.
+ *
+ * @return StabilityControlsStatus See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public StabilityControlsStatus getStabilityControlsStatus() {
+ return (StabilityControlsStatus) getObject(StabilityControlsStatus.class, KEY_STABILITY_CONTROLS_STATUS);
+ }
+
+ /**
+ * Sets the stabilityControlsStatus.
+ *
+ * @param stabilityControlsStatus See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public GetVehicleDataResponse setStabilityControlsStatus( StabilityControlsStatus stabilityControlsStatus) {
+ setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java
index 2146e3933..6ad9518e9 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java
@@ -59,7 +59,8 @@ public class GetWayPoints extends RPCRequest {
return (WayPointType) getObject(WayPointType.class, KEY_WAY_POINT_TYPE);
}
- public void setWayPointType(@NonNull WayPointType wayPointType) {
+ public GetWayPoints setWayPointType(@NonNull WayPointType wayPointType) {
setParameters(KEY_WAY_POINT_TYPE, wayPointType);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java
index 7a4924dea..cb7b99be3 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java
@@ -59,8 +59,9 @@ public class GetWayPointsResponse extends RPCResponse {
setSuccess(success);
setResultCode(resultCode);
}
- public void setWayPoints(List<LocationDetails> wayPoints) {
- setParameters(KEY_WAY_POINTS, wayPoints);
+ public GetWayPointsResponse setWayPoints( List<LocationDetails> wayPoints) {
+ setParameters(KEY_WAY_POINTS, wayPoints);
+ return this;
}
@SuppressWarnings("unchecked")
public List<LocationDetails> getWayPoints() {
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Grid.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Grid.java
index e0c93369d..861c1a433 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Grid.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Grid.java
@@ -39,8 +39,9 @@ public class Grid extends RPCStruct {
* Sets the column of this Grid
* @param col the column to be set
*/
- public void setCol(@NonNull Integer col) {
+ public Grid setCol(@NonNull Integer col) {
setValue(KEY_COL, col);
+ return this;
}
/**
@@ -55,8 +56,9 @@ public class Grid extends RPCStruct {
* Sets the row's value of this Grid
* @param row the row to be set
*/
- public void setRow(@NonNull Integer row) {
+ public Grid setRow(@NonNull Integer row) {
setValue(KEY_ROW, row);
+ return this;
}
/**
@@ -71,8 +73,9 @@ public class Grid extends RPCStruct {
* Sets the level value of this Grid
* @param level the level to be set
*/
- public void setLevel(Integer level) {
+ public Grid setLevel( Integer level) {
setValue(KEY_LEVEL, level);
+ return this;
}
/**
@@ -87,8 +90,9 @@ public class Grid extends RPCStruct {
* Sets the column span of this Grid
* @param span the span to be set
*/
- public void setColSpan(Integer span) {
+ public Grid setColSpan( Integer span) {
setValue(KEY_COL_SPAN, span);
+ return this;
}
/**
@@ -103,8 +107,9 @@ public class Grid extends RPCStruct {
* Sets the row span of this Grid
* @param span the span to be set
*/
- public void setRowSpan(Integer span) {
+ public Grid setRowSpan( Integer span) {
setValue(KEY_ROW_SPAN, span);
+ return this;
}
/**
@@ -119,8 +124,9 @@ public class Grid extends RPCStruct {
* Sets the level span of this Grid
* @param span the span to be set
*/
- public void setLevelSpan(Integer span) {
+ public Grid setLevelSpan( Integer span) {
setValue(KEY_LEVEL_SPAN, span);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java
index f1b3c4821..0762b42ed 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMICapabilities.java
@@ -59,9 +59,10 @@ public class HMICapabilities extends RPCStruct{
return (Boolean)available;
}
- public void setNavigationAvilable(Boolean available){
- setValue(KEY_NAVIGATION, available);
- }
+ public HMICapabilities setNavigationAvilable( Boolean available) {
+ setValue(KEY_NAVIGATION, available);
+ return this;
+ }
public boolean isPhoneCallAvailable(){
Object available = getValue(KEY_PHONE_CALL);
@@ -71,9 +72,10 @@ public class HMICapabilities extends RPCStruct{
return (Boolean)available;
}
- public void setPhoneCallAvilable(Boolean available){
- setValue(KEY_PHONE_CALL, available);
- }
+ public HMICapabilities setPhoneCallAvilable( Boolean available) {
+ setValue(KEY_PHONE_CALL, available);
+ return this;
+ }
public boolean isVideoStreamingAvailable(){
Object available = getValue(KEY_VIDEO_STREAMING);
@@ -83,9 +85,10 @@ public class HMICapabilities extends RPCStruct{
return (Boolean)available;
}
- public void setVideoStreamingAvailable(Boolean available){
- setValue(KEY_VIDEO_STREAMING, available);
- }
+ public HMICapabilities setVideoStreamingAvailable( Boolean available) {
+ setValue(KEY_VIDEO_STREAMING, available);
+ return this;
+ }
public boolean isRemoteControlAvailable(){
Object available = getValue(KEY_REMOTE_CONTROL);
@@ -95,9 +98,10 @@ public class HMICapabilities extends RPCStruct{
return (Boolean)available;
}
- public void setRemoteControlAvailable(Boolean available){
- setValue(KEY_REMOTE_CONTROL, available);
- }
+ public HMICapabilities setRemoteControlAvailable( Boolean available) {
+ setValue(KEY_REMOTE_CONTROL, available);
+ return this;
+ }
public boolean isAppServicesAvailable(){
Object available = getValue(KEY_APP_SERVICES);
@@ -107,9 +111,10 @@ public class HMICapabilities extends RPCStruct{
return (Boolean)available;
}
- public void setAppServicesAvailable(Boolean available){
- setValue(KEY_APP_SERVICES, available);
- }
+ public HMICapabilities setAppServicesAvailable( Boolean available) {
+ setValue(KEY_APP_SERVICES, available);
+ return this;
+ }
public boolean isDisplaysCapabilityAvailable(){
Object available = getValue(KEY_DISPLAYS);
@@ -119,9 +124,10 @@ public class HMICapabilities extends RPCStruct{
return (Boolean)available;
}
- public void setDisplaysCapabilityAvailable(Boolean available){
- setValue(KEY_DISPLAYS, available);
- }
+ public HMICapabilities setDisplaysCapabilityAvailable( Boolean available) {
+ setValue(KEY_DISPLAYS, available);
+ return this;
+ }
public boolean isSeatLocationAvailable(){
Object available = getValue(KEY_SEAT_LOCATION);
@@ -131,9 +137,10 @@ public class HMICapabilities extends RPCStruct{
return (Boolean)available;
}
- public void setSeatLocationAvailable(Boolean available){
- setValue(KEY_SEAT_LOCATION, available);
- }
+ public HMICapabilities setSeatLocationAvailable( Boolean available) {
+ setValue(KEY_SEAT_LOCATION, available);
+ return this;
+ }
/**
* Sets the driverDistraction.
@@ -141,8 +148,9 @@ public class HMICapabilities extends RPCStruct{
* @param driverDistraction Availability of driver distraction capability. True: Available, False: Not Available
* @since SmartDeviceLink 7.0.0
*/
- public void setDriverDistraction(Boolean driverDistraction) {
+ public HMICapabilities setDriverDistraction( Boolean driverDistraction) {
setValue(KEY_DRIVER_DISTRACTION, driverDistraction);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java
index 68a84d451..5d5237b12 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -112,8 +112,9 @@ public class HMIPermissions extends RPCStruct {
* 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);
+ public HMIPermissions setAllowed(@NonNull List<HMILevel> allowed) {
+ setValue(KEY_ALLOWED, allowed);
+ return this;
}
/**
@@ -129,7 +130,8 @@ public class HMIPermissions extends RPCStruct {
* 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);
+ public HMIPermissions setUserDisallowed(@NonNull List<HMILevel> userDisallowed) {
+ setValue(KEY_USER_DISALLOWED, userDisallowed);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java
index d62b646ba..36ef9c12c 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlCapabilities.java
@@ -70,9 +70,10 @@ public class HMISettingsControlCapabilities extends RPCStruct {
*
* @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);
- }
+ public HMISettingsControlCapabilities setModuleName(@NonNull String moduleName) {
+ setValue(KEY_MODULE_NAME, moduleName);
+ return this;
+ }
/**
* Gets the moduleName portion of the HMISettingsControlCapabilities class
@@ -88,9 +89,10 @@ public class HMISettingsControlCapabilities extends RPCStruct {
*
* @param distanceUnitAvailable Availability of the control of distance unit.
*/
- public void setDistanceUnitAvailable(Boolean distanceUnitAvailable) {
- setValue(KEY_DISTANCE_UNIT_AVAILABLE, distanceUnitAvailable);
- }
+ public HMISettingsControlCapabilities setDistanceUnitAvailable( Boolean distanceUnitAvailable) {
+ setValue(KEY_DISTANCE_UNIT_AVAILABLE, distanceUnitAvailable);
+ return this;
+ }
/**
* Gets the distanceUnitAvailable portion of the HMISettingsControlCapabilities class
@@ -106,9 +108,10 @@ public class HMISettingsControlCapabilities extends RPCStruct {
*
* @param temperatureUnitAvailable Availability of the control of temperature unit.
*/
- public void setTemperatureUnitAvailable(Boolean temperatureUnitAvailable) {
- setValue(KEY_TEMPERATURE_UNIT_AVAILABLE, temperatureUnitAvailable);
- }
+ public HMISettingsControlCapabilities setTemperatureUnitAvailable( Boolean temperatureUnitAvailable) {
+ setValue(KEY_TEMPERATURE_UNIT_AVAILABLE, temperatureUnitAvailable);
+ return this;
+ }
/**
* Gets the temperatureUnitAvailable portion of the HMISettingsControlCapabilities class
@@ -124,9 +127,10 @@ public class HMISettingsControlCapabilities extends RPCStruct {
*
* @param displayModeUnitAvailable Availability of the control of HMI display mode.
*/
- public void setDisplayModeUnitAvailable(Boolean displayModeUnitAvailable) {
- setValue(KEY_DISPLAY_MODE_UNIT_AVAILABLE, displayModeUnitAvailable);
- }
+ public HMISettingsControlCapabilities setDisplayModeUnitAvailable( Boolean displayModeUnitAvailable) {
+ setValue(KEY_DISPLAY_MODE_UNIT_AVAILABLE, displayModeUnitAvailable);
+ return this;
+ }
/**
* Gets the displayModeUnitAvailable portion of the HMISettingsControlCapabilities class
@@ -141,9 +145,10 @@ public class HMISettingsControlCapabilities extends RPCStruct {
* Sets ModuleInfo for this capability
* @param info the ModuleInfo to be set
*/
- public void setModuleInfo(ModuleInfo info) {
- setValue(KEY_MODULE_INFO, info);
- }
+ public HMISettingsControlCapabilities setModuleInfo( ModuleInfo info) {
+ setValue(KEY_MODULE_INFO, info);
+ return this;
+ }
/**
* Gets a ModuleInfo of this capability
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java
index 6030e712a..05dda0de2 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HMISettingsControlData.java
@@ -59,11 +59,12 @@ public class HMISettingsControlData extends RPCStruct {
*
* @param displayMode the display mode (DAY, NIGHT, AUTO) of screen on the respective module
*
- * @see com.smartdevicelink.proxy.rpc.enums.DisplayMode
+ * @see DisplayMode
*/
- public void setDisplayMode(DisplayMode displayMode) {
- setValue(KEY_DISPLAY_MODE, displayMode);
- }
+ public HMISettingsControlData setDisplayMode( DisplayMode displayMode) {
+ setValue(KEY_DISPLAY_MODE, displayMode);
+ return this;
+ }
/**
* Gets the displayMode portion of the HMISettingsControlData class
@@ -81,11 +82,12 @@ public class HMISettingsControlData extends RPCStruct {
*
* @param temperatureUnit enum value of temperature unit associated with the display of the current module
*
- * @see com.smartdevicelink.proxy.rpc.enums.TemperatureUnit
+ * @see TemperatureUnit
*/
- public void setTemperatureUnit(TemperatureUnit temperatureUnit) {
- setValue(KEY_TEMPERATURE_UNIT, temperatureUnit);
- }
+ public HMISettingsControlData setTemperatureUnit( TemperatureUnit temperatureUnit) {
+ setValue(KEY_TEMPERATURE_UNIT, temperatureUnit);
+ return this;
+ }
/**
* Gets the temperatureUnit portion of the HMISettingsControlData class
@@ -103,11 +105,12 @@ public class HMISettingsControlData extends RPCStruct {
*
* @param distanceUnit enum value of distance unit associated with the display of the current module
*
- * @see com.smartdevicelink.proxy.rpc.enums.DistanceUnit
+ * @see DistanceUnit
*/
- public void setDistanceUnit(DistanceUnit distanceUnit) {
- setValue(KEY_DISTANCE_UNIT, distanceUnit);
- }
+ public HMISettingsControlData setDistanceUnit( DistanceUnit distanceUnit) {
+ setValue(KEY_DISTANCE_UNIT, distanceUnit);
+ return this;
+ }
/**
* Gets the distanceUnit portion of the HMISettingsControlData class
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java
index c4458e547..a50c2d37b 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java
@@ -62,9 +62,10 @@ public class HapticRect extends RPCStruct {
/**
* Set a user control spatial identifier that references the supplied spatial data
*/
- public void setId(@NonNull Integer id) {
- setValue(KEY_ID, id);
- }
+ public HapticRect setId(@NonNull Integer id) {
+ setValue(KEY_ID, id);
+ return this;
+ }
/**
* @return a user control spatial identifier that references the supplied spatial data
@@ -76,9 +77,10 @@ public class HapticRect extends RPCStruct {
/**
* Set the position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.
*/
- public void setRect(@NonNull Rectangle rect) {
- setValue(KEY_RECT, rect);
- }
+ public HapticRect setRect(@NonNull Rectangle rect) {
+ setValue(KEY_RECT, rect);
+ return this;
+ }
/**
* @return the position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs.
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java
index abd0f10e0..693219fe0 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -98,20 +98,23 @@ public class HeadLampStatus extends RPCStruct {
setLowBeamsOn(lowBeamsOn);
setHighBeamsOn(highBeamsOn);
}
- public void setAmbientLightStatus(AmbientLightStatus ambientLightSensorStatus) {
+ public HeadLampStatus setAmbientLightStatus( AmbientLightStatus ambientLightSensorStatus) {
setValue(KEY_AMBIENT_LIGHT_SENSOR_STATUS, ambientLightSensorStatus);
+ return this;
}
public AmbientLightStatus getAmbientLightStatus() {
return (AmbientLightStatus) getObject(AmbientLightStatus.class, KEY_AMBIENT_LIGHT_SENSOR_STATUS);
}
- public void setHighBeamsOn(@NonNull Boolean highBeamsOn) {
+ public HeadLampStatus setHighBeamsOn(@NonNull Boolean highBeamsOn) {
setValue(KEY_HIGH_BEAMS_ON, highBeamsOn);
+ return this;
}
public Boolean getHighBeamsOn() {
return getBoolean(KEY_HIGH_BEAMS_ON);
}
- public void setLowBeamsOn(@NonNull Boolean lowBeamsOn) {
+ public HeadLampStatus setLowBeamsOn(@NonNull Boolean lowBeamsOn) {
setValue(KEY_LOW_BEAMS_ON, lowBeamsOn);
+ return this;
}
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
index 845f4649f..f8eed013b 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Headers.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Headers.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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;
@@ -67,48 +67,54 @@ public class Headers extends RPCStruct {
super(hash);
}
- public void setContentType(String contenttype) {
- setValue(KEY_CONTENT_TYPE, contenttype);
+ public Headers setContentType( String contentType) {
+ setValue(KEY_CONTENT_TYPE, contentType);
+ return this;
}
public String getContentType() {
return getString(KEY_CONTENT_TYPE);
}
- public void setConnectTimeout(Integer connectiontimeout) {
- setValue(KEY_CONNECT_TIMEOUT, connectiontimeout);
+ public Headers setConnectTimeout( Integer connectionTimeout) {
+ setValue(KEY_CONNECT_TIMEOUT, connectionTimeout);
+ return this;
}
public Integer getConnectTimeout() {
return getInteger(KEY_CONNECT_TIMEOUT);
}
- public void setDoOutput(Boolean dooutput) {
- setValue(KEY_DO_OUTPUT, dooutput);
+ public Headers setDoOutput( Boolean doOutput) {
+ setValue(KEY_DO_OUTPUT, doOutput);
+ return this;
}
public Boolean getDoOutput() {
return getBoolean(KEY_DO_OUTPUT);
}
- public void setDoInput(Boolean doinput) {
- setValue(KEY_DO_INPUT, doinput);
+ public Headers setDoInput( Boolean doInput) {
+ setValue(KEY_DO_INPUT, doInput);
+ return this;
}
public Boolean getDoInput() {
return getBoolean(KEY_DO_INPUT);
}
- public void setUseCaches(Boolean usescaches) {
- setValue(KEY_USE_CACHES, usescaches);
+ public Headers setUseCaches( Boolean usesCaches) {
+ setValue(KEY_USE_CACHES, usesCaches);
+ return this;
}
public Boolean getUseCaches() {
return getBoolean(KEY_USE_CACHES);
}
- public void setRequestMethod(String requestmethod) {
- setValue(KEY_REQUEST_METHOD, requestmethod);
+ public Headers setRequestMethod( String requestMethod) {
+ setValue(KEY_REQUEST_METHOD, requestMethod);
+ return this;
}
public String getRequestMethod() {
@@ -116,32 +122,36 @@ public class Headers extends RPCStruct {
}
- public void setReadTimeout(Integer readtimeout) {
- setValue(KEY_READ_TIMEOUT, readtimeout);
+ public Headers setReadTimeout( Integer readTimeout) {
+ setValue(KEY_READ_TIMEOUT, readTimeout);
+ return this;
}
public Integer getReadTimeout() {
return getInteger(KEY_READ_TIMEOUT);
}
- public void setInstanceFollowRedirects(Boolean instancefollowredirects) {
- setValue(KEY_INSTANCE_FOLLOW_REDIRECTS, instancefollowredirects);
+ public Headers setInstanceFollowRedirects( Boolean instanceFollowRedirects) {
+ setValue(KEY_INSTANCE_FOLLOW_REDIRECTS, instanceFollowRedirects);
+ return this;
}
public Boolean getInstanceFollowRedirects() {
return getBoolean(KEY_INSTANCE_FOLLOW_REDIRECTS);
}
- public void setCharset(String charset) {
+ public Headers setCharset( String charset) {
setValue(KEY_CHARSET, charset);
+ return this;
}
public String getCharset() {
return getString(KEY_CHARSET);
}
- public void setContentLength(Integer contentlength) {
- setValue(KEY_CONTENT_LENGTH, contentlength);
+ public Headers setContentLength( Integer contentLength) {
+ setValue(KEY_CONTENT_LENGTH, contentLength);
+ return this;
}
public Integer getContentLength() {
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java
index ba9f25f5c..0cf1ef12a 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Image.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -39,7 +39,7 @@ 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.
+ *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>
@@ -101,8 +101,9 @@ public class Image extends RPCStruct {
* 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) {
+ public Image setValue(@NonNull String value) {
setValue(KEY_VALUE, value);
+ return this;
}
/**
@@ -117,8 +118,9 @@ public class Image extends RPCStruct {
* Set the image type (static or dynamic image)
* @param imageType whether it is a static or dynamic image
*/
- public void setImageType(@NonNull ImageType imageType) {
+ public Image setImageType(@NonNull ImageType imageType) {
setValue(KEY_IMAGE_TYPE, imageType);
+ return this;
}
/**
@@ -133,8 +135,9 @@ public class Image extends RPCStruct {
* 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){
+ public Image setIsTemplate( Boolean isTemplate) {
setValue(KEY_IS_TEMPLATE, isTemplate);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java
index de052a6f7..6fa2e3651 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -108,21 +108,23 @@ public class ImageField extends RPCStruct {
public ImageFieldName getName() {
return (ImageFieldName) getObject(ImageFieldName.class, KEY_NAME);
}
- public void setName(@NonNull ImageFieldName name ) {
+ public ImageField setName(@NonNull ImageFieldName name) {
setValue(KEY_NAME, name);
- }
+ return this;
+ }
@SuppressWarnings("unchecked")
public List<FileType> getImageTypeSupported() {
return (List<FileType>) getObject(FileType.class, KEY_IMAGE_TYPE_SUPPORTED);
}
- public void setImageTypeSupported(@NonNull List<FileType> imageTypeSupported ) {
+ public ImageField setImageTypeSupported(@NonNull List<FileType> imageTypeSupported) {
setValue(KEY_IMAGE_TYPE_SUPPORTED, imageTypeSupported);
+ return this;
}
- @SuppressWarnings("unchecked")
public ImageResolution getImageResolution() {
return (ImageResolution) getObject(ImageResolution.class, KEY_IMAGE_RESOLUTION);
}
- public void setImageResolution( ImageResolution imageResolution ) {
+ public ImageField setImageResolution( ImageResolution imageResolution) {
setValue(KEY_IMAGE_RESOLUTION, imageResolution);
- }
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java
index 66841c773..ab326ed06 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -101,11 +101,12 @@ public class ImageResolution extends RPCStruct {
* the Android H264 decoder, as a workaround the odd value is
* converted to a pair value.
*/
- public void setResolutionWidth(@NonNull Integer resolutionWidth) {
- if(resolutionWidth != null && resolutionWidth % 2 != 0) {
- resolutionWidth++;
- }
+ public ImageResolution setResolutionWidth(@NonNull Integer resolutionWidth) {
+ if(resolutionWidth != null && resolutionWidth % 2 != 0) {
+ resolutionWidth++;
+ }
setValue(KEY_RESOLUTION_WIDTH, resolutionWidth);
+ return this;
}
public Integer getResolutionWidth() {
@@ -117,11 +118,12 @@ public class ImageResolution extends RPCStruct {
* the Android H264 decoder, as a workaround the odd value is
* converted to a pair value.
*/
- public void setResolutionHeight(@NonNull Integer resolutionHeight) {
- if(resolutionHeight != null && resolutionHeight % 2 != 0) {
- resolutionHeight++;
- }
+ public ImageResolution setResolutionHeight(@NonNull Integer resolutionHeight) {
+ if(resolutionHeight != null && resolutionHeight % 2 != 0) {
+ resolutionHeight++;
+ }
setValue(KEY_RESOLUTION_HEIGHT, resolutionHeight);
+ return this;
}
public Integer getResolutionHeight() {
@@ -130,7 +132,7 @@ public class ImageResolution extends RPCStruct {
@Override
public String toString() {
- return "width=" + String.valueOf(getResolutionWidth()) +
- ", height=" + String.valueOf(getResolutionHeight());
+ return "width=" + getResolutionWidth() +
+ ", height=" + 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
index cd721fec8..1a182e732 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/KeyboardProperties.java
@@ -69,7 +69,7 @@ import java.util.List;
* <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>
+ * <td>In this mode, all key presses 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>
@@ -82,7 +82,7 @@ import java.util.List;
* <td>limitedCharacterList</td>
* <td>String</td>
* <td>false</td>
- * <td>Array = true maxlength = 1 minsize = 1 maxsize = 100</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>
*
@@ -131,16 +131,18 @@ public class KeyboardProperties extends RPCStruct {
return (Language) getObject(Language.class, KEY_LANGUAGE);
}
- public void setLanguage(Language language) {
+ public KeyboardProperties setLanguage( Language language) {
setValue(KEY_LANGUAGE, language);
+ return this;
}
public KeyboardLayout getKeyboardLayout() {
return (KeyboardLayout) getObject(KeyboardLayout.class, KEY_KEYBOARD_LAYOUT);
}
- public void setKeyboardLayout(KeyboardLayout keyboardLayout) {
+ public KeyboardProperties setKeyboardLayout( KeyboardLayout keyboardLayout) {
setValue(KEY_KEYBOARD_LAYOUT, keyboardLayout);
+ return this;
}
public KeypressMode getKeypressMode() {
@@ -151,12 +153,13 @@ public class KeyboardProperties extends RPCStruct {
return kp;
}
- public void setKeypressMode(KeypressMode keypressMode) {
+ public KeyboardProperties setKeypressMode( KeypressMode keypressMode) {
if (keypressMode != null) {
setValue(KEY_KEYPRESS_MODE, keypressMode);
} else {
setValue(KEY_KEYPRESS_MODE, KEYPRESS_MODE_DEFAULT);
}
+ return this;
}
@SuppressWarnings("unchecked")
@@ -164,8 +167,9 @@ public class KeyboardProperties extends RPCStruct {
return (List<String>) getObject(String.class, KEY_LIMITED_CHARACTER_LIST);
}
- public void setLimitedCharacterList(List<String> limitedCharacterList) {
+ public KeyboardProperties setLimitedCharacterList( List<String> limitedCharacterList) {
setValue(KEY_LIMITED_CHARACTER_LIST, limitedCharacterList);
+ return this;
}
/**
@@ -180,11 +184,11 @@ public class KeyboardProperties extends RPCStruct {
/**
* Sets the text that allows an app to prepopulate the text field with a suggested entry as the user types
* @param autoCompleteText String representing the suggestions text
- * @deprecated use {@link #setAutoCompleteList(List<String>)} instead
+ * @deprecated use {@link #setAutoCompleteList( List <String>)} instead
*/
- @Deprecated // Note: removing autoCompleteText setter will leave no way to provide auto complete suggestions on old head units that don't support autoCompleteList
- public void setAutoCompleteText(String autoCompleteText) {
+ @Deprecated public KeyboardProperties setAutoCompleteText( String autoCompleteText) {
setValue(KEY_AUTO_COMPLETE_TEXT, autoCompleteText);
+ return this;
}
/**
@@ -201,7 +205,8 @@ public class KeyboardProperties extends RPCStruct {
* completed entries as the user types. Set to an empty array to remove the auto-complete list from the screen
* @param autoCompleteList List<String> representing the suggestions list
*/
- public void setAutoCompleteList(List<String> autoCompleteList) {
+ public KeyboardProperties setAutoCompleteList( List<String> autoCompleteList) {
setValue(KEY_AUTO_COMPLETE_LIST, autoCompleteList);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java
index 6ecfca5c6..365e71543 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightCapabilities.java
@@ -75,11 +75,12 @@ public class LightCapabilities extends RPCStruct {
*
* @param name enum value of type LightName that describes the specific light
*
- * @see com.smartdevicelink.proxy.rpc.enums.LightName
+ * @see LightName
*/
- public void setName(@NonNull LightName name) {
- setValue(KEY_NAME, name);
- }
+ public LightCapabilities setName(@NonNull LightName name) {
+ setValue(KEY_NAME, name);
+ return this;
+ }
/**
* Gets the name portion of the LightCapabilities class
@@ -97,9 +98,10 @@ public class LightCapabilities extends RPCStruct {
*
* @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);
- }
+ public LightCapabilities setDensityAvailable( Boolean densityAvailable) {
+ setValue(KEY_DENSITY_AVAILABLE, densityAvailable);
+ return this;
+ }
/**
* Gets the densityAvailable portion of the LightCapabilities class
@@ -115,9 +117,10 @@ public class LightCapabilities extends RPCStruct {
*
* @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);
- }
+ public LightCapabilities setRGBColorSpaceAvailable( Boolean RGBColorSpaceAvailable) {
+ setValue(KEY_RGB_COLOR_SPACE_AVAILABLE, RGBColorSpaceAvailable);
+ return this;
+ }
/**
* Gets the RGBColorSpaceAvailable portion of the LightCapabilities class
@@ -133,9 +136,10 @@ public class LightCapabilities extends RPCStruct {
*
* @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);
- }
+ public LightCapabilities setStatusAvailable( Boolean statusAvailable) {
+ setValue(KEY_STATUS_AVAILABLE, statusAvailable);
+ return this;
+ }
/**
* Gets the statusAvailable portion of the LightCapabilities class
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java
index 3cc66e67e..979b0a0cf 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlCapabilities.java
@@ -76,9 +76,10 @@ public class LightControlCapabilities extends RPCStruct {
*
* @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);
- }
+ public LightControlCapabilities setModuleName(@NonNull String moduleName) {
+ setValue(KEY_MODULE_NAME, moduleName);
+ return this;
+ }
/**
* Gets the moduleName portion of the LightControlCapabilities class
@@ -104,17 +105,19 @@ public class LightControlCapabilities extends RPCStruct {
*
* @param supportedLights An array of available LightCapabilities that are controllable.
*/
- public void setSupportedLights(@NonNull List<LightCapabilities> supportedLights) {
- setValue(KEY_SUPPORTED_LIGHTS, supportedLights);
- }
+ public LightControlCapabilities setSupportedLights(@NonNull List<LightCapabilities> supportedLights) {
+ setValue(KEY_SUPPORTED_LIGHTS, supportedLights);
+ return this;
+ }
/**
* Sets ModuleInfo for this capability
* @param info the ModuleInfo to be set
*/
- public void setModuleInfo(ModuleInfo info) {
- setValue(KEY_MODULE_INFO, info);
- }
+ public LightControlCapabilities setModuleInfo( ModuleInfo info) {
+ setValue(KEY_MODULE_INFO, info);
+ return this;
+ }
/**
* Gets a ModuleInfo of this capability
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java
index 05bcb5fec..e40fd8c68 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightControlData.java
@@ -83,7 +83,8 @@ public class LightControlData extends RPCStruct {
*
* @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);
- }
+ public LightControlData setLightState(@NonNull List<LightState> lightState) {
+ setValue(KEY_LIGHT_STATE, lightState);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java
index 0676b50da..17ba11742 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LightState.java
@@ -79,9 +79,10 @@ public class LightState extends RPCStruct {
*
* @param id The name of a light or a group of lights.
*/
- public void setId(@NonNull LightName id) {
- setValue(KEY_ID, id);
- }
+ public LightState setId(@NonNull LightName id) {
+ setValue(KEY_ID, id);
+ return this;
+ }
/**
* Gets the id portion of the LightState class
@@ -97,11 +98,12 @@ public class LightState extends RPCStruct {
*
* @param status enum value of type LightStatus that describes the specific lights state
*
- * @see com.smartdevicelink.proxy.rpc.enums.LightStatus
+ * @see LightStatus
*/
- public void setStatus(@NonNull LightStatus status) {
- setValue(KEY_STATUS, status);
- }
+ public LightState setStatus(@NonNull LightStatus status) {
+ setValue(KEY_STATUS, status);
+ return this;
+ }
/**
* Gets the status portion of the LightState class
@@ -129,9 +131,10 @@ public class LightState extends RPCStruct {
*
* @param density a float representation of the density of the specific light state
*/
- public void setDensity(Float density) {
- setValue(KEY_DENSITY, density);
- }
+ public LightState setDensity( Float density) {
+ setValue(KEY_DENSITY, density);
+ return this;
+ }
/**
* Gets the color portion of the LightState class
@@ -140,7 +143,6 @@ public class LightState extends RPCStruct {
*
* @see com.smartdevicelink.proxy.rpc.RGBColor
*/
- @SuppressWarnings("unchecked")
public RGBColor getColor() {
return (RGBColor) getObject(RGBColor.class, KEY_COLOR);
}
@@ -150,9 +152,10 @@ public class LightState extends RPCStruct {
*
* @param color an RGBColor representation of the color of this specific light state
*
- * @see com.smartdevicelink.proxy.rpc.RGBColor
+ * @see RGBColor
*/
- public void setColor(RGBColor color) {
- setValue(KEY_COLOR, color);
- }
+ public LightState setColor( RGBColor color) {
+ setValue(KEY_COLOR, color);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java
index e69e0a900..b60d79522 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java
@@ -91,8 +91,9 @@ public class ListFilesResponse extends RPCResponse {
super.format(rpcVersion, formatParams);
}
- public void setFilenames(List<String> filenames) {
+ public ListFilesResponse setFilenames( List<String> filenames) {
setParameters(KEY_FILENAMES, filenames);
+ return this;
}
@SuppressWarnings("unchecked")
@@ -100,8 +101,9 @@ public class ListFilesResponse extends RPCResponse {
return (List<String>) getObject(String.class, KEY_FILENAMES);
}
- public void setSpaceAvailable(Integer spaceAvailable) {
+ public ListFilesResponse setSpaceAvailable( Integer spaceAvailable) {
setParameters(KEY_SPACE_AVAILABLE, spaceAvailable);
+ return this;
}
public Integer getSpaceAvailable() {
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java
index f548336f2..70e29ec77 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/LocationDetails.java
@@ -52,20 +52,21 @@ public class LocationDetails extends RPCStruct{
super(hash);
}
- @SuppressWarnings("unchecked")
public Coordinate getCoordinate() {
return (Coordinate) getObject(Coordinate.class, KEY_COORDINATE);
}
- public void setCoordinate(Coordinate coordinate) {
+ public LocationDetails setCoordinate( Coordinate coordinate) {
setValue(KEY_COORDINATE, coordinate);
+ return this;
}
public String getLocationName() {
return getString(KEY_LOCATION_NAME);
}
- public void setLocationName(String locationName) {
+ public LocationDetails setLocationName( String locationName) {
setValue(KEY_LOCATION_NAME, locationName);
+ return this;
}
@SuppressWarnings("unchecked")
@@ -73,40 +74,43 @@ public class LocationDetails extends RPCStruct{
return (List<String>) getObject(String.class, KEY_ADDRESS_LINES);
}
- public void setAddressLines(List<String> addressLines) {
+ public LocationDetails setAddressLines( List<String> addressLines) {
setValue(KEY_ADDRESS_LINES, addressLines);
+ return this;
}
public String getLocationDescription() {
return getString(KEY_LOCATION_DESCRIPTION);
}
- public void setLocationDescription(String locationDescription) {
+ public LocationDetails setLocationDescription( String locationDescription) {
setValue(KEY_LOCATION_DESCRIPTION, locationDescription);
+ return this;
}
public String getPhoneNumber() {
return getString(KEY_PHONE_NUMBER);
}
- public void setPhoneNumber(String phoneNumber) {
+ public LocationDetails setPhoneNumber( String phoneNumber) {
setValue(KEY_PHONE_NUMBER, phoneNumber);
+ return this;
}
- @SuppressWarnings("unchecked")
public Image getLocationImage() {
return (Image) getObject(Image.class, KEY_LOCATION_IMAGE);
}
- public void setLocationImage(Image locationImage) {
+ public LocationDetails setLocationImage( Image locationImage) {
setValue(KEY_LOCATION_IMAGE, locationImage);
+ return this;
}
- @SuppressWarnings("unchecked")
public OasisAddress getSearchAddress() {
return (OasisAddress) getObject(OasisAddress.class, KEY_SEARCH_ADDRESS);
}
- public void setSearchAddress(OasisAddress searchAddress) {
+ public LocationDetails setSearchAddress( OasisAddress searchAddress) {
setValue(KEY_SEARCH_ADDRESS, searchAddress);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java
index 6a4694a22..5d6219e14 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageCushionFirmness.java
@@ -77,9 +77,10 @@ public class MassageCushionFirmness extends RPCStruct {
*
* @param cushion type of MassageCushion for multi-contour massage seat
*/
- public void setCushion(@NonNull MassageCushion cushion) {
- setValue(KEY_CUSHION, cushion);
- }
+ public MassageCushionFirmness setCushion(@NonNull MassageCushion cushion) {
+ setValue(KEY_CUSHION, cushion);
+ return this;
+ }
/**
* Gets the type of MassageCushion for multi-contour massage seat
@@ -95,9 +96,10 @@ public class MassageCushionFirmness extends RPCStruct {
*
* @param firmness firmness of the supplied MassageCushion (Min: 0 Max: 100)
*/
- public void setFirmness(@NonNull Integer firmness) {
- setValue(KEY_FIRMNESS, firmness);
- }
+ public MassageCushionFirmness setFirmness(@NonNull Integer firmness) {
+ setValue(KEY_FIRMNESS, firmness);
+ return this;
+ }
/**
* Gets the firmness associated with the supplied MassageCushion
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java
index 1802c18c3..fee40d30d 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MassageModeData.java
@@ -78,9 +78,10 @@ public class MassageModeData extends RPCStruct {
*
* @param massageZone the zone of a multi-contour massage seat
*/
- public void setMassageZone(@NonNull MassageZone massageZone) {
- setValue(KEY_MASSAGE_ZONE, massageZone);
- }
+ public MassageModeData setMassageZone(@NonNull MassageZone massageZone) {
+ setValue(KEY_MASSAGE_ZONE, massageZone);
+ return this;
+ }
/**
* Gets the massageZone that will be associated with the supplied massage mode
@@ -105,7 +106,8 @@ public class MassageModeData extends RPCStruct {
*
* @param massageMode mode of massage to be used (OFF, LOW, HIGH)
*/
- public void setMassageMode(@NonNull MassageMode massageMode) {
- setValue(KEY_MASSAGE_MODE, massageMode);
- }
+ public MassageModeData setMassageMode(@NonNull MassageMode massageMode) {
+ setValue(KEY_MASSAGE_MODE, massageMode);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceData.java
index 16065f669..a4722adb9 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MediaServiceData.java
@@ -68,9 +68,10 @@ public class MediaServiceData extends RPCStruct {
/**
* @param mediaType - The type of the currently playing or paused track.
*/
- public void setMediaType(MediaType mediaType) {
- setValue(KEY_MEDIA_TYPE, mediaType);
- }
+ public MediaServiceData setMediaType( MediaType mediaType) {
+ setValue(KEY_MEDIA_TYPE, mediaType);
+ return this;
+ }
/**
* @return mediaType - The type of the currently playing or paused track.
@@ -85,9 +86,10 @@ public class MediaServiceData extends RPCStruct {
* Audiobook: The name of the current chapter
* @param mediaTitle -
*/
- public void setMediaTitle(String mediaTitle) {
- setValue(KEY_MEDIA_TITLE, mediaTitle);
- }
+ public MediaServiceData setMediaTitle( String mediaTitle) {
+ setValue(KEY_MEDIA_TITLE, mediaTitle);
+ return this;
+ }
/**
* Music: The name of the current track
@@ -105,9 +107,10 @@ public class MediaServiceData extends RPCStruct {
* Audiobook: The book author's name
* @param mediaArtist -
*/
- public void setMediaArtist(String mediaArtist) {
- setValue(KEY_MEDIA_ARTIST, mediaArtist);
- }
+ public MediaServiceData setMediaArtist( String mediaArtist) {
+ setValue(KEY_MEDIA_ARTIST, mediaArtist);
+ return this;
+ }
/**
* Music: The name of the current album artist
@@ -125,9 +128,10 @@ public class MediaServiceData extends RPCStruct {
* Audiobook: The name of the current book
* @param mediaAlbum -
*/
- public void setMediaAlbum(String mediaAlbum) {
- setValue(KEY_MEDIA_ALBUM, mediaAlbum);
- }
+ public MediaServiceData setMediaAlbum( String mediaAlbum) {
+ setValue(KEY_MEDIA_ALBUM, mediaAlbum);
+ return this;
+ }
/**
* Music: The name of the current album
@@ -146,9 +150,10 @@ public class MediaServiceData extends RPCStruct {
* Audiobook: The book or chapter artwork of the current audiobook
* @param mediaImage
*/
- public void setMediaImage(Image mediaImage){
- setValue(KEY_MEDIA_IMAGE, mediaImage);
- }
+ public MediaServiceData setMediaImage( Image mediaImage) {
+ setValue(KEY_MEDIA_IMAGE, mediaImage);
+ return this;
+ }
/**
* Returns the media image associated with the currently playing media
@@ -166,9 +171,10 @@ public class MediaServiceData extends RPCStruct {
* Audiobook: Likely not applicable, possibly a collection or "playlist" of books
* @param playlistName -
*/
- public void setPlaylistName(String playlistName) {
- setValue(KEY_PLAYLIST_NAME, playlistName);
- }
+ public MediaServiceData setPlaylistName( String playlistName) {
+ setValue(KEY_PLAYLIST_NAME, playlistName);
+ return this;
+ }
/**
* Music: The name of the playlist or radio station, if the user is playing from a playlist, otherwise, Null
@@ -183,9 +189,10 @@ public class MediaServiceData extends RPCStruct {
/**
* @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);
- }
+ public MediaServiceData setIsExplicit( Boolean isExplicit) {
+ setValue(KEY_IS_EXPLICIT, isExplicit);
+ return this;
+ }
/**
* @return isExplicit - Whether or not the content currently playing (e.g. the track, episode, or book) contains explicit content
@@ -200,9 +207,10 @@ public class MediaServiceData extends RPCStruct {
* 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);
- }
+ public MediaServiceData setTrackPlaybackProgress( Integer trackPlaybackProgress) {
+ setValue(KEY_TRACK_PLAYBACK_PROGRESS, trackPlaybackProgress);
+ return this;
+ }
/**
* Music: The current progress of the track in seconds
@@ -220,9 +228,10 @@ public class MediaServiceData extends RPCStruct {
* 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);
- }
+ public MediaServiceData setTrackPlaybackDuration( Integer trackPlaybackDuration) {
+ setValue(KEY_TRACK_PLAYBACK_DURATION, trackPlaybackDuration);
+ return this;
+ }
/**
* Music: The total duration of the track in seconds
@@ -240,9 +249,10 @@ public class MediaServiceData extends RPCStruct {
* 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);
- }
+ public MediaServiceData setQueuePlaybackProgress( Integer queuePlaybackProgress) {
+ setValue(KEY_QUEUE_PLAYBACK_PROGRESS, queuePlaybackProgress);
+ return this;
+ }
/**
* Music: The current progress of the playback queue in seconds
@@ -260,9 +270,10 @@ public class MediaServiceData extends RPCStruct {
* 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);
- }
+ public MediaServiceData setQueuePlaybackDuration( Integer queuePlaybackDuration) {
+ setValue(KEY_QUEUE_PLAYBACK_DURATION, queuePlaybackDuration);
+ return this;
+ }
/**
* Music: The total duration of the playback queue in seconds
@@ -280,9 +291,10 @@ public class MediaServiceData extends RPCStruct {
* 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);
- }
+ public MediaServiceData setQueueCurrentTrackNumber( Integer queueCurrentTrackNumber) {
+ setValue(KEY_QUEUE_CURRENT_TRACK_NUMBER, queueCurrentTrackNumber);
+ return this;
+ }
/**
* Music: The current number (1 based) of the track in the playback queue
@@ -300,9 +312,10 @@ public class MediaServiceData extends RPCStruct {
* 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);
- }
+ public MediaServiceData setQueueTotalTrackCount( Integer queueTotalTrackCount) {
+ setValue(KEY_QUEUE_TOTAL_TRACK_COUNT, queueTotalTrackCount);
+ return this;
+ }
/**
* Music: The total number of tracks in the playback queue
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java
index 3ed8db072..408c36f71 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -123,9 +123,10 @@ public class MenuParams extends RPCStruct {
* 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 ) {
+ */
+ public MenuParams setParentID( Integer parentID) {
setValue(KEY_PARENT_ID, parentID);
+ return this;
}
/**
* 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.
@@ -142,7 +143,7 @@ public class MenuParams extends RPCStruct {
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.
+ * 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>
@@ -151,9 +152,10 @@ public class MenuParams extends RPCStruct {
* <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 ) {
+ */
+ public MenuParams setPosition( Integer position) {
setValue(KEY_POSITION, position);
+ return this;
}
/**
* Get the text which appears in menu, representing this command.
@@ -175,8 +177,9 @@ public class MenuParams extends RPCStruct {
* </ul>
* @param menuName the menu name
*/
-
- public void setMenuName( @NonNull String menuName ) {
+
+ public MenuParams setMenuName(@NonNull String menuName) {
setValue(KEY_MENU_NAME, menuName);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java
index 49afcd86b..6894109fa 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MetadataTags.java
@@ -59,16 +59,18 @@ public class MetadataTags extends RPCStruct {
/**
* 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);
- }
+ public MetadataTags setMainField1( List<MetadataType> metadataTypes) {
+ setValue(KEY_MAIN_FIELD_1_TYPE, metadataTypes);
+ return this;
+ }
/**
* 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));
- }
+ public MetadataTags setMainField1( MetadataType metadataType) {
+ setValue(KEY_MAIN_FIELD_1_TYPE, Collections.singletonList(metadataType));
+ return this;
+ }
/**
* @return The type of data contained in the "mainField1" text field
@@ -81,16 +83,18 @@ public class MetadataTags extends RPCStruct {
/**
* 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);
- }
+ public MetadataTags setMainField2( List<MetadataType> metadataTypes) {
+ setValue(KEY_MAIN_FIELD_2_TYPE, metadataTypes);
+ return this;
+ }
/**
* 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));
- }
+ public MetadataTags setMainField2( MetadataType metadataType) {
+ setValue(KEY_MAIN_FIELD_2_TYPE, Collections.singletonList(metadataType));
+ return this;
+ }
/**
* @return The type of data contained in the "mainField2" text field
@@ -103,16 +107,18 @@ public class MetadataTags extends RPCStruct {
/**
* 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);
- }
+ public MetadataTags setMainField3( List<MetadataType> metadataTypes) {
+ setValue(KEY_MAIN_FIELD_3_TYPE, metadataTypes);
+ return this;
+ }
/**
* 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));
- }
+ public MetadataTags setMainField3( MetadataType metadataType) {
+ setValue(KEY_MAIN_FIELD_3_TYPE, Collections.singletonList(metadataType));
+ return this;
+ }
/**
* @return The type of data contained in the "mainField3" text field
@@ -125,16 +131,18 @@ public class MetadataTags extends RPCStruct {
/**
* 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);
- }
+ public MetadataTags setMainField4( List<MetadataType> metadataTypes) {
+ setValue(KEY_MAIN_FIELD_4_TYPE, metadataTypes);
+ return this;
+ }
/**
* 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));
- }
+ public MetadataTags setMainField4( MetadataType metadataType) {
+ setValue(KEY_MAIN_FIELD_4_TYPE, Collections.singletonList(metadataType));
+ return this;
+ }
/**
* @return The type of data contained in the "mainField4" text field
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java
index 1c1333102..b20124551 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java
@@ -66,9 +66,10 @@ public class ModuleData extends RPCStruct {
* @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);
- }
+ public ModuleData setModuleType(@NonNull ModuleType moduleType) {
+ setValue(KEY_MODULE_TYPE, moduleType);
+ return this;
+ }
/**
* Gets the moduleType portion of the ModuleData class
@@ -85,9 +86,10 @@ public class ModuleData extends RPCStruct {
*
* @param radioControlData
*/
- public void setRadioControlData(RadioControlData radioControlData) {
- setValue(KEY_RADIO_CONTROL_DATA, radioControlData);
- }
+ public ModuleData setRadioControlData( RadioControlData radioControlData) {
+ setValue(KEY_RADIO_CONTROL_DATA, radioControlData);
+ return this;
+ }
/**
* Gets the radioControlData portion of the ModuleData class
@@ -103,9 +105,10 @@ public class ModuleData extends RPCStruct {
*
* @param climateControlData
*/
- public void setClimateControlData(ClimateControlData climateControlData) {
- setValue(KEY_CLIMATE_CONTROL_DATA, climateControlData);
- }
+ public ModuleData setClimateControlData( ClimateControlData climateControlData) {
+ setValue(KEY_CLIMATE_CONTROL_DATA, climateControlData);
+ return this;
+ }
/**
* Gets the climateControlData portion of the ModuleData class
@@ -121,9 +124,10 @@ public class ModuleData extends RPCStruct {
*
* @param seatControlData
*/
- public void setSeatControlData(SeatControlData seatControlData) {
- setValue(KEY_SEAT_CONTROL_DATA, seatControlData);
- }
+ public ModuleData setSeatControlData( SeatControlData seatControlData) {
+ setValue(KEY_SEAT_CONTROL_DATA, seatControlData);
+ return this;
+ }
/**
* Gets the seatControlData portion of the ModuleData class
@@ -139,9 +143,10 @@ public class ModuleData extends RPCStruct {
*
* @param audioControlData
*/
- public void setAudioControlData(AudioControlData audioControlData) {
- setValue(KEY_AUDIO_CONTROL_DATA, audioControlData);
- }
+ public ModuleData setAudioControlData( AudioControlData audioControlData) {
+ setValue(KEY_AUDIO_CONTROL_DATA, audioControlData);
+ return this;
+ }
/**
* Gets the audioControlData portion of the ModuleData class
@@ -157,9 +162,10 @@ public class ModuleData extends RPCStruct {
*
* @param lightControlData
*/
- public void setLightControlData(LightControlData lightControlData) {
- setValue(KEY_LIGHT_CONTROL_DATA, lightControlData);
- }
+ public ModuleData setLightControlData( LightControlData lightControlData) {
+ setValue(KEY_LIGHT_CONTROL_DATA, lightControlData);
+ return this;
+ }
/**
* Gets the lightControlData portion of the ModuleData class
@@ -175,9 +181,10 @@ public class ModuleData extends RPCStruct {
*
* @param hmiSettingsControlData
*/
- public void setHmiSettingsControlData(HMISettingsControlData hmiSettingsControlData) {
- setValue(KEY_HMI_SETTINGS_CONTROL_DATA, hmiSettingsControlData);
- }
+ public ModuleData setHmiSettingsControlData( HMISettingsControlData hmiSettingsControlData) {
+ setValue(KEY_HMI_SETTINGS_CONTROL_DATA, hmiSettingsControlData);
+ return this;
+ }
/**
* Gets the hmiSettingsControlData portion of the ModuleData class
@@ -192,9 +199,10 @@ public class ModuleData extends RPCStruct {
* Sets the Module ID of the ModuleData class
* @param id the id to be set
*/
- public void setModuleId(String id) {
- setValue(KEY_MODULE_ID, id);
- }
+ public ModuleData setModuleId( String id) {
+ setValue(KEY_MODULE_ID, id);
+ return this;
+ }
/**
* Gets the Module ID of the ModuleData class
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleInfo.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleInfo.java
index 701fe6c09..65debe0cf 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleInfo.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ModuleInfo.java
@@ -34,8 +34,9 @@ public class ModuleInfo extends RPCStruct {
* Sets the Module ID for this Module
* @param id the id to be set
*/
- public void setModuleId(@NonNull String id) {
+ public ModuleInfo setModuleId(@NonNull String id) {
setValue(KEY_MODULE_ID, id);
+ return this;
}
/**
@@ -50,8 +51,9 @@ public class ModuleInfo extends RPCStruct {
* Sets the location of this Module
* @param location the location to be set
*/
- public void setModuleLocation(Grid location) {
+ public ModuleInfo setModuleLocation( Grid location) {
setValue(KEY_MODULE_LOCATION, location);
+ return this;
}
/**
@@ -66,8 +68,9 @@ public class ModuleInfo extends RPCStruct {
* Sets the service area of this Module
* @param serviceArea the service area of this Module
*/
- public void setModuleServiceArea(Grid serviceArea) {
+ public ModuleInfo setModuleServiceArea( Grid serviceArea) {
setValue(KEY_MODULE_SERVICE_AREA, serviceArea);
+ return this;
}
/**
@@ -82,8 +85,9 @@ public class ModuleInfo extends RPCStruct {
* Sets the multiple access allowance for this Module
* @param isMultipleAccess the access to be set
*/
- public void setMultipleAccessAllowance(Boolean isMultipleAccess) {
+ public ModuleInfo setMultipleAccessAllowance( Boolean isMultipleAccess) {
setValue(KEY_MULTIPLE_ACCESS_ALLOWED, isMultipleAccess);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java
index c72b8a203..e73565677 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -84,8 +84,9 @@ public class MyKey extends RPCStruct {
this();
setE911Override(e911Override);
}
- public void setE911Override(@NonNull VehicleDataStatus e911Override) {
+ public MyKey setE911Override(@NonNull VehicleDataStatus e911Override) {
setValue(KEY_E_911_OVERRIDE, e911Override);
+ return this;
}
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
index 486a3c2ea..c3d19c3b1 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationCapability.java
@@ -52,15 +52,17 @@ public class NavigationCapability extends RPCStruct{
return getBoolean(KEY_LOCATION_ENABLED);
}
- public void setSendLocationEnabled(Boolean sendLocationEnabled){
- setValue(KEY_LOCATION_ENABLED, sendLocationEnabled);
- }
+ public NavigationCapability setSendLocationEnabled( Boolean sendLocationEnabled) {
+ setValue(KEY_LOCATION_ENABLED, sendLocationEnabled);
+ return this;
+ }
public Boolean getWayPointsEnabled(){
return getBoolean(KEY_GETWAYPOINTS_ENABLED);
}
- public void setWayPointsEnabled(Boolean getWayPointsEnabled){
- setValue(KEY_GETWAYPOINTS_ENABLED, getWayPointsEnabled);
- }
+ public NavigationCapability setWayPointsEnabled( Boolean getWayPointsEnabled) {
+ setValue(KEY_GETWAYPOINTS_ENABLED, getWayPointsEnabled);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java
index bd7bbc0eb..e4c3136ab 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationInstruction.java
@@ -70,9 +70,10 @@ public class NavigationInstruction extends RPCStruct {
/**
* @param locationDetails -
*/
- public void setLocationDetails(@NonNull LocationDetails locationDetails){
- setValue(KEY_LOCATION_DETAILS, locationDetails);
- }
+ public NavigationInstruction setLocationDetails(@NonNull LocationDetails locationDetails) {
+ setValue(KEY_LOCATION_DETAILS, locationDetails);
+ return this;
+ }
/**
* @return locationDetails
@@ -84,9 +85,10 @@ public class NavigationInstruction extends RPCStruct {
/**
* @param action -
*/
- public void setAction(@NonNull NavigationAction action){
- setValue(KEY_ACTION, action);
- }
+ public NavigationInstruction setAction(@NonNull NavigationAction action) {
+ setValue(KEY_ACTION, action);
+ return this;
+ }
/**
* @return action
@@ -98,9 +100,10 @@ public class NavigationInstruction extends RPCStruct {
/**
* @param eta -
*/
- public void setEta(DateTime eta){
- setValue(KEY_ETA, eta);
- }
+ public NavigationInstruction setEta( DateTime eta) {
+ setValue(KEY_ETA, eta);
+ return this;
+ }
/**
* @return eta
@@ -115,9 +118,10 @@ public class NavigationInstruction extends RPCStruct {
* a U-Turn, etc.
* @param bearing - minValue="0" maxValue="359"
*/
- public void setBearing(Integer bearing){
- setValue(KEY_BEARING, bearing);
- }
+ public NavigationInstruction setBearing( Integer bearing) {
+ setValue(KEY_BEARING, bearing);
+ return this;
+ }
/**
* The angle at which this instruction takes place. For example, 0 would mean straight, <=45
@@ -132,9 +136,10 @@ public class NavigationInstruction extends RPCStruct {
/**
* @param junctionType -
*/
- public void setJunctionType(NavigationJunction junctionType){
- setValue(KEY_JUNCTION_TYPE, junctionType);
- }
+ public NavigationInstruction setJunctionType( NavigationJunction junctionType) {
+ setValue(KEY_JUNCTION_TYPE, junctionType);
+ return this;
+ }
/**
* @return junctionType
@@ -148,9 +153,10 @@ public class NavigationInstruction extends RPCStruct {
* 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);
- }
+ public NavigationInstruction setDrivingSide( Direction drivingSide) {
+ setValue(KEY_DRIVING_SIDE, drivingSide);
+ return this;
+ }
/**
* Used to infer which side of the road this instruction takes place. For a U-Turn (action=TURN, bearing=180) this
@@ -167,9 +173,10 @@ public class NavigationInstruction extends RPCStruct {
* NavigationServiceData for that.
* @param details -
*/
- public void setDetails(String details){
- setValue(KEY_DETAILS, details);
- }
+ public NavigationInstruction setDetails( String details) {
+ setValue(KEY_DETAILS, details);
+ return this;
+ }
/**
* This is a string representation of this instruction, used to display instructions to the
@@ -185,9 +192,10 @@ public class NavigationInstruction extends RPCStruct {
* An image representation of this instruction.
* @param image -
*/
- public void setImage(Image image){
- setValue(KEY_IMAGE, image);
- }
+ public NavigationInstruction setImage( Image image) {
+ setValue(KEY_IMAGE, image);
+ return this;
+ }
/**
* An image representation of this instruction.
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java
index ae566c6e8..dd4b9237f 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceData.java
@@ -73,9 +73,10 @@ public class NavigationServiceData extends RPCStruct {
* given in the data can accurately be adjusted if necessary.
* @param timeStamp -
*/
- public void setTimeStamp(@NonNull DateTime timeStamp){
- setValue(KEY_TIMESTAMP, timeStamp);
- }
+ public NavigationServiceData setTimeStamp(@NonNull DateTime timeStamp) {
+ setValue(KEY_TIMESTAMP, timeStamp);
+ return this;
+ }
/**
* This is the timeStamp of when the data was generated. This is to ensure any time or distance
@@ -89,9 +90,10 @@ public class NavigationServiceData extends RPCStruct {
/**
* @param origin -
*/
- public void setOrigin(LocationDetails origin){
- setValue(KEY_ORIGIN, origin);
- }
+ public NavigationServiceData setOrigin( LocationDetails origin) {
+ setValue(KEY_ORIGIN, origin);
+ return this;
+ }
/**
* @return origin
@@ -103,9 +105,10 @@ public class NavigationServiceData extends RPCStruct {
/**
* @param destination -
*/
- public void setDestination(LocationDetails destination){
- setValue(KEY_DESTINATION, destination);
- }
+ public NavigationServiceData setDestination( LocationDetails destination) {
+ setValue(KEY_DESTINATION, destination);
+ return this;
+ }
/**
* @return destination
@@ -117,9 +120,10 @@ public class NavigationServiceData extends RPCStruct {
/**
* @param destinationETA -
*/
- public void setDestinationETA(DateTime destinationETA){
- setValue(KEY_DESTINATION_ETA, destinationETA);
- }
+ public NavigationServiceData setDestinationETA( DateTime destinationETA) {
+ setValue(KEY_DESTINATION_ETA, destinationETA);
+ return this;
+ }
/**
* @return destinationETA
@@ -133,9 +137,10 @@ public class NavigationServiceData extends RPCStruct {
* always contain the next instruction.
* @param instructions -
*/
- public void setInstructions(List<NavigationInstruction> instructions){
- setValue(KEY_INSTRUCTIONS, instructions);
- }
+ public NavigationServiceData setInstructions( List<NavigationInstruction> instructions) {
+ setValue(KEY_INSTRUCTIONS, instructions);
+ return this;
+ }
/**
* This array should be ordered with all remaining instructions. The start of this array should
@@ -150,9 +155,10 @@ public class NavigationServiceData extends RPCStruct {
/**
* @param nextInstructionETA -
*/
- public void setNextInstructionETA(DateTime nextInstructionETA){
- setValue(KEY_NEXT_INSTRUCTION_ETA, nextInstructionETA);
- }
+ public NavigationServiceData setNextInstructionETA( DateTime nextInstructionETA) {
+ setValue(KEY_NEXT_INSTRUCTION_ETA, nextInstructionETA);
+ return this;
+ }
/**
* @return nextInstructionETA
@@ -167,9 +173,10 @@ public class NavigationServiceData extends RPCStruct {
* the next instruction.
* @param nextInstructionDistance -
*/
- public void setNextInstructionDistance(Float nextInstructionDistance){
- setValue(KEY_NEXT_INSTRUCTION_DISTANCE, nextInstructionDistance);
- }
+ public NavigationServiceData setNextInstructionDistance( Float nextInstructionDistance) {
+ setValue(KEY_NEXT_INSTRUCTION_DISTANCE, nextInstructionDistance);
+ return this;
+ }
/**
* The distance to this instruction from current location. This should only be updated every
@@ -185,9 +192,10 @@ public class NavigationServiceData extends RPCStruct {
* Distance till next maneuver (starting from) from previous maneuver.
* @param nextInstructionDistanceScale -
*/
- public void setNextInstructionDistanceScale(Float nextInstructionDistanceScale){
- setValue(KEY_NEXT_INSTRUCTION_DISTANCE_SCALE, nextInstructionDistanceScale);
- }
+ public NavigationServiceData setNextInstructionDistanceScale( Float nextInstructionDistanceScale) {
+ setValue(KEY_NEXT_INSTRUCTION_DISTANCE_SCALE, nextInstructionDistanceScale);
+ return this;
+ }
/**
* Distance till next maneuver (starting from) from previous maneuver.
@@ -203,9 +211,10 @@ public class NavigationServiceData extends RPCStruct {
* instruction, post instruction, alerts that affect the current navigation session, etc.
* @param prompt -
*/
- public void setPrompt(String prompt){
- setValue(KEY_PROMPT, prompt);
- }
+ public NavigationServiceData setPrompt( String prompt) {
+ setValue(KEY_PROMPT, prompt);
+ return this;
+ }
/**
* This is a prompt message that should be conveyed to the user through either display or voice
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceManifest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceManifest.java
index 78b392865..e355c7a1c 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceManifest.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/NavigationServiceManifest.java
@@ -53,9 +53,10 @@ public class NavigationServiceManifest extends RPCStruct {
* Informs the subscriber if this service can actually accept way points.
* @param acceptsWayPoints -
*/
- public void setAcceptsWayPoints(Boolean acceptsWayPoints){
- setValue(KEY_ACCEPTS_WAY_POINTS, acceptsWayPoints);
- }
+ public NavigationServiceManifest setAcceptsWayPoints( Boolean acceptsWayPoints) {
+ setValue(KEY_ACCEPTS_WAY_POINTS, acceptsWayPoints);
+ return this;
+ }
/**
* Informs the subscriber if this service can actually accept 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
index 7b4d09478..775f50d2c 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OasisAddress.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OasisAddress.java
@@ -71,13 +71,14 @@ public class OasisAddress extends RPCStruct{
/**
* 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) {
+ public OasisAddress setCountryName( String countryName) {
setValue(KEY_COUNTRY_NAME, countryName);
+ return this;
}
/**
@@ -92,13 +93,14 @@ public class OasisAddress extends RPCStruct{
/**
* 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) {
+ *
+ */
+ public OasisAddress setCountryCode( String countryCode) {
setValue(KEY_COUNTRY_CODE, countryCode);
+ return this;
}
/**
@@ -113,13 +115,14 @@ public class OasisAddress extends RPCStruct{
/**
* Sets the Postal Code associated with the OasisAddress class.
- *
+ *
* @param postalCode
* The Postal Code associated with the OasisAddress class.
- *
- */
- public void setPostalCode(String postalCode) {
+ *
+ */
+ public OasisAddress setPostalCode( String postalCode) {
setValue(KEY_POSTAL_CODE, postalCode);
+ return this;
}
/**
@@ -134,13 +137,14 @@ public class OasisAddress extends RPCStruct{
/**
* 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) {
+ *
+ */
+ public OasisAddress setAdministrativeArea( String administrativeArea) {
setValue(KEY_ADMINISTRATIVE_AREA, administrativeArea);
+ return this;
}
/**
@@ -155,13 +159,14 @@ public class OasisAddress extends RPCStruct{
/**
* 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) {
+ *
+ */
+ public OasisAddress setSubAdministrativeArea( String subAdministrativeArea) {
setValue(KEY_SUB_ADMINISTRATIVE_AREA, subAdministrativeArea);
+ return this;
}
/**
@@ -176,13 +181,14 @@ public class OasisAddress extends RPCStruct{
/**
* 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) {
+ public OasisAddress setLocality( String locality) {
setValue(KEY_LOCALITY, locality);
+ return this;
}
/**
@@ -197,13 +203,14 @@ public class OasisAddress extends RPCStruct{
/**
* 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) {
+ *
+ */
+ public OasisAddress setSubLocality( String subLocality) {
setValue(KEY_SUB_LOCALITY, subLocality);
+ return this;
}
/**
@@ -218,13 +225,14 @@ public class OasisAddress extends RPCStruct{
/**
* 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) {
+ *
+ */
+ public OasisAddress setThoroughfare( String thoroughFare) {
setValue(KEY_THOROUGH_FARE, thoroughFare);
+ return this;
}
/**
@@ -238,12 +246,13 @@ public class OasisAddress extends RPCStruct{
/**
* 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) {
+ *
+ */
+ public OasisAddress setSubThoroughfare( String subThoroughfare) {
setValue(KEY_SUB_THOROUGH_FARE, subThoroughfare);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java
index 30fe4e755..33a896c2f 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppInterfaceUnregistered.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -105,8 +105,9 @@ public class OnAppInterfaceUnregistered extends RPCNotification {
/**
* <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 ) {
+ */
+ public OnAppInterfaceUnregistered setReason(@NonNull AppInterfaceUnregisteredReason reason) {
setParameters(KEY_REASON, reason);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java
index e959b78f4..61b696809 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAppServiceData.java
@@ -65,9 +65,10 @@ public class OnAppServiceData extends RPCNotification {
/**
* @param serviceData -
*/
- public void setServiceData(@NonNull AppServiceData serviceData){
- setParameters(KEY_SERVICE_DATA, serviceData);
- }
+ public OnAppServiceData setServiceData(@NonNull AppServiceData serviceData) {
+ setParameters(KEY_SERVICE_DATA, serviceData);
+ return this;
+ }
/**
* @return serviceData
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java
index ab1ea3770..e5b9a5993 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnAudioPassThru.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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;
@@ -84,8 +84,9 @@ public class OnAudioPassThru extends RPCNotification {
public OnAudioPassThru(Hashtable<String, Object> hash) {
super(hash);
}
- public void setAPTData(byte[] aptData) {
+ public OnAudioPassThru setAPTData( byte[] aptData) {
setBulkData(aptData);
+ return this;
}
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
index d4e1b01b7..3bdd9670a 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonEvent.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -91,7 +91,7 @@ import java.util.Hashtable;
* <tr>
* <td>buttonEventMode</td>
* <td>{@linkplain ButtonEventMode}</td>
- * <td>Indicats button was depressed (DOWN) or released (UP)</td>
+ * <td>Indicates button was depressed (DOWN) or released (UP)</td>
* <td></td>
* <td></td>
* <td>SmartDeviceLink 1.0</td>
@@ -160,11 +160,12 @@ public class OnButtonEvent extends RPCNotification {
}
/**
- * <p>Set the button's name</p>
+ * <p>Set the button's name</p>
* @param buttonName name of the button
- */
- public void setButtonName(@NonNull ButtonName buttonName) {
+ */
+ public OnButtonEvent setButtonName(@NonNull ButtonName buttonName) {
setParameters(KEY_BUTTON_NAME, buttonName);
+ return this;
}
/**
@@ -179,13 +180,15 @@ public class OnButtonEvent extends RPCNotification {
* <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) {
+ */
+ public OnButtonEvent setButtonEventMode(@NonNull ButtonEventMode buttonEventMode) {
setParameters(KEY_BUTTON_EVENT_MODE, buttonEventMode);
+ return this;
}
- public void setCustomButtonID(Integer customButtonID) {
+ public OnButtonEvent setCustomButtonID( Integer customButtonID) {
setParameters(KEY_CUSTOM_BUTTON_ID, customButtonID);
+ return this;
}
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
index 8c0003db8..e214e8b96 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnButtonPress.java
@@ -160,11 +160,12 @@ public class OnButtonPress extends RPCNotification {
return (ButtonName) getObject(ButtonName.class, KEY_BUTTON_NAME);
}
/**
- * <p>Set the button's name</p>
+ * <p>Set the button's name</p>
* @param buttonName name of the button
- */
- public void setButtonName( @NonNull ButtonName buttonName ) {
+ */
+ public OnButtonPress setButtonName(@NonNull ButtonName buttonName) {
setParameters(KEY_BUTTON_NAME, buttonName);
+ return this;
}
/**<p>Returns <i>{@linkplain ButtonPressMode}</i></p>
* @return ButtonPressMode whether this is a long or short button press event
@@ -175,9 +176,10 @@ public class OnButtonPress extends RPCNotification {
/**
* <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 ) {
+ */
+ public OnButtonPress setButtonPressMode(@NonNull ButtonPressMode buttonPressMode) {
setParameters(KEY_BUTTON_PRESS_MODE, buttonPressMode);
+ return this;
}
/**
@@ -185,8 +187,9 @@ public class OnButtonPress extends RPCNotification {
* If ButtonName is "CUSTOM_BUTTON", this references the integer ID passed by a custom button. (e.g. softButton ID)
* @param customButtonID CustomButtonID of the button
*/
- public void setCustomButtonID(Integer customButtonID) {
+ public OnButtonPress setCustomButtonID( Integer customButtonID) {
setParameters(KEY_CUSTOM_BUTTON_ID, customButtonID);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java
index 1f474bd30..93fd96dce 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnCommand.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -73,7 +73,7 @@ import java.util.Hashtable;
* <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>Indicates whether command was selected via VR or via a menu selection (using the OK button).</td>
* <td></td>
* <td>SmartDeviceLink 1.0</td>
* </tr>
@@ -118,11 +118,12 @@ public class OnCommand extends RPCNotification {
return getInteger( KEY_CMD_ID );
}
/**
- * <p>Sets a Command ID</p>
+ * <p>Sets a Command ID</p>
* @param cmdID an integer object representing a Command ID
- */
- public void setCmdID( @NonNull Integer cmdID ) {
+ */
+ public OnCommand setCmdID(@NonNull Integer cmdID) {
setParameters(KEY_CMD_ID, cmdID);
+ return this;
}
/**
* <p>Returns a <I>TriggerSource</I> object which will be shown in the HMI</p>
@@ -133,10 +134,11 @@ public class OnCommand extends RPCNotification {
}
/**
* <p>Sets TriggerSource</p>
- * <p>Indicates whether command was selected via VR or via a menu selection (using the OK button).</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 ) {
+ */
+ public OnCommand setTriggerSource(@NonNull TriggerSource triggerSource) {
setParameters(KEY_TRIGGER_SOURCE, triggerSource);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java
index dc0b1b5e7..d9c16e50d 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnDriverDistraction.java
@@ -106,17 +106,19 @@ public class OnDriverDistraction extends RPCNotification {
/**
* <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 ) {
+ */
+ public OnDriverDistraction setState(@NonNull DriverDistractionState state) {
setParameters(KEY_STATE, state);
+ return this;
}
/**
* <p>Called to set dismissible state of Lockscreen</p>
* @param isDismissible the Lockscreen's dismissibility
*/
- public void setLockscreenDismissibility(boolean isDismissible) {
+ public OnDriverDistraction setLockscreenDismissibility( boolean isDismissible) {
setParameters(KEY_LOCKSCREEN_DISMISSIBLE, isDismissible);
+ return this;
}
/**
@@ -131,8 +133,9 @@ public class OnDriverDistraction extends RPCNotification {
* Called to set a warning message for the lockscreen
* @param msg the message to be set
*/
- public void setLockscreenWarningMessage(String msg) {
+ public OnDriverDistraction setLockscreenWarningMessage( String msg) {
setParameters(KEY_LOCKSCREEN_DISMISSIBLE_MSG, msg);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java
index ba2a5300b..52f3c4b84 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHMIStatus.java
@@ -158,9 +158,10 @@ public class OnHMIStatus extends RPCNotification {
/**
* <p>Set the HMILevel of OnHMIStatus</p>
* @param hmiLevel the HMILevel to set
- */
- public void setHmiLevel( @NonNull HMILevel hmiLevel ) {
+ */
+ public OnHMIStatus setHmiLevel(@NonNull HMILevel hmiLevel) {
setParameters(KEY_HMI_LEVEL, hmiLevel);
+ return this;
}
/**
* <p>Get current state of audio streaming for the application</p>
@@ -172,9 +173,10 @@ public class OnHMIStatus extends RPCNotification {
/**
* <p>Set the audio streaming state</p>
* @param audioStreamingState the state of audio streaming of the application
- */
- public void setAudioStreamingState(@NonNull AudioStreamingState audioStreamingState ) {
+ */
+ public OnHMIStatus setAudioStreamingState(@NonNull AudioStreamingState audioStreamingState) {
setParameters(KEY_AUDIO_STREAMING_STATE, audioStreamingState);
+ return this;
}
/**
* <p>Get current state of video streaming for the application</p>
@@ -187,8 +189,9 @@ public class OnHMIStatus extends RPCNotification {
* <p>Set the video streaming state</p>
* @param videoStreamingState the state of video streaming of the application
*/
- public void setVideoStreamingState( VideoStreamingState videoStreamingState ) {
+ public OnHMIStatus setVideoStreamingState( VideoStreamingState videoStreamingState) {
setParameters(KEY_VIDEO_STREAMING_STATE, videoStreamingState);
+ return this;
}
/**
* <p>Get the System Context</p>
@@ -199,11 +202,12 @@ public class OnHMIStatus extends RPCNotification {
}
/**
* <p>Set the System Context of OnHMIStatus</p>
- * @param systemContext Indicates that a user-initiated interaction is in-progress
+ * @param systemContext Indicates that a user-initiated interaction is in-progress
* (VRSESSION or MENU), or not (MAIN)
- */
- public void setSystemContext( @NonNull SystemContext systemContext ) {
+ */
+ public OnHMIStatus setSystemContext(@NonNull SystemContext systemContext) {
setParameters(KEY_SYSTEM_CONTEXT, systemContext);
+ return this;
}
/**
* <p>Query whether it's the first run</p>
@@ -215,9 +219,10 @@ public class OnHMIStatus extends RPCNotification {
/**
* <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;
+ */
+ public OnHMIStatus setFirstRun( Boolean firstRun) {
+ this.firstRun = firstRun;
+ return this;
}
/**
* <p>Set the windowID value</p>
@@ -226,8 +231,9 @@ public class OnHMIStatus extends RPCNotification {
* See PredefinedWindows enum.
* @since 6.0
*/
- public void setWindowID(Integer windowID) {
+ public OnHMIStatus setWindowID( Integer windowID) {
setParameters(KEY_WINDOW_ID, windowID);
+ return this;
}
/**
* <p>Get the windowID value</p>
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java
index 0abe4c1a8..baea12ec3 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnHashChange.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -99,8 +99,9 @@ public class OnHashChange extends RPCNotification {
return getString(KEY_HASH_ID);
}
- public void setHashID(@NonNull String hashID) {
+ public OnHashChange setHashID(@NonNull String hashID) {
setParameters(KEY_HASH_ID, hashID);
- }
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java
index 37c9d107c..a532421d9 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnInteriorVehicleData.java
@@ -83,7 +83,8 @@ public class OnInteriorVehicleData extends RPCNotification {
*
* @param moduleData
*/
- public void setModuleData(@NonNull ModuleData moduleData) {
+ public OnInteriorVehicleData setModuleData(@NonNull ModuleData moduleData) {
setParameters(KEY_MODULE_DATA, moduleData);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java
index d888c685b..c2906fbce 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnKeyboardInput.java
@@ -40,7 +40,7 @@ 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.
+ * On-screen keyboard event. Can be full string or individual key presses depending on keyboard mode.
* <p></p>
* <p><b>Parameter List</b></p>
* <table border="1" rules="all">
@@ -107,12 +107,14 @@ public class OnKeyboardInput extends RPCNotification {
return (KeyboardEvent) getObject(KeyboardEvent.class, KEY_EVENT);
}
- public void setEvent(@NonNull KeyboardEvent event) {
+ public OnKeyboardInput setEvent(@NonNull KeyboardEvent event) {
setParameters(KEY_EVENT, event);
+ return this;
}
- public void setData(String data) {
+ public OnKeyboardInput setData( String data) {
setParameters(KEY_DATA, data);
+ return this;
}
public String getData() {
Object obj = getParameters(KEY_DATA);
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java
index bf72f5f19..cc58efaf6 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnLanguageChange.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -116,11 +116,12 @@ public class OnLanguageChange extends RPCNotification {
setHmiDisplayLanguage(hmiDisplayLanguage);
}
/**
- * <p>Sets language that current SDL voice engine(VR+TTS) use</p>
+ * <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) {
+ */
+ public OnLanguageChange setLanguage(@NonNull Language language) {
setParameters(KEY_LANGUAGE, language);
+ return this;
}
/**
* <p>Returns language that current SDL voice engine(VR+TTS) use</p>
@@ -130,11 +131,12 @@ public class OnLanguageChange extends RPCNotification {
return (Language) getObject(Language.class, KEY_LANGUAGE);
}
/**
- * <p>Sets language that current display use</p>
+ * <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) {
+ */
+ public OnLanguageChange setHmiDisplayLanguage(@NonNull Language hmiDisplayLanguage) {
setParameters(KEY_HMI_DISPLAY_LANGUAGE, hmiDisplayLanguage);
+ return this;
}
/**
* <p>Returns language that current display use</p>
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java
index 41e003981..ebc95f699 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnPermissionsChange.java
@@ -113,12 +113,13 @@ public class OnPermissionsChange extends RPCNotification {
return (List<PermissionItem>) getObject(PermissionItem.class, KEY_PERMISSION_ITEM);
}
/**
- * <p>Sets PermissionItems describing change in permissions for a given set of RPCs</p>
+ * <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);
- }
+ */
+ public OnPermissionsChange setPermissionItem(@NonNull List<PermissionItem> permissionItem) {
+ setParameters(KEY_PERMISSION_ITEM, permissionItem);
+ return this;
+ }
/**
* Returns the encryption requirement for this permission change
@@ -132,7 +133,8 @@ public class OnPermissionsChange extends RPCNotification {
* Sets the encryption requirement for this permission change
* @param isRequired the boolean requirement to be set
*/
- public void setRequireEncryption(Boolean isRequired) {
- setParameters(KEY_REQUIRE_ENCRYPTION, isRequired);
- }
+ public OnPermissionsChange setRequireEncryption( Boolean isRequired) {
+ setParameters(KEY_REQUIRE_ENCRYPTION, isRequired);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java
index ffd7f03cc..e2f7831c9 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnRCStatus.java
@@ -77,24 +77,27 @@ public class OnRCStatus extends RPCNotification {
return (List<ModuleData>) getObject(ModuleData.class, KEY_ALLOCATED_MODULES);
}
- public void setAllocatedModules(@NonNull List<ModuleData> allocatedModules) {
- setParameters(KEY_ALLOCATED_MODULES, allocatedModules);
- }
+ public OnRCStatus setAllocatedModules(@NonNull List<ModuleData> allocatedModules) {
+ setParameters(KEY_ALLOCATED_MODULES, allocatedModules);
+ return this;
+ }
@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 OnRCStatus setFreeModules(@NonNull List<ModuleData> freeModules) {
+ setParameters(KEY_FREE_MODULES, freeModules);
+ return this;
+ }
public Boolean getAllowed() {
return getBoolean(KEY_ALLOWED);
}
- public void setAllowed(Boolean allowed) {
- setParameters(KEY_ALLOWED, allowed);
- }
+ public OnRCStatus setAllowed( Boolean allowed) {
+ setParameters(KEY_ALLOWED, allowed);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java
index d01bf757d..98e9088c6 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemCapabilityUpdated.java
@@ -65,9 +65,10 @@ public class OnSystemCapabilityUpdated extends RPCNotification {
/**
* @param systemCapability - The system capability that has been updated
*/
- public void setSystemCapability(@NonNull SystemCapability systemCapability){
- setParameters(KEY_SYSTEM_CAPABILITY, systemCapability);
- }
+ public OnSystemCapabilityUpdated setSystemCapability(@NonNull SystemCapability systemCapability) {
+ setParameters(KEY_SYSTEM_CAPABILITY, systemCapability);
+ return this;
+ }
/**
* @return systemCapability - The system capability that has been updated
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java
index 5de6c922b..ff7f1b959 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnSystemRequest.java
@@ -231,9 +231,10 @@ public class OnSystemRequest extends RPCNotification {
}
@Override
- public void setBulkData(byte[] bulkData){
+ public OnSystemRequest setBulkData(byte[] bulkData){
super.setBulkData(bulkData);
handleBulkData(bulkData);
+ return this;
}
@@ -246,12 +247,14 @@ public class OnSystemRequest extends RPCNotification {
return this.body;
}
- public void setBody(String body) {
+ public OnSystemRequest setBody( String body) {
this.body = body;
+ return this;
}
- public void setHeaders(Headers header) {
+ public OnSystemRequest setHeaders( Headers header) {
this.headers = header;
+ return this;
}
public Headers getHeader() {
@@ -262,16 +265,18 @@ public class OnSystemRequest extends RPCNotification {
return (RequestType) getObject(RequestType.class, KEY_REQUEST_TYPE);
}
- public void setRequestType(@NonNull RequestType requestType) {
+ public OnSystemRequest setRequestType(@NonNull RequestType requestType) {
setParameters(KEY_REQUEST_TYPE, requestType);
+ return this;
}
public String getRequestSubType() {
return getString(KEY_REQUEST_SUB_TYPE);
}
- public void setRequestSubType(String requestSubType) {
+ public OnSystemRequest setRequestSubType( String requestSubType) {
setParameters(KEY_REQUEST_SUB_TYPE, requestSubType);
+ return this;
}
public String getUrl() {
@@ -290,28 +295,31 @@ public class OnSystemRequest extends RPCNotification {
return null;
}
- public void setUrl(String url) {
+ public OnSystemRequest setUrl( String url) {
setParameters(KEY_URL, url);
+ return this;
}
public FileType getFileType() {
return (FileType) getObject(FileType.class, KEY_FILE_TYPE);
}
- public void setFileType(FileType fileType) {
+ public OnSystemRequest setFileType( FileType fileType) {
setParameters(KEY_FILE_TYPE, fileType);
+ return this;
}
/**
* @deprecated as of SmartDeviceLink 4.0
* @param offset of the data attached
*/
- public void setOffset(Integer offset) {
- if(offset == null){
+ public OnSystemRequest setOffset( Integer offset) {
+ if(offset == null){
setOffset((Long)null);
}else{
setOffset(offset.longValue());
}
+ return this;
}
public Long getOffset() {
@@ -329,8 +337,9 @@ public class OnSystemRequest extends RPCNotification {
return null;
}
- public void setOffset(Long offset) {
+ public OnSystemRequest setOffset( Long offset) {
setParameters(KEY_OFFSET, offset);
+ return this;
}
public Integer getTimeout() {
@@ -347,9 +356,10 @@ public class OnSystemRequest extends RPCNotification {
return null;
}
- public void setTimeout(Integer timeout) {
+ public OnSystemRequest setTimeout( Integer timeout) {
setParameters(KEY_TIMEOUT, timeout);
- }
+ return this;
+ }
public Long getLength() {
final Object o = getParameters(KEY_LENGTH);
@@ -369,15 +379,17 @@ public class OnSystemRequest extends RPCNotification {
* @deprecated as of SmartDeviceLink 4.0
* @param length of the data attached
*/
- public void setLength(Integer length) {
- if(length == null){
+ public OnSystemRequest setLength( Integer length) {
+ if(length == null){
setLength((Long)null);
}else{
setLength(length.longValue());
}
+ return this;
}
- public void setLength(Long length) {
+ public OnSystemRequest setLength( Long length) {
setParameters(KEY_LENGTH, length);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java
index c11eb1066..977e2afe9 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTBTClientState.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -104,8 +104,9 @@ public class OnTBTClientState extends RPCNotification {
/**
* <p>Called to set the current state of TBT client</p>
* @param state current state of TBT client
- */
- public void setState( TBTState state ) {
+ */
+ public OnTBTClientState setState( TBTState state) {
setParameters(KEY_STATE, state);
+ return this;
}
} // 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
index b898cc398..bdc83bfab 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnTouchEvent.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -109,16 +109,18 @@ public class OnTouchEvent extends RPCNotification {
setEvent(event);
}
- public void setType(@NonNull TouchType type) {
- setParameters(KEY_TYPE, type);
+ public OnTouchEvent setType(@NonNull TouchType type) {
+ setParameters(KEY_TYPE, type);
+ return this;
}
public TouchType getType() {
return (TouchType) getObject(TouchType.class, KEY_TYPE);
}
- public void setEvent(@NonNull List<TouchEvent> event) {
- setParameters(KEY_EVENT, event);
+ public OnTouchEvent setEvent(@NonNull List<TouchEvent> event) {
+ setParameters(KEY_EVENT, event);
+ return this;
}
@SuppressWarnings("unchecked")
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateFile.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateFile.java
index 2f1c63cf8..9a7b32c5c 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateFile.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateFile.java
@@ -96,8 +96,9 @@ public class OnUpdateFile extends RPCNotification {
*
* @param fileName File reference name.
*/
- public void setFileName(@NonNull String fileName) {
+ public OnUpdateFile setFileName(@NonNull String fileName) {
setParameters(KEY_FILE_NAME, fileName);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateSubMenu.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateSubMenu.java
index e6fb05829..1b12dd76a 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateSubMenu.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnUpdateSubMenu.java
@@ -62,7 +62,7 @@ import java.util.Hashtable;
* <tr>
* <td>updateSubCells</td>
* <td>Boolean</td>
- * <td>If not set, assume false. If true, the app should send AddCommands with parentIDs matchingthe menuID. These AddCommands will then be attached to the submenu and displayed if thesubmenu is selected.</td>
+ * <td>If not set, assume false. If true, the app should send AddCommands with parentIDs matching the menuID. These AddCommands will then be attached to the submenu and displayed if the submenu is selected.</td>
* <td>N</td>
* <td></td>
* </tr>
@@ -105,8 +105,9 @@ public class OnUpdateSubMenu extends RPCNotification {
*
* @param menuID This menuID must match a menuID in the current menu structure
*/
- public void setMenuID(@NonNull Integer menuID) {
+ public OnUpdateSubMenu setMenuID(@NonNull Integer menuID) {
setParameters(KEY_MENU_ID, menuID);
+ return this;
}
/**
@@ -125,8 +126,9 @@ public class OnUpdateSubMenu extends RPCNotification {
* the menuID. These AddCommands will then be attached to the submenu and displayed if the
* submenu is selected.
*/
- public void setUpdateSubCells(Boolean updateSubCells) {
+ public OnUpdateSubMenu setUpdateSubCells( Boolean updateSubCells) {
setParameters(KEY_UPDATE_SUB_CELLS, updateSubCells);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java
index 74fcda171..b18fd2c50 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnVehicleData.java
@@ -93,24 +93,32 @@ import java.util.List;
* </tr>
* <tr>
* <td>fuelLevel</td>
- * <td>Float</td>
- * <td>The fuel level in the tank (percentage)</td>
+ * <td>Boolean</td>
+ * <td>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec7.0, please see fuelRange.</td>
* <td>N</td>
* <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
+ * <td>SmartDeviceLink 7.0.0</td>
* </tr>
* <tr>
* <td>fuelLevel_State</td>
- * <td>ComponentVolumeStatus</td>
- * <td>The fuel level state (Ok/Low)</td>
+ * <td>Boolean</td>
+ * <td>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange.</td>
* <td>N</td>
* <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0</td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
+ * <tr>
+ * <td>fuelRange</td>
+ * <td>Boolean</td>
+ * <td>The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle. See struct FuelRange for details.</td>
+ * <td>N</td>
+ * <td>{"array_min_size": 0, "array_max_size": 100}</td>
+ * <td>SmartDeviceLink 5.0.0</td>
* </tr>
* <tr>
* <td>instantFuelConsumption</td>
* <td>Float</td>
- * <td>The instantaneous fuel consumption in microlitres</td>
+ * <td>The instantaneous fuel consumption in micro litres</td>
* <td>N</td>
* <td>Subscribable </td>
* <td>SmartDeviceLink 2.0</td>
@@ -210,7 +218,7 @@ import java.util.List;
* </tr>
* <tr>
* <td>emergencyEvent</td>
- * <td>EmergencyEvernt</td>
+ * <td>EmergencyEvent</td>
* <td>Information related to an emergency event (and if it occurred).</td>
* <td>N</td>
* <td>Subscribable</td>
@@ -311,6 +319,13 @@ import java.util.List;
* <td>N</td>
* <td>SmartDeviceLink 7.0.0</td>
* </tr>
+ * <tr>
+ * <td>stabilityControlsStatus</td>
+ * <td>StabilityControlsStatus</td>
+ * <td>See StabilityControlsStatus</td>
+ * <td>N</td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
* </table>
*
* @since SmartDeviceLink 1.0
@@ -324,7 +339,6 @@ 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";
@@ -332,7 +346,6 @@ public class OnVehicleData extends RPCNotification {
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";
@@ -354,7 +367,18 @@ public class OnVehicleData extends RPCNotification {
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
public static final String KEY_WINDOW_STATUS = "windowStatus";
public static final String KEY_GEAR_STATUS = "gearStatus";
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
public OnVehicleData() {
super(FunctionID.ON_VEHICLE_DATA.toString());
@@ -362,55 +386,80 @@ public class OnVehicleData extends RPCNotification {
public OnVehicleData(Hashtable<String, Object> hash) {
super(hash);
}
- public void setGps(GPSData gps) {
+ public OnVehicleData setGps( GPSData gps) {
setParameters(KEY_GPS, gps);
+ return this;
}
- @SuppressWarnings("unchecked")
public GPSData getGps() {
return (GPSData) getObject(GPSData.class, KEY_GPS);
}
- public void setSpeed(Double speed) {
+ public OnVehicleData setSpeed( Double speed) {
setParameters(KEY_SPEED, speed);
+ return this;
}
public Double getSpeed() {
Object object = getParameters(KEY_SPEED);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setRpm(Integer rpm) {
+ public OnVehicleData setRpm( Integer rpm) {
setParameters(KEY_RPM, rpm);
+ return this;
}
public Integer getRpm() {
return getInteger(KEY_RPM);
}
- public void setFuelLevel(Double fuelLevel) {
+
+ /**
+ * Sets the fuelLevel.
+ *
+ * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
+ */
+ @Deprecated
+ public OnVehicleData setFuelLevel( Double fuelLevel) {
setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ return this;
}
+
+ /**
+ * Gets the fuelLevel.
+ *
+ * @return Float The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
+ */
+ @Deprecated
public Double getFuelLevel() {
Object object = getParameters(KEY_FUEL_LEVEL);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setFuelLevelState(ComponentVolumeStatus fuelLevelState) {
+ @Deprecated
+ public OnVehicleData setFuelLevelState( ComponentVolumeStatus fuelLevelState) {
setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ return this;
}
+ @Deprecated
public ComponentVolumeStatus getFuelLevelState() {
return (ComponentVolumeStatus) getObject(ComponentVolumeStatus.class, KEY_FUEL_LEVEL_STATE);
}
- public void setInstantFuelConsumption(Double instantFuelConsumption) {
+ public OnVehicleData setInstantFuelConsumption( Double instantFuelConsumption) {
setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ return this;
}
public Double getInstantFuelConsumption() {
Object object = getParameters(KEY_INSTANT_FUEL_CONSUMPTION);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setExternalTemperature(Double externalTemperature) {
+ public OnVehicleData setExternalTemperature( Double externalTemperature) {
setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ return this;
}
public Double getExternalTemperature() {
Object object = getParameters(KEY_EXTERNAL_TEMPERATURE);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setVin(String vin) {
+ public OnVehicleData setVin( String vin) {
setParameters(KEY_VIN, vin);
+ return this;
}
public String getVin() {
return getString(KEY_VIN);
@@ -423,8 +472,9 @@ public class OnVehicleData extends RPCNotification {
* @deprecated in SmartDeviceLink 7.0.0
*/
@Deprecated
- public void setPrndl(PRNDL prndl) {
+ public OnVehicleData setPrndl( PRNDL prndl) {
setParameters(KEY_PRNDL, prndl);
+ return this;
}
/**
@@ -443,135 +493,151 @@ public class OnVehicleData extends RPCNotification {
*
* @param tirePressure See TireStatus
*/
- public void setTirePressure(TireStatus tirePressure) {
+ public OnVehicleData setTirePressure( TireStatus tirePressure) {
setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ return this;
}
- @SuppressWarnings("unchecked")
public TireStatus getTirePressure() {
return (TireStatus) getObject(TireStatus.class, KEY_TIRE_PRESSURE);
}
- public void setOdometer(Integer odometer) {
+ public OnVehicleData setOdometer( Integer odometer) {
setParameters(KEY_ODOMETER, odometer);
+ return this;
}
public Integer getOdometer() {
return getInteger(KEY_ODOMETER);
}
- public void setBeltStatus(BeltStatus beltStatus) {
+ public OnVehicleData setBeltStatus( BeltStatus beltStatus) {
setParameters(KEY_BELT_STATUS, beltStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public BeltStatus getBeltStatus() {
return (BeltStatus) getObject(BeltStatus.class, KEY_BELT_STATUS);
}
- public void setBodyInformation(BodyInformation bodyInformation) {
+ public OnVehicleData setBodyInformation( BodyInformation bodyInformation) {
setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ return this;
}
- @SuppressWarnings("unchecked")
public BodyInformation getBodyInformation() {
return (BodyInformation) getObject(BodyInformation.class, KEY_BODY_INFORMATION);
}
- public void setDeviceStatus(DeviceStatus deviceStatus) {
+ public OnVehicleData setDeviceStatus( DeviceStatus deviceStatus) {
setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public DeviceStatus getDeviceStatus() {
return (DeviceStatus) getObject(DeviceStatus.class, KEY_DEVICE_STATUS);
}
- public void setDriverBraking(VehicleDataEventStatus driverBraking) {
+ public OnVehicleData setDriverBraking( VehicleDataEventStatus driverBraking) {
setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ return this;
}
public VehicleDataEventStatus getDriverBraking() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_DRIVER_BRAKING);
}
- public void setWiperStatus(WiperStatus wiperStatus) {
+ public OnVehicleData setWiperStatus( WiperStatus wiperStatus) {
setParameters(KEY_WIPER_STATUS, wiperStatus);
+ return this;
}
public WiperStatus getWiperStatus() {
return (WiperStatus) getObject(WiperStatus.class, KEY_WIPER_STATUS);
}
- public void setHeadLampStatus(HeadLampStatus headLampStatus) {
+ public OnVehicleData setHeadLampStatus( HeadLampStatus headLampStatus) {
setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public HeadLampStatus getHeadLampStatus() {
return (HeadLampStatus) getObject(HeadLampStatus.class, KEY_HEAD_LAMP_STATUS);
}
- public void setEngineTorque(Double engineTorque) {
+ public OnVehicleData setEngineTorque( Double engineTorque) {
setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ return this;
}
public Double getEngineTorque() {
Object object = getParameters(KEY_ENGINE_TORQUE);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setEngineOilLife(Float engineOilLife) {
+ public OnVehicleData setEngineOilLife( Float engineOilLife) {
setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ return this;
}
public Float getEngineOilLife() {
Object object = getParameters(KEY_ENGINE_OIL_LIFE);
return SdlDataTypeConverter.objectToFloat(object);
}
- public void setAccPedalPosition(Double accPedalPosition) {
+ public OnVehicleData setAccPedalPosition( Double accPedalPosition) {
setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ return this;
}
public Double getAccPedalPosition() {
Object object = getParameters(KEY_ACC_PEDAL_POSITION);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setSteeringWheelAngle(Double steeringWheelAngle) {
+ public OnVehicleData setSteeringWheelAngle( Double steeringWheelAngle) {
setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ return this;
}
public Double getSteeringWheelAngle() {
Object object = getParameters(KEY_STEERING_WHEEL_ANGLE);
return SdlDataTypeConverter.objectToDouble(object);
}
- public void setECallInfo(ECallInfo eCallInfo) {
+ public OnVehicleData setECallInfo( ECallInfo eCallInfo) {
setParameters(KEY_E_CALL_INFO, eCallInfo);
+ return this;
}
- @SuppressWarnings("unchecked")
public ECallInfo getECallInfo() {
return (ECallInfo) getObject(ECallInfo.class, KEY_E_CALL_INFO);
}
- public void setAirbagStatus(AirbagStatus airbagStatus) {
+ public OnVehicleData setAirbagStatus( AirbagStatus airbagStatus) {
setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public AirbagStatus getAirbagStatus() {
return (AirbagStatus) getObject(AirbagStatus.class, KEY_AIRBAG_STATUS);
}
- public void setEmergencyEvent(EmergencyEvent emergencyEvent) {
+ public OnVehicleData setEmergencyEvent( EmergencyEvent emergencyEvent) {
setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ return this;
}
- @SuppressWarnings("unchecked")
public EmergencyEvent getEmergencyEvent() {
return (EmergencyEvent) getObject(EmergencyEvent.class, KEY_EMERGENCY_EVENT);
}
- public void setClusterModeStatus(ClusterModeStatus clusterModeStatus) {
+ public OnVehicleData setClusterModeStatus( ClusterModeStatus clusterModeStatus) {
setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public ClusterModeStatus getClusterModeStatus() {
return (ClusterModeStatus) getObject(ClusterModeStatus.class, KEY_CLUSTER_MODE_STATUS);
}
- public void setMyKey(MyKey myKey) {
+ public OnVehicleData setMyKey( MyKey myKey) {
setParameters(KEY_MY_KEY, myKey);
+ return this;
}
- @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
+ * Sets the fuelRange.
+ *
+ * @param fuelRange The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
+ * vehicle. See struct FuelRange for details.
+ * {"array_min_size": 0, "array_max_size": 100}
+ * @since SmartDeviceLink 5.0.0
*/
- public void setFuelRange(List<FuelRange> fuelRange) {
+ public OnVehicleData setFuelRange( List<FuelRange> fuelRange) {
setParameters(KEY_FUEL_RANGE, fuelRange);
+ return this;
}
/**
- * Gets Fuel Range List.
- * @return List<FuelRange>
- * Fuel Range - The estimate range in KM the vehicle can travel based on fuel level and consumption.
+ * Gets the fuelRange.
+ *
+ * @return List<FuelRange> The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
+ * vehicle. See struct FuelRange for details.
+ * {"array_min_size": 0, "array_max_size": 100}
+ * @since SmartDeviceLink 5.0.0
+
*/
@SuppressWarnings("unchecked")
public List<FuelRange> getFuelRange() {
@@ -582,15 +648,15 @@ public class OnVehicleData extends RPCNotification {
* Sets turnSignal
* @param turnSignal
*/
- public void setTurnSignal(TurnSignal turnSignal) {
+ public OnVehicleData setTurnSignal( TurnSignal turnSignal) {
setParameters(KEY_TURN_SIGNAL, turnSignal);
+ return this;
}
/**
* Gets turnSignal
* @return TurnSignal
*/
- @SuppressWarnings("unchecked")
public TurnSignal getTurnSignal() {
return (TurnSignal) getObject(TurnSignal.class, KEY_TURN_SIGNAL);
}
@@ -599,8 +665,9 @@ public class OnVehicleData extends RPCNotification {
* Sets electronicParkBrakeStatus
* @param electronicParkBrakeStatus
*/
- public void setElectronicParkBrakeStatus(ElectronicParkBrakeStatus electronicParkBrakeStatus){
+ public OnVehicleData setElectronicParkBrakeStatus( ElectronicParkBrakeStatus electronicParkBrakeStatus) {
setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ return this;
}
/**
@@ -615,8 +682,9 @@ public class OnVehicleData extends RPCNotification {
* Sets a string value for the cloud app vehicle ID
* @param cloudAppVehicleID a string value
*/
- public void setCloudAppVehicleID(String cloudAppVehicleID){
+ public OnVehicleData setCloudAppVehicleID( String cloudAppVehicleID) {
setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ return this;
}
/**
@@ -632,8 +700,9 @@ public class OnVehicleData extends RPCNotification {
* @param vehicleDataName a String value
* @param vehicleDataState a VehicleDataResult value
*/
- public void setOEMCustomVehicleData(String vehicleDataName, Object vehicleDataState){
+ public OnVehicleData setOEMCustomVehicleData( String vehicleDataName, Object vehicleDataState) {
setParameters(vehicleDataName, vehicleDataState);
+ return this;
}
/**
@@ -650,8 +719,9 @@ public class OnVehicleData extends RPCNotification {
* @param windowStatus See WindowStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setWindowStatus(List<WindowStatus> windowStatus) {
+ public OnVehicleData setWindowStatus( List<WindowStatus> windowStatus) {
setParameters(KEY_WINDOW_STATUS, windowStatus);
+ return this;
}
/**
@@ -666,13 +736,35 @@ public class OnVehicleData extends RPCNotification {
}
/**
+ * Gets the stabilityControlsStatus.
+ *
+ * @return StabilityControlsStatus See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public StabilityControlsStatus getStabilityControlsStatus() {
+ return (StabilityControlsStatus) getObject(StabilityControlsStatus.class, KEY_STABILITY_CONTROLS_STATUS);
+ }
+
+ /**
+ * Sets the stabilityControlsStatus.
+ *
+ * @param stabilityControlsStatus See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public OnVehicleData setStabilityControlsStatus( StabilityControlsStatus stabilityControlsStatus) {
+ setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
+ return this;
+ }
+
+ /**
* Sets the handsOffSteering.
*
* @param handsOffSteering To indicate whether driver hands are off the steering wheel
* @since SmartDeviceLink 7.0.0
*/
- public void setHandsOffSteering(Boolean handsOffSteering) {
+ public OnVehicleData setHandsOffSteering( Boolean handsOffSteering) {
setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
+ return this;
}
/**
@@ -690,8 +782,9 @@ public class OnVehicleData extends RPCNotification {
* @param gearStatus See GearStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setGearStatus(GearStatus gearStatus) {
+ public OnVehicleData setGearStatus( GearStatus gearStatus) {
setParameters(KEY_GEAR_STATUS, gearStatus);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java
index f204b6998..27809115b 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/OnWayPointChange.java
@@ -60,7 +60,8 @@ public class OnWayPointChange extends RPCNotification {
return (List<LocationDetails>) getObject(LocationDetails.class, KEY_WAY_POINTS);
}
- public void setWayPoints(@NonNull List<LocationDetails> wayPoints) {
- setParameters(KEY_WAY_POINTS, wayPoints);
- }
+ public OnWayPointChange setWayPoints(@NonNull List<LocationDetails> wayPoints) {
+ setParameters(KEY_WAY_POINTS, wayPoints);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java
index 4de4ad82c..be856f93b 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ParameterPermissions.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -63,7 +63,7 @@ import java.util.List;
* <tr>
* <td>userDisallowed</td>
* <td>String</td>
- * <td>A set of all parameters that are prohibated for this given RPC.
+ * <td>A set of all parameters that are prohibited for this given RPC.
* <ul>
* <li>Min size: 0</li>
* <li>Max size: 100</li>
@@ -116,8 +116,9 @@ public class ParameterPermissions extends RPCStruct {
* 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) {
+ public ParameterPermissions setAllowed(@NonNull List<String> allowed) {
setValue(KEY_ALLOWED, allowed);
+ return this;
}
/**
@@ -131,9 +132,10 @@ public class ParameterPermissions extends RPCStruct {
/**
* set a set of all parameters that are prohibited for this given RPC.
- * @param userDisallowed paramter that is prohibited for this given RPC
+ * @param userDisallowed parameter that is prohibited for this given RPC
*/
- public void setUserDisallowed(@NonNull List<String> userDisallowed) {
+ public ParameterPermissions setUserDisallowed(@NonNull List<String> userDisallowed) {
setValue(KEY_USER_DISALLOWED, userDisallowed);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java
index a71f1b25a..af70ab1c0 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteraction.java
@@ -67,9 +67,10 @@ public class PerformAppServiceInteraction extends RPCRequest {
* URI is correct.
* @param serviceUri -
*/
- public void setServiceUri(@NonNull String serviceUri){
- setParameters(KEY_SERVICE_URI, serviceUri);
- }
+ public PerformAppServiceInteraction setServiceUri(@NonNull String serviceUri) {
+ setParameters(KEY_SERVICE_URI, serviceUri);
+ return this;
+ }
/**
* Fully qualified URI based on a predetermined scheme provided by the app service. SDL makes no guarantee that this
@@ -84,9 +85,10 @@ public class PerformAppServiceInteraction extends RPCRequest {
* 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);
- }
+ public PerformAppServiceInteraction setServiceID(@NonNull String appServiceId) {
+ setParameters(KEY_SERVICE_ID, appServiceId);
+ return this;
+ }
/**
* The service ID that the app consumer wishes to send this URI.
@@ -100,9 +102,10 @@ public class PerformAppServiceInteraction extends RPCRequest {
* 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);
- }
+ public PerformAppServiceInteraction setOriginApp(@NonNull String originApp) {
+ setParameters(KEY_ORIGIN_APP, originApp);
+ return this;
+ }
/**
* This string is the appID of the app requesting the app service provider take the specific action.
@@ -117,9 +120,10 @@ public class PerformAppServiceInteraction extends RPCRequest {
* service of the destination's type.
* @param requestServiceActive -
*/
- public void setRequestServiceActive(Boolean requestServiceActive){
- setParameters(KEY_REQUEST_SERVICE_ACTIVE, requestServiceActive);
- }
+ public PerformAppServiceInteraction setRequestServiceActive( Boolean requestServiceActive) {
+ setParameters(KEY_REQUEST_SERVICE_ACTIVE, requestServiceActive);
+ return this;
+ }
/**
* This string is the appID of the app requesting the app service provider take the specific action.
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java
index cc6d5c5f4..481c91e17 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java
@@ -70,9 +70,10 @@ public class PerformAppServiceInteractionResponse extends RPCResponse {
* 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);
- }
+ public PerformAppServiceInteractionResponse setServiceSpecificResult( String serviceSpecificResult) {
+ setParameters(KEY_SERVICE_SPECIFIC_RESULT, serviceSpecificResult);
+ return this;
+ }
/**
* The service can provide specific result strings to the consumer through this param.
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java
index f9a4a29cb..0e125f8a7 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAudioPassThru.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -170,7 +170,7 @@ public class PerformAudioPassThru extends RPCRequest {
/**
* 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
@@ -185,8 +185,9 @@ public class PerformAudioPassThru extends RPCRequest {
* <li>Array Maxsize: 100</li>
* </ul>
*/
- public void setInitialPrompt(List<TTSChunk> initialPrompt) {
- setParameters(KEY_INITIAL_PROMPT, initialPrompt);
+ public PerformAudioPassThru setInitialPrompt( List<TTSChunk> initialPrompt) {
+ setParameters(KEY_INITIAL_PROMPT, initialPrompt);
+ return this;
}
/**
@@ -204,15 +205,16 @@ public class PerformAudioPassThru extends RPCRequest {
/**
* 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);
+ public PerformAudioPassThru setAudioPassThruDisplayText1( String audioPassThruDisplayText1) {
+ setParameters(KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_1, audioPassThruDisplayText1);
+ return this;
}
/**
@@ -227,15 +229,16 @@ public class PerformAudioPassThru extends RPCRequest {
/**
* 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);
+ public PerformAudioPassThru setAudioPassThruDisplayText2( String audioPassThruDisplayText2) {
+ setParameters(KEY_AUDIO_PASS_THRU_DISPLAY_TEXT_2, audioPassThruDisplayText2);
+ return this;
}
/**
@@ -250,12 +253,13 @@ public class PerformAudioPassThru extends RPCRequest {
/**
* 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);
+ public PerformAudioPassThru setSamplingRate(@NonNull SamplingRate samplingRate) {
+ setParameters(KEY_SAMPLING_RATE, samplingRate);
+ return this;
}
/**
@@ -269,15 +273,16 @@ public class PerformAudioPassThru extends RPCRequest {
/**
* 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);
+ public PerformAudioPassThru setMaxDuration(@NonNull Integer maxDuration) {
+ setParameters(KEY_MAX_DURATION, maxDuration);
+ return this;
}
/**
@@ -292,12 +297,13 @@ public class PerformAudioPassThru extends RPCRequest {
/**
* 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);
+ public PerformAudioPassThru setBitsPerSample(@NonNull BitsPerSample audioQuality) {
+ setParameters(KEY_BITS_PER_SAMPLE, audioQuality);
+ return this;
}
/**
@@ -311,12 +317,13 @@ public class PerformAudioPassThru extends RPCRequest {
/**
* Sets an audioType
- *
+ *
* @param audioType
* an audioType
*/
- public void setAudioType(@NonNull AudioType audioType) {
- setParameters(KEY_AUDIO_TYPE, audioType);
+ public PerformAudioPassThru setAudioType(@NonNull AudioType audioType) {
+ setParameters(KEY_AUDIO_TYPE, audioType);
+ return this;
}
/**
@@ -345,13 +352,14 @@ public class PerformAudioPassThru extends RPCRequest {
* 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);
- }
+ public PerformAudioPassThru setMuteAudio( Boolean muteAudio) {
+ setParameters(KEY_MUTE_AUDIO, muteAudio);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java
index 129825f6c..99efbb2ef 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteraction.java
@@ -207,12 +207,13 @@ public class PerformInteraction extends RPCRequest {
* 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);
+ */
+ public PerformInteraction setInitialText(@NonNull String initialText) {
+ setParameters(KEY_INITIAL_TEXT, initialText);
+ return this;
}
/**
* Gets an An array of one or more TTSChunks that, taken together, specify
@@ -228,13 +229,14 @@ public class PerformInteraction extends RPCRequest {
/**
* 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);
+ */
+ public PerformInteraction setInitialPrompt( List<TTSChunk> initialPrompt) {
+ setParameters(KEY_INITIAL_PROMPT, initialPrompt);
+ return this;
}
/**
* Gets the Indicates mode that indicate how user selects interaction
@@ -251,13 +253,14 @@ public class PerformInteraction extends RPCRequest {
* 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);
+ */
+ public PerformInteraction setInteractionMode(@NonNull InteractionMode interactionMode) {
+ setParameters(KEY_INTERACTION_MODE, interactionMode);
+ return this;
}
/**
* Gets a List<Integer> value representing an Array of one or more Choice
@@ -274,16 +277,17 @@ public class PerformInteraction extends RPCRequest {
/**
* 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);
+ */
+ public PerformInteraction setInteractionChoiceSetIDList(@NonNull List<Integer> interactionChoiceSetIDList) {
+ setParameters(KEY_INTERACTION_CHOICE_SET_ID_LIST, interactionChoiceSetIDList);
+ return this;
}
/**
* Gets a List<TTSChunk> which taken together, specify the help phrase to
@@ -307,14 +311,15 @@ public class PerformInteraction extends RPCRequest {
* <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);
+ */
+ public PerformInteraction setHelpPrompt( List<TTSChunk> helpPrompt) {
+ setParameters(KEY_HELP_PROMPT, helpPrompt);
+ return this;
}
/**
* Gets An array of TTSChunks which, taken together, specify the phrase to
@@ -333,13 +338,14 @@ public class PerformInteraction extends RPCRequest {
* <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);
+ */
+ public PerformInteraction setTimeoutPrompt( List<TTSChunk> timeoutPrompt) {
+ setParameters(KEY_TIMEOUT_PROMPT, timeoutPrompt);
+ return this;
}
/**
* Gets a Integer value representing the amount of time, in milliseconds,
@@ -360,16 +366,17 @@ public class PerformInteraction extends RPCRequest {
* 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);
+ */
+ public PerformInteraction setTimeout( Integer timeout) {
+ setParameters(KEY_TIMEOUT, timeout);
+ return this;
}
/**
@@ -396,8 +403,9 @@ public class PerformInteraction extends RPCRequest {
* <b>Notes: </b>Min=1; Max=100
* @since SmartDeviceLink 2.0
*/
- public void setVrHelp(List<VrHelpItem> vrHelp) {
- setParameters(KEY_VR_HELP, vrHelp);
+ public PerformInteraction setVrHelp( List<VrHelpItem> vrHelp) {
+ setParameters(KEY_VR_HELP, vrHelp);
+ return this;
}
/**
@@ -418,8 +426,9 @@ public class PerformInteraction extends RPCRequest {
*
* @since SmartDeviceLink 3.0
*/
- public void setInteractionLayout(LayoutMode interactionLayout ) {
- setParameters(KEY_INTERACTION_LAYOUT, interactionLayout);
+ public PerformInteraction setInteractionLayout( LayoutMode interactionLayout) {
+ setParameters(KEY_INTERACTION_LAYOUT, interactionLayout);
+ return this;
}
/**
@@ -440,7 +449,8 @@ public class PerformInteraction extends RPCRequest {
*
* @since SmartDeviceLink 6.0
*/
- public void setCancelID(Integer cancelID) {
- setParameters(KEY_CANCEL_ID, cancelID);
- }
+ public PerformInteraction setCancelID( Integer cancelID) {
+ setParameters(KEY_CANCEL_ID, cancelID);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java
index 20fec4c85..9bd0e37a9 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PerformInteractionResponse.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -88,9 +88,10 @@ public class PerformInteractionResponse extends RPCResponse {
/**
* Sets the application-scoped identifier that uniquely identifies this choice.
* @param choiceID Min: 0 Max: 65535
- */
- public void setChoiceID( Integer choiceID ) {
+ */
+ public PerformInteractionResponse setChoiceID( Integer choiceID) {
setParameters(KEY_CHOICE_ID, choiceID);
+ return this;
}
/**
* <p>Returns a <I>TriggerSource</I> object which will be shown in the HMI</p>
@@ -101,15 +102,17 @@ public class PerformInteractionResponse extends RPCResponse {
}
/**
* <p>Sets TriggerSource
- * Indicates whether command was selected via VR or via a menu selection (using the OK button).</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( TriggerSource triggerSource ) {
+ */
+ public PerformInteractionResponse setTriggerSource( TriggerSource triggerSource) {
setParameters(KEY_TRIGGER_SOURCE, triggerSource);
+ return this;
}
- public void setManualTextEntry(String manualTextEntry) {
+ public PerformInteractionResponse setManualTextEntry( String manualTextEntry) {
setParameters(KEY_MANUAL_TEXT_ENTRY, manualTextEntry);
+ return this;
}
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
index ce0ec00a7..830e27930 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PermissionItem.java
@@ -109,22 +109,23 @@ public class PermissionItem extends RPCStruct {
public String getRpcName() {
return getString(KEY_RPC_NAME);
}
- public void setRpcName(@NonNull String rpcName) {
+ public PermissionItem setRpcName(@NonNull String rpcName) {
setValue(KEY_RPC_NAME, rpcName);
+ return this;
}
- @SuppressWarnings("unchecked")
public HMIPermissions getHMIPermissions() {
return (HMIPermissions) getObject(HMIPermissions.class, KEY_HMI_PERMISSIONS);
}
- public void setHMIPermissions(@NonNull HMIPermissions hmiPermissions) {
+ public PermissionItem setHMIPermissions(@NonNull HMIPermissions hmiPermissions) {
setValue(KEY_HMI_PERMISSIONS, hmiPermissions);
+ return this;
}
- @SuppressWarnings("unchecked")
public ParameterPermissions getParameterPermissions() {
return (ParameterPermissions) getObject(ParameterPermissions.class, KEY_PARAMETER_PERMISSIONS);
}
- public void setParameterPermissions(@NonNull ParameterPermissions parameterPermissions) {
+ public PermissionItem setParameterPermissions(@NonNull ParameterPermissions parameterPermissions) {
setValue(KEY_PARAMETER_PERMISSIONS, parameterPermissions);
+ return this;
}
/**
@@ -139,7 +140,8 @@ public class PermissionItem extends RPCStruct {
* Sets the encryption requirement for this item
* @param isRequired the boolean requirement to be set
*/
- public void setRequireEncryption(Boolean isRequired) {
+ public PermissionItem setRequireEncryption( Boolean isRequired) {
setValue(KEY_REQUIRE_ENCRYPTION, isRequired);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java
index 348f23f25..bffabdf09 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PhoneCapability.java
@@ -52,7 +52,8 @@ public class PhoneCapability extends RPCStruct {
return getBoolean(KEY_DIALNUMBER_ENABLED);
}
- public void setDialNumberEnabled(Boolean dialNumberEnabled){
- setValue(KEY_DIALNUMBER_ENABLED, dialNumberEnabled);
- }
+ public PhoneCapability setDialNumberEnabled( Boolean dialNumberEnabled) {
+ setValue(KEY_DIALNUMBER_ENABLED, dialNumberEnabled);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java
index 4b218e143..cb59d5f6c 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PresetBankCapabilities.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -86,8 +86,9 @@ public class PresetBankCapabilities extends RPCStruct {
* 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);
+ public PresetBankCapabilities setOnScreenPresetsAvailable(@NonNull Boolean onScreenPresetsAvailable) {
+ setValue(KEY_ON_SCREEN_PRESETS_AVAILABLE, onScreenPresetsAvailable);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java
index 9c121bc22..bc3e48e33 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppService.java
@@ -79,9 +79,10 @@ public class PublishAppService extends RPCRequest {
* If already published, the updated manifest for this service.
* @param serviceManifest - the App Service Manifest
*/
- public void setAppServiceManifest(@NonNull AppServiceManifest serviceManifest){
- setParameters(KEY_APP_SERVICE_MANIFEST, serviceManifest);
- }
+ public PublishAppService setAppServiceManifest(@NonNull AppServiceManifest serviceManifest) {
+ setParameters(KEY_APP_SERVICE_MANIFEST, serviceManifest);
+ return this;
+ }
/**
* The manifest of the service that wishes to be published.
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java
index 6fcddfd47..d52a310dd 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PublishAppServiceResponse.java
@@ -70,9 +70,10 @@ public class PublishAppServiceResponse extends RPCResponse {
* 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);
- }
+ public PublishAppServiceResponse setServiceRecord( AppServiceRecord appServiceRecord) {
+ setParameters(KEY_APP_SERVICE_RECORD, appServiceRecord);
+ return this;
+ }
/**
* If the request was successful, this object will be the current status of the service record
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java
index 2d01d9a47..da4adfb1d 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFile.java
@@ -189,14 +189,15 @@ public class PutFile extends RPCRequest {
/**
* 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) {
+ public PutFile setSdlFileName(@NonNull String sdlFileName) {
setParameters(KEY_SDL_FILE_NAME, sdlFileName);
+ return this;
}
/**
@@ -210,12 +211,13 @@ public class PutFile extends RPCRequest {
/**
* Sets file type
- *
+ *
* @param fileType
* a FileType value representing a selected file type
*/
- public void setFileType(@NonNull FileType fileType) {
+ public PutFile setFileType(@NonNull FileType fileType) {
setParameters(KEY_FILE_TYPE, fileType);
+ return this;
}
/**
@@ -236,12 +238,13 @@ public class PutFile extends RPCRequest {
* 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) {
+ public PutFile setPersistentFile( Boolean persistentFile) {
setParameters(KEY_PERSISTENT_FILE, persistentFile);
+ return this;
}
/**
@@ -254,8 +257,9 @@ public class PutFile extends RPCRequest {
public Boolean getPersistentFile() {
return getBoolean(KEY_PERSISTENT_FILE);
}
- public void setFileData(byte[] fileData) {
+ public PutFile setFileData( byte[] fileData) {
setBulkData(fileData);
+ return this;
}
public byte[] getFileData() {
return getBulkData();
@@ -265,19 +269,21 @@ public class PutFile extends RPCRequest {
* @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){
+ public PutFile setOffset( Integer offset) {
+ if(offset == null){
setOffset((Long)null);
}else{
setOffset(offset.longValue());
}
+ return this;
}
/**
* @param offset Optional offset in bytes for resuming partial data chunks
*/
- public void setOffset(Long offset) {
+ public PutFile setOffset( Long offset) {
setParameters(KEY_OFFSET, offset);
+ return this;
}
public Long getOffset() {
@@ -300,20 +306,22 @@ public class PutFile extends RPCRequest {
* @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){
+ public PutFile setLength( Integer length) {
+ if(length == null){
setLength((Long)null);
}else{
setLength(length.longValue());
}
+ return this;
}
/**
* @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) {
+ public PutFile setLength( Long length) {
setParameters(KEY_LENGTH, length);
+ return this;
}
public Long getLength() {
@@ -330,8 +338,9 @@ public class PutFile extends RPCRequest {
return null;
}
- public void setSystemFile(Boolean systemFile) {
+ public PutFile setSystemFile( Boolean systemFile) {
setParameters(KEY_SYSTEM_FILE, systemFile);
+ return this;
}
public Boolean getSystemFile() {
@@ -348,15 +357,16 @@ public class PutFile extends RPCRequest {
* CRC32 for it.
* @param fileData - the file as a byte array
*/
- public void setCRC(byte[] fileData) {
- if (fileData != null) {
+ public PutFile setCRC( byte[] fileData) {
+ if (fileData != null) {
CRC32 crc = new CRC32();
crc.update(fileData);
parameters.put(KEY_CRC, crc.getValue());
} else {
parameters.remove(KEY_CRC);
}
- }
+ return this;
+ }
/**
* This assumes you have created your own CRC32 and are setting it with the file
@@ -364,13 +374,14 @@ public class PutFile extends RPCRequest {
* included in java.util</STRONG>
* @param crc - the CRC32 of the file being set
*/
- public void setCRC(Long crc) {
- if (crc != null) {
+ public PutFile setCRC( Long crc) {
+ if (crc != null) {
parameters.put(KEY_CRC, crc);
} else {
parameters.remove(KEY_CRC);
}
- }
+ return this;
+ }
/**
* This returns the CRC, if it has been set, for the file object
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java
index e1bf71a43..1bc5a6887 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/PutFileResponse.java
@@ -97,8 +97,9 @@ public class PutFileResponse extends RPCResponse {
super.format(rpcVersion, formatParams);
}
- public void setSpaceAvailable(Integer spaceAvailable) {
+ public PutFileResponse setSpaceAvailable( Integer spaceAvailable) {
setParameters(KEY_SPACE_AVAILABLE, spaceAvailable);
+ return this;
}
public Integer getSpaceAvailable() {
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java
index 0cac1951d..0a22821ac 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RGBColor.java
@@ -121,10 +121,11 @@ public class RGBColor extends RPCStruct{
* Sets the red value of the color object
* @param color red value - min: 0; max: 255
*/
- public void setRed(Integer color) {
+ public RGBColor setRed( Integer color) {
if (color != null && color >= MIN_VALUE && color <= MAX_VALUE) {
setValue(KEY_RED, color);
}
+ return this;
}
/**
@@ -139,10 +140,11 @@ public class RGBColor extends RPCStruct{
* Sets the green value of the color object
* @param color green value - min: 0; max: 255
*/
- public void setGreen(Integer color) {
+ public RGBColor setGreen( Integer color) {
if (color != null && color >= MIN_VALUE && color <= MAX_VALUE) {
setValue(KEY_GREEN, color);
}
+ return this;
}
/**
@@ -157,10 +159,11 @@ public class RGBColor extends RPCStruct{
* Sets the blue value of the color object
* @param color blue value - min: 0; max: 255
*/
- public void setBlue(Integer color) {
+ public RGBColor setBlue( Integer color) {
if (color != null && color >= MIN_VALUE && color <= MAX_VALUE) {
setValue(KEY_BLUE, color);
}
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java
index 8ab552526..0b6297b68 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlCapabilities.java
@@ -81,8 +81,9 @@ public class RadioControlCapabilities extends RPCStruct{
* 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) {
+ public RadioControlCapabilities setModuleName(@NonNull String moduleName) {
setValue(KEY_MODULE_NAME, moduleName);
+ return this;
}
/**
@@ -101,8 +102,9 @@ public class RadioControlCapabilities extends RPCStruct{
* Availability of the control of enable/disable radio.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setRadioEnableAvailable(Boolean radioEnableAvailable) {
+ public RadioControlCapabilities setRadioEnableAvailable( Boolean radioEnableAvailable) {
setValue(KEY_RADIO_ENABLE_AVAILABLE, radioEnableAvailable);
+ return this;
}
/**
@@ -122,8 +124,9 @@ public class RadioControlCapabilities extends RPCStruct{
* Availability of the control of radio band.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setRadioBandAvailable(Boolean radioBandAvailable) {
+ public RadioControlCapabilities setRadioBandAvailable( Boolean radioBandAvailable) {
setValue(KEY_RADIO_BAND_AVAILABLE, radioBandAvailable);
+ return this;
}
/**
@@ -143,8 +146,9 @@ public class RadioControlCapabilities extends RPCStruct{
* Availability of the control of radio frequency.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setRadioFrequencyAvailable(Boolean radioFrequencyAvailable) {
+ public RadioControlCapabilities setRadioFrequencyAvailable( Boolean radioFrequencyAvailable) {
setValue(KEY_RADIO_FREQUENCY_AVAILABLE, radioFrequencyAvailable);
+ return this;
}
/**
@@ -164,8 +168,9 @@ public class RadioControlCapabilities extends RPCStruct{
* Availability of the control of HD radio channel.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setHdChannelAvailable(Boolean hdChannelAvailable) {
+ public RadioControlCapabilities setHdChannelAvailable( Boolean hdChannelAvailable) {
setValue(KEY_HD_CHANNEL_AVAILABLE, hdChannelAvailable);
+ return this;
}
/**
@@ -185,8 +190,9 @@ public class RadioControlCapabilities extends RPCStruct{
* Availability of the getting Radio Data System (RDS) data.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setRdsDataAvailable(Boolean rdsDataAvailable) {
+ public RadioControlCapabilities setRdsDataAvailable( Boolean rdsDataAvailable) {
setValue(KEY_RDS_DATA_AVAILABLE, rdsDataAvailable);
+ return this;
}
/**
@@ -207,8 +213,9 @@ public class RadioControlCapabilities extends RPCStruct{
* True: Available, False: Not Available, Not present: Not Available.
*/
@Deprecated
- public void setAvailableHDsAvailable(Boolean availableHDsAvailable) {
+ public RadioControlCapabilities setAvailableHDsAvailable( Boolean availableHDsAvailable) {
setValue(KEY_AVAILABLE_HDS_AVAILABLE, availableHDsAvailable);
+ return this;
}
/**
@@ -229,8 +236,9 @@ public class RadioControlCapabilities extends RPCStruct{
* Availability of the list of available HD sub-channel indexes.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setAvailableHdChannelsAvailable(Boolean availableHdChannelsAvailable) {
+ public RadioControlCapabilities setAvailableHdChannelsAvailable( Boolean availableHdChannelsAvailable) {
setValue(KEY_AVAILABLE_HD_CHANNELS_AVAILABLE, availableHdChannelsAvailable);
+ return this;
}
/**
@@ -250,8 +258,9 @@ public class RadioControlCapabilities extends RPCStruct{
* Availability of the getting the Radio state.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setStateAvailable(Boolean stateAvailable) {
+ public RadioControlCapabilities setStateAvailable( Boolean stateAvailable) {
setValue(KEY_STATE_AVAILABLE, stateAvailable);
+ return this;
}
/**
@@ -271,8 +280,9 @@ public class RadioControlCapabilities extends RPCStruct{
* Availability of the getting the signal strength.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setSignalStrengthAvailable(Boolean signalStrengthAvailable) {
+ public RadioControlCapabilities setSignalStrengthAvailable( Boolean signalStrengthAvailable) {
setValue(KEY_SIGNAL_STRENGTH_AVAILABLE, signalStrengthAvailable);
+ return this;
}
/**
@@ -292,8 +302,9 @@ public class RadioControlCapabilities extends RPCStruct{
* Availability of the getting the signal Change Threshold.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setSignalChangeThresholdAvailable(Boolean signalChangeThresholdAvailable) {
+ public RadioControlCapabilities setSignalChangeThresholdAvailable( Boolean signalChangeThresholdAvailable) {
setValue(KEY_SIGNAL_CHANGE_THRESHOLD_AVAILABLE, signalChangeThresholdAvailable);
+ return this;
}
/**
@@ -312,8 +323,9 @@ public class RadioControlCapabilities extends RPCStruct{
* @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) {
+ public RadioControlCapabilities setHdRadioEnableAvailable( Boolean hdRadioEnableAvailable) {
setValue(KEY_HD_RADIO_ENABLE_AVAILABLE, hdRadioEnableAvailable);
+ return this;
}
/**
@@ -332,8 +344,9 @@ public class RadioControlCapabilities extends RPCStruct{
* @param siriusxmRadioAvailable Availability of sirius XM radio.
* True: Available, False: Not Available, Not present: Not Available.
*/
- public void setSiriusXMRadioAvailable(Boolean siriusxmRadioAvailable) {
+ public RadioControlCapabilities setSiriusXMRadioAvailable( Boolean siriusxmRadioAvailable) {
setValue(KEY_SIRIUS_XM_RADIO_AVAILABLE, siriusxmRadioAvailable);
+ return this;
}
/**
@@ -352,8 +365,9 @@ public class RadioControlCapabilities extends RPCStruct{
* @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) {
+ public RadioControlCapabilities setSisDataAvailable( Boolean sisDataAvailable) {
setValue(KEY_SIS_DATA_AVAILABLE, sisDataAvailable);
+ return this;
}
/**
@@ -370,8 +384,9 @@ public class RadioControlCapabilities extends RPCStruct{
* Sets ModuleInfo for this capability
* @param info the ModuleInfo to be set
*/
- public void setModuleInfo(ModuleInfo info) {
+ public RadioControlCapabilities setModuleInfo( ModuleInfo info) {
setValue(KEY_MODULE_INFO, info);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java
index 86cd9c962..433d7ad28 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RadioControlData.java
@@ -70,8 +70,9 @@ public class RadioControlData extends RPCStruct{
* @param frequencyInteger
* The integer part of the frequency i.e. for 101.7 this value should be 101
*/
- public void setFrequencyInteger(Integer frequencyInteger) {
+ public RadioControlData setFrequencyInteger( Integer frequencyInteger) {
setValue(KEY_FREQUENCY_INTEGER, frequencyInteger);
+ return this;
}
/**
@@ -89,8 +90,9 @@ public class RadioControlData extends RPCStruct{
* @param frequencyFraction
* The fractional part of the frequency i.e. for 101.7 is 7.
*/
- public void setFrequencyFraction(Integer frequencyFraction) {
+ public RadioControlData setFrequencyFraction( Integer frequencyFraction) {
setValue(KEY_FREQUENCY_FRACTION, frequencyFraction);
+ return this;
}
/**
@@ -108,8 +110,9 @@ public class RadioControlData extends RPCStruct{
* @param band
* The radio band (AM|FM|XM) of the radio tuner.
*/
- public void setBand(RadioBand band) {
+ public RadioControlData setBand( RadioBand band) {
setValue(KEY_BAND, band);
+ return this;
}
/**
@@ -127,8 +130,9 @@ public class RadioControlData extends RPCStruct{
* @param rdsData
* Read only parameter. See RdsData data type for details.
*/
- public void setRdsData(RdsData rdsData) {
+ public RadioControlData setRdsData( RdsData rdsData) {
setValue(KEY_RDS_DATA, rdsData);
+ return this;
}
/**
@@ -147,8 +151,9 @@ public class RadioControlData extends RPCStruct{
* Number of HD sub-channels if available.
*/
@Deprecated
- public void setAvailableHDs(Integer availableHDs) {
+ public RadioControlData setAvailableHDs( Integer availableHDs) {
setValue(KEY_AVAILABLE_HDS, availableHDs);
+ return this;
}
/**
@@ -167,8 +172,9 @@ public class RadioControlData extends RPCStruct{
* @param hdChannel
* Current HD sub-channel if available.
*/
- public void setHdChannel(Integer hdChannel) {
+ public RadioControlData setHdChannel( Integer hdChannel) {
setValue(KEY_HD_CHANNEL, hdChannel);
+ return this;
}
/**
@@ -186,8 +192,9 @@ public class RadioControlData extends RPCStruct{
* @param signalStrength
* Read only parameter. Indicates the strength of receiving radio signal in current frequency.
*/
- public void setSignalStrength(Integer signalStrength) {
+ public RadioControlData setSignalStrength( Integer signalStrength) {
setValue(KEY_SIGNAL_STRENGTH, signalStrength);
+ return this;
}
/**
@@ -205,8 +212,9 @@ public class RadioControlData extends RPCStruct{
* @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) {
+ public RadioControlData setSignalChangeThreshold( Integer signalChangeThreshold) {
setValue(KEY_SIGNAL_CHANGE_THRESHOLD, signalChangeThreshold);
+ return this;
}
/**
@@ -226,8 +234,9 @@ public class RadioControlData extends RPCStruct{
* @param radioEnable
* True if the radio is on, false is the radio is off.
*/
- public void setRadioEnable(Boolean radioEnable) {
+ public RadioControlData setRadioEnable( Boolean radioEnable) {
setValue(KEY_RADIO_ENABLE, radioEnable);
+ return this;
}
/**
@@ -246,8 +255,9 @@ public class RadioControlData extends RPCStruct{
* @param state
* Read only parameter. See RadioState data type for details.
*/
- public void setState(RadioState state) {
+ public RadioControlData setState( RadioState state) {
setValue(KEY_STATE, state);
+ return this;
}
/**
@@ -264,8 +274,9 @@ public class RadioControlData extends RPCStruct{
*
* @param hdRadioEnable True if the hd radio is on, false if the radio is off.
*/
- public void setHdRadioEnable(Boolean hdRadioEnable) {
+ public RadioControlData setHdRadioEnable( Boolean hdRadioEnable) {
setValue(KEY_HD_RADIO_ENABLE, hdRadioEnable);
+ return this;
}
/**
@@ -282,8 +293,9 @@ public class RadioControlData extends RPCStruct{
*
* @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) {
+ public RadioControlData setSisData( SisData sisData) {
setValue(KEY_SIS_DATA, sisData);
+ return this;
}
/**
@@ -300,8 +312,9 @@ public class RadioControlData extends RPCStruct{
*
* @param availableHdChannels List of available hd sub-channel indexes, empty list means no Hd channel is available, read-only.
*/
- public void setAvailableHdChannels(List<Integer> availableHdChannels){
+ public RadioControlData setAvailableHdChannels( List<Integer> availableHdChannels) {
setValue(KEY_AVAILABLE_HD_CHANNELS, availableHdChannels);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RdsData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RdsData.java
index 29326e550..223adebd7 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/RdsData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RdsData.java
@@ -62,8 +62,9 @@ public class RdsData extends RPCStruct{
* @param programService
* Program Service Name.
*/
- public void setProgramService(String programService) {
+ public RdsData setProgramService( String programService) {
setValue(KEY_PS, programService);
+ return this;
}
/**
@@ -81,8 +82,9 @@ public class RdsData extends RPCStruct{
* @param radioText
* Radio Text.
*/
- public void setRadioText(String radioText) {
+ public RdsData setRadioText( String radioText) {
setValue(KEY_RT, radioText);
+ return this;
}
/**
@@ -100,8 +102,9 @@ public class RdsData extends RPCStruct{
* @param clockText
* The clock text in UTC format as YYYY-MM-DDThh:mm:ss.sTZD.
*/
- public void setClockText(String clockText) {
+ public RdsData setClockText( String clockText) {
setValue(KEY_CT, clockText);
+ return this;
}
/**
@@ -119,8 +122,9 @@ public class RdsData extends RPCStruct{
* @param programIdentification
* Program Identification - the call sign for the radio station.
*/
- public void setProgramIdentification(String programIdentification) {
+ public RdsData setProgramIdentification( String programIdentification) {
setValue(KEY_PI, programIdentification);
+ return this;
}
/**
@@ -138,8 +142,9 @@ public class RdsData extends RPCStruct{
* @param region
* Region.
*/
- public void setRegion(String region) {
+ public RdsData setRegion( String region) {
setValue(KEY_REG, region);
+ return this;
}
/**
@@ -157,8 +162,9 @@ public class RdsData extends RPCStruct{
* @param trafficProgram
* Traffic Program Identification - Identifies a station that offers traffic.
*/
- public void setTrafficProgram(Boolean trafficProgram) {
+ public RdsData setTrafficProgram( Boolean trafficProgram) {
setValue(KEY_TP, trafficProgram);
+ return this;
}
/**
@@ -176,8 +182,9 @@ public class RdsData extends RPCStruct{
* @param trafficAnnouncement
* Traffic Announcement Identification - Indicates an ongoing traffic announcement.
*/
- public void setTrafficAnnouncement(Boolean trafficAnnouncement) {
+ public RdsData setTrafficAnnouncement( Boolean trafficAnnouncement) {
setValue(KEY_TA, trafficAnnouncement);
+ return this;
}
/**
@@ -195,8 +202,9 @@ public class RdsData extends RPCStruct{
* @param programType
* The program type - The region should be used to differentiate between EU and North America program types.
*/
- public void setProgramType(Integer programType) {
+ public RdsData setProgramType( Integer programType) {
setValue(KEY_PTY, programType);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java
index 553922e0f..b72524eeb 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDID.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -139,14 +139,15 @@ public class ReadDID extends RPCRequest {
/**
* 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);
+ public ReadDID setEcuName(@NonNull Integer ecuName) {
+ setParameters(KEY_ECU_NAME, ecuName);
+ return this;
}
/**
@@ -161,7 +162,7 @@ public class ReadDID extends RPCRequest {
/**
* Sets raw data from vehicle data DID location(s)
- *
+ *
* @param didLocation
* a List<Integer> value representing raw data from vehicle
* data DID location(s)
@@ -172,8 +173,9 @@ public class ReadDID extends RPCRequest {
* <li>ArrayMin:0; ArrayMax:1000</li>
* </ul>
*/
- public void setDidLocation(@NonNull List<Integer> didLocation) {
- setParameters(KEY_DID_LOCATION, didLocation);
+ public ReadDID setDidLocation(@NonNull List<Integer> didLocation) {
+ setParameters(KEY_DID_LOCATION, didLocation);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java
index 41694c446..61158da36 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReadDIDResponse.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -64,8 +64,9 @@ public class ReadDIDResponse extends RPCResponse {
setSuccess(success);
setResultCode(resultCode);
}
- public void setDidResult(List<DIDResult> didResult) {
- setParameters(KEY_DID_RESULT, didResult);
+ public ReadDIDResponse setDidResult( List<DIDResult> didResult) {
+ setParameters(KEY_DID_RESULT, didResult);
+ return this;
}
@SuppressWarnings("unchecked")
public List<DIDResult> getDidResult() {
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java
index fc7f16c26..69f6c26ef 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Rectangle.java
@@ -64,9 +64,10 @@ public class Rectangle extends RPCStruct {
/**
* Set the X-coordinate pixel in of the user control that starts in the upper left corner
*/
- public void setX(@NonNull Float x) {
- setValue(KEY_X, x);
- }
+ public Rectangle setX(@NonNull Float x) {
+ setValue(KEY_X, x);
+ return this;
+ }
/**
* @return the X-coordinate pixel of the user control that starts in the upper left corner
@@ -78,9 +79,10 @@ public class Rectangle extends RPCStruct {
/**
* Set the Y-coordinate pixel of the user control that starts in the upper left corner
*/
- public void setY(@NonNull Float y) {
- setValue(KEY_Y, y);
- }
+ public Rectangle setY(@NonNull Float y) {
+ setValue(KEY_Y, y);
+ return this;
+ }
/**
* @return the Y-coordinate pixel of the user control that starts in the upper left corner
@@ -92,9 +94,10 @@ public class Rectangle extends RPCStruct {
/**
* Set the width in pixels of the user control's bounding rectangle in pixels
*/
- public void setWidth(@NonNull Float width) {
- setValue(KEY_WIDTH, width);
- }
+ public Rectangle setWidth(@NonNull Float width) {
+ setValue(KEY_WIDTH, width);
+ return this;
+ }
/**
* @return the width in pixels of the user control's bounding rectangle in pixels
@@ -106,9 +109,10 @@ public class Rectangle extends RPCStruct {
/**
* The height in pixels of the user control's bounding rectangle
*/
- public void setHeight(@NonNull Float height) {
- setValue(KEY_HEIGHT, height);
- }
+ public Rectangle setHeight(@NonNull Float height) {
+ setValue(KEY_HEIGHT, height);
+ return this;
+ }
/**
* @return the width in pixels of the user control's bounding rectangle in pixels
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java
index ee741f7c1..ca2bc9d47 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterface.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -195,13 +195,13 @@ import java.util.List;
* <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>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>Various information about connecting device.</td>
* <td>N</td>
* <td></td>
* <td>SmartDeviceLink 2.3.1 </td>
@@ -211,7 +211,7 @@ import java.util.List;
* <td>String</td>
* <td>ID used to validate app with policy table entries</td>
* <td>Y</td>
- * <td>Maxlength: 100</td>
+ * <td>maxLength: 100</td>
* <td>SmartDeviceLink 2.0 </td>
* </tr>
* <tr>
@@ -334,7 +334,7 @@ public class RegisterAppInterface extends RPCRequest {
* @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
+ * <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) {
@@ -352,13 +352,12 @@ public class RegisterAppInterface extends RPCRequest {
* @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
@@ -375,19 +374,20 @@ public class RegisterAppInterface extends RPCRequest {
* number sent from the app to SDL&reg; (in RegisterAppInterface
* request) is ignored by SDL&reg;
*
- */
- public void setSdlMsgVersion(@NonNull SdlMsgVersion sdlMsgVersion) {
+ */
+ public RegisterAppInterface setSdlMsgVersion(@NonNull SdlMsgVersion sdlMsgVersion) {
setParameters(KEY_SDL_MSG_VERSION, sdlMsgVersion);
+ return this;
}
- @SuppressWarnings("unchecked")
public DeviceInfo getDeviceInfo() {
return (DeviceInfo) getObject(DeviceInfo.class, KEY_DEVICE_INFO);
}
- public void setDeviceInfo(DeviceInfo deviceInfo) {
- setParameters(KEY_DEVICE_INFO, deviceInfo);
- }
+ public RegisterAppInterface setDeviceInfo( DeviceInfo deviceInfo) {
+ setParameters(KEY_DEVICE_INFO, deviceInfo);
+ return this;
+ }
/**
* Gets Mobile Application's Name
*
@@ -400,7 +400,7 @@ public class RegisterAppInterface extends RPCRequest {
* 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>
@@ -411,9 +411,10 @@ public class RegisterAppInterface extends RPCRequest {
* the name or any synonym of any currently-registered
* application</li>
* </ul>
- */
- public void setAppName(@NonNull String appName) {
- setParameters(KEY_APP_NAME, appName);
+ */
+ public RegisterAppInterface setAppName(@NonNull String appName) {
+ setParameters(KEY_APP_NAME, appName);
+ return this;
}
/**
@@ -428,9 +429,9 @@ public class RegisterAppInterface extends RPCRequest {
}
/**
- *
+ *
* @param ttsName
- * a List<TTSChunk> value represeting the TTS Name
+ * a List<TTSChunk> value representing the TTS Name
* <p></p>
* <b>Notes: </b>
* <ul>
@@ -445,28 +446,29 @@ public class RegisterAppInterface extends RPCRequest {
* </ul>
* @since SmartDeviceLink 2.0
*/
- public void setTtsName(List<TTSChunk> ttsName) {
- setParameters(KEY_TTS_NAME, ttsName);
+ public RegisterAppInterface setTtsName( List<TTSChunk> ttsName) {
+ setParameters(KEY_TTS_NAME, ttsName);
+ return this;
}
/**
* Gets a String representing an abbreviated version of the mobile
- * applincation's name (if necessary) that will be displayed on the NGN
+ * application'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
+ * mobile application'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
+ * application'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
+ * mobile application's name
* <p></p>
* <b>Notes: </b>
* <ul>
@@ -474,9 +476,10 @@ public class RegisterAppInterface extends RPCRequest {
* <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);
+ */
+ public RegisterAppInterface setNgnMediaScreenAppName( String ngnMediaScreenAppName) {
+ setParameters(KEY_NGN_MEDIA_SCREEN_APP_NAME, ngnMediaScreenAppName);
+ return this;
}
/**
* Gets the List<String> representing the an array of 1-100 elements, each
@@ -493,7 +496,7 @@ public class RegisterAppInterface extends RPCRequest {
/**
* 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
@@ -506,9 +509,10 @@ public class RegisterAppInterface extends RPCRequest {
* the name or any synonym of any currently-registered
* application</li>
* </ul>
- */
- public void setVrSynonyms(List<String> vrSynonyms) {
- setParameters(KEY_VR_SYNONYMS, vrSynonyms);
+ */
+ public RegisterAppInterface setVrSynonyms( List<String> vrSynonyms) {
+ setParameters(KEY_VR_SYNONYMS, vrSynonyms);
+ return this;
}
/**
* Gets a Boolean representing MediaApplication
@@ -522,12 +526,13 @@ public class RegisterAppInterface extends RPCRequest {
/**
* 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);
+ */
+ public RegisterAppInterface setIsMediaApplication(@NonNull Boolean isMediaApplication) {
+ setParameters(KEY_IS_MEDIA_APPLICATION, isMediaApplication);
+ return this;
}
/**
* Gets a Language enumeration indicating what language the application
@@ -541,14 +546,15 @@ public class RegisterAppInterface extends RPCRequest {
/**
* 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);
+ *
+ *
+ */
+ public RegisterAppInterface setLanguageDesired(@NonNull Language languageDesired) {
+ setParameters(KEY_LANGUAGE_DESIRED, languageDesired);
+ return this;
}
/**
@@ -567,12 +573,13 @@ public class RegisterAppInterface extends RPCRequest {
/**
* 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);
+ public RegisterAppInterface setHmiDisplayLanguageDesired(@NonNull Language hmiDisplayLanguageDesired) {
+ setParameters(KEY_HMI_DISPLAY_LANGUAGE_DESIRED, hmiDisplayLanguageDesired);
+ return this;
}
/**
@@ -583,7 +590,7 @@ public class RegisterAppInterface extends RPCRequest {
* @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
+ * @since SmartDeviceLink 2.0
*/
@SuppressWarnings("unchecked")
public List<AppHMIType> getAppHMIType() {
@@ -594,7 +601,7 @@ public class RegisterAppInterface extends RPCRequest {
* 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>
@@ -605,16 +612,18 @@ public class RegisterAppInterface extends RPCRequest {
* </ul>
* @since SmartDeviceLink 2.0
*/
- public void setAppHMIType(List<AppHMIType> appHMIType) {
- setParameters(KEY_APP_HMI_TYPE, appHMIType);
+ public RegisterAppInterface setAppHMIType( List<AppHMIType> appHMIType) {
+ setParameters(KEY_APP_HMI_TYPE, appHMIType);
+ return this;
}
public String getHashID() {
return getString(KEY_HASH_ID);
}
- public void setHashID(String hashID) {
- setParameters(KEY_HASH_ID, hashID);
+ public RegisterAppInterface setHashID( String hashID) {
+ setParameters(KEY_HASH_ID, hashID);
+ return this;
}
/**
@@ -629,9 +638,10 @@ public class RegisterAppInterface extends RPCRequest {
* Sets detailed information about the registered application
* @param appInfo - detailed information about the registered application
*/
- public void setAppInfo(AppInfo appInfo) {
- setParameters(KEY_APP_INFO, appInfo);
- }
+ public RegisterAppInterface setAppInfo( AppInfo appInfo) {
+ setParameters(KEY_APP_INFO, appInfo);
+ return this;
+ }
/**
* Gets the unique ID, which an app will be given when approved
@@ -651,16 +661,17 @@ public class RegisterAppInterface extends RPCRequest {
* a String value representing a unique ID, which an app will be
* given when approved
* <p></p>
- * <b>Notes: </b>Maxlength = 100
+ * <b>Notes: </b>maxLength = 100
* @since SmartDeviceLink 2.0
*/
- public void setAppID(@NonNull String appID) {
- if (appID != null) {
+ public RegisterAppInterface setAppID(@NonNull String appID) {
+ if (appID != null) {
setParameters(KEY_APP_ID, appID.toLowerCase());
} else {
setParameters(KEY_APP_ID, appID);
}
- }
+ return this;
+ }
/**
* Gets the unique ID, which an app will be given when approved
@@ -680,11 +691,11 @@ public class RegisterAppInterface extends RPCRequest {
* a String value representing a unique ID, which an app will be
* given when approved
* <p></p>
- * <b>Notes: </b>Maxlength = 100
+ * <b>Notes: </b>maxLength = 100
* @since SmartDeviceLink 5.0
*/
- public void setFullAppID(String fullAppID) {
- if (fullAppID != null) {
+ public RegisterAppInterface setFullAppID( String fullAppID) {
+ if (fullAppID != null) {
fullAppID = fullAppID.toLowerCase();
setParameters(KEY_FULL_APP_ID, fullAppID);
String appID;
@@ -697,7 +708,8 @@ public class RegisterAppInterface extends RPCRequest {
} else {
setParameters(KEY_FULL_APP_ID, null);
}
- }
+ return this;
+ }
@Override
public void format(Version rpcVersion, boolean formatParams) {
@@ -727,9 +739,10 @@ public class RegisterAppInterface extends RPCRequest {
* used for day color scheme
* @since SmartDeviceLink 5.0
*/
- public void setDayColorScheme(TemplateColorScheme templateColorScheme){
- setParameters(KEY_DAY_COLOR_SCHEME, templateColorScheme);
- }
+ public RegisterAppInterface setDayColorScheme( TemplateColorScheme templateColorScheme) {
+ setParameters(KEY_DAY_COLOR_SCHEME, templateColorScheme);
+ return this;
+ }
/**
* Gets the color scheme that is currently used for night
@@ -749,7 +762,8 @@ public class RegisterAppInterface extends RPCRequest {
* used for night color scheme
* @since SmartDeviceLink 5.0
*/
- public void setNightColorScheme(TemplateColorScheme templateColorScheme){
- setParameters(KEY_NIGHT_COLOR_SCHEME, templateColorScheme);
- }
+ public RegisterAppInterface setNightColorScheme( TemplateColorScheme templateColorScheme) {
+ setParameters(KEY_NIGHT_COLOR_SCHEME, templateColorScheme);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java
index 449056871..7bb247e2b 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RegisterAppInterfaceResponse.java
@@ -136,14 +136,13 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* @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
@@ -160,8 +159,9 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* 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);
+ public RegisterAppInterfaceResponse setSdlMsgVersion( SdlMsgVersion sdlMsgVersion) {
+ setParameters(KEY_SDL_MSG_VERSION, sdlMsgVersion);
+ return this;
}
/**
@@ -177,14 +177,15 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
/**
* 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);
+ public RegisterAppInterfaceResponse setLanguage( Language language) {
+ setParameters(KEY_LANGUAGE, language);
+ return this;
}
/**
@@ -203,12 +204,13 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
/**
* 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);
+ public RegisterAppInterfaceResponse setHmiDisplayLanguage( Language hmiDisplayLanguage) {
+ setParameters(KEY_HMI_DISPLAY_LANGUAGE, hmiDisplayLanguage);
+ return this;
}
/**
@@ -217,7 +219,6 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* @return DisplayCapabilities
*/
@Deprecated
- @SuppressWarnings("unchecked")
public DisplayCapabilities getDisplayCapabilities() {
return (DisplayCapabilities) getObject(DisplayCapabilities.class, KEY_DISPLAY_CAPABILITIES);
}
@@ -226,8 +227,9 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* @param displayCapabilities
*/
@Deprecated
- public void setDisplayCapabilities(DisplayCapabilities displayCapabilities) {
- setParameters(KEY_DISPLAY_CAPABILITIES, displayCapabilities);
+ public RegisterAppInterfaceResponse setDisplayCapabilities( DisplayCapabilities displayCapabilities) {
+ setParameters(KEY_DISPLAY_CAPABILITIES, displayCapabilities);
+ return this;
}
/**
@@ -245,8 +247,9 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* @param buttonCapabilities
*/
@Deprecated
- public void setButtonCapabilities(List<ButtonCapabilities> buttonCapabilities) {
- setParameters(KEY_BUTTON_CAPABILITIES, buttonCapabilities);
+ public RegisterAppInterfaceResponse setButtonCapabilities( List<ButtonCapabilities> buttonCapabilities) {
+ setParameters(KEY_BUTTON_CAPABILITIES, buttonCapabilities);
+ return this;
}
/**
* Gets getSoftButtonCapabilities set when application interface is registered.
@@ -263,8 +266,9 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* @param softButtonCapabilities
*/
@Deprecated
- public void setSoftButtonCapabilities(List<SoftButtonCapabilities> softButtonCapabilities) {
- setParameters(KEY_SOFT_BUTTON_CAPABILITIES, softButtonCapabilities);
+ public RegisterAppInterfaceResponse setSoftButtonCapabilities( List<SoftButtonCapabilities> softButtonCapabilities) {
+ setParameters(KEY_SOFT_BUTTON_CAPABILITIES, softButtonCapabilities);
+ return this;
}
/**
@@ -273,7 +277,6 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* @return PresetBankCapabilities
*/
@Deprecated
- @SuppressWarnings("unchecked")
public PresetBankCapabilities getPresetBankCapabilities() {
return (PresetBankCapabilities) getObject(PresetBankCapabilities.class, KEY_PRESET_BANK_CAPABILITIES);
}
@@ -282,8 +285,9 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* @param presetBankCapabilities
*/
@Deprecated
- public void setPresetBankCapabilities(PresetBankCapabilities presetBankCapabilities) {
- setParameters(KEY_PRESET_BANK_CAPABILITIES, presetBankCapabilities);
+ public RegisterAppInterfaceResponse setPresetBankCapabilities( PresetBankCapabilities presetBankCapabilities) {
+ setParameters(KEY_PRESET_BANK_CAPABILITIES, presetBankCapabilities);
+ return this;
}
/**
@@ -299,8 +303,9 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* Sets hmiZoneCapabilities
* @param hmiZoneCapabilities
*/
- public void setHmiZoneCapabilities(List<HmiZoneCapabilities> hmiZoneCapabilities) {
- setParameters(KEY_HMI_ZONE_CAPABILITIES, hmiZoneCapabilities);
+ public RegisterAppInterfaceResponse setHmiZoneCapabilities( List<HmiZoneCapabilities> hmiZoneCapabilities) {
+ setParameters(KEY_HMI_ZONE_CAPABILITIES, hmiZoneCapabilities);
+ return this;
}
/**
@@ -325,8 +330,9 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* Sets speechCapabilities
* @param speechCapabilities
*/
- public void setSpeechCapabilities(List<SpeechCapabilities> speechCapabilities) {
- setParameters(KEY_SPEECH_CAPABILITIES, speechCapabilities);
+ public RegisterAppInterfaceResponse setSpeechCapabilities( List<SpeechCapabilities> speechCapabilities) {
+ setParameters(KEY_SPEECH_CAPABILITIES, speechCapabilities);
+ return this;
}
@@ -335,8 +341,9 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
return (List<PrerecordedSpeech>) getObject(PrerecordedSpeech.class, KEY_PRERECORDED_SPEECH);
}
- public void setPrerecordedSpeech(List<PrerecordedSpeech> prerecordedSpeech) {
- setParameters(KEY_PRERECORDED_SPEECH, prerecordedSpeech);
+ public RegisterAppInterfaceResponse setPrerecordedSpeech( List<PrerecordedSpeech> prerecordedSpeech) {
+ setParameters(KEY_PRERECORDED_SPEECH, prerecordedSpeech);
+ return this;
}
@@ -353,8 +360,9 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* Sets VrCapabilities
* @param vrCapabilities
*/
- public void setVrCapabilities(List<VrCapabilities> vrCapabilities) {
- setParameters(KEY_VR_CAPABILITIES, vrCapabilities);
+ public RegisterAppInterfaceResponse setVrCapabilities( List<VrCapabilities> vrCapabilities) {
+ setParameters(KEY_VR_CAPABILITIES, vrCapabilities);
+ return this;
}
/**
@@ -362,7 +370,6 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
*
* @return vehicleType
*/
- @SuppressWarnings("unchecked")
public VehicleType getVehicleType() {
return (VehicleType) getObject(VehicleType.class, KEY_VEHICLE_TYPE);
}
@@ -370,8 +377,9 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* Sets vehicleType
* @param vehicleType
*/
- public void setVehicleType(VehicleType vehicleType) {
- setParameters(KEY_VEHICLE_TYPE, vehicleType);
+ public RegisterAppInterfaceResponse setVehicleType( VehicleType vehicleType) {
+ setParameters(KEY_VEHICLE_TYPE, vehicleType);
+ return this;
}
/**
@@ -387,8 +395,9 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* Sets AudioPassThruCapabilities
* @param audioPassThruCapabilities
*/
- public void setAudioPassThruCapabilities(List<AudioPassThruCapabilities> audioPassThruCapabilities) {
- setParameters(KEY_AUDIO_PASS_THRU_CAPABILITIES, audioPassThruCapabilities);
+ public RegisterAppInterfaceResponse setAudioPassThruCapabilities( List<AudioPassThruCapabilities> audioPassThruCapabilities) {
+ setParameters(KEY_AUDIO_PASS_THRU_CAPABILITIES, audioPassThruCapabilities);
+ return this;
}
/**
@@ -396,7 +405,6 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
*
* @return pcmStreamingCapabilities
*/
- @SuppressWarnings("unchecked")
public AudioPassThruCapabilities getPcmStreamingCapabilities() {
return (AudioPassThruCapabilities) getObject(AudioPassThruCapabilities.class, KEY_PCM_STREAM_CAPABILITIES);
}
@@ -404,12 +412,14 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* Sets pcmStreamingCapabilities
* @param pcmStreamingCapabilities
*/
- public void setPcmStreamingCapabilities(AudioPassThruCapabilities pcmStreamingCapabilities) {
- setParameters(KEY_PCM_STREAM_CAPABILITIES, pcmStreamingCapabilities);
- }
+ public RegisterAppInterfaceResponse setPcmStreamingCapabilities( AudioPassThruCapabilities pcmStreamingCapabilities) {
+ setParameters(KEY_PCM_STREAM_CAPABILITIES, pcmStreamingCapabilities);
+ return this;
+ }
- public void setSupportedDiagModes(List<Integer> supportedDiagModes) {
- setParameters(KEY_SUPPORTED_DIAG_MODES, supportedDiagModes);
+ public RegisterAppInterfaceResponse setSupportedDiagModes( List<Integer> supportedDiagModes) {
+ setParameters(KEY_SUPPORTED_DIAG_MODES, supportedDiagModes);
+ return this;
}
@SuppressWarnings("unchecked")
@@ -417,25 +427,27 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
return (List<Integer>) getObject(Integer.class, KEY_SUPPORTED_DIAG_MODES);
}
- public void setHmiCapabilities(HMICapabilities hmiCapabilities) {
- setParameters(KEY_HMI_CAPABILITIES, hmiCapabilities);
+ public RegisterAppInterfaceResponse setHmiCapabilities( HMICapabilities hmiCapabilities) {
+ setParameters(KEY_HMI_CAPABILITIES, hmiCapabilities);
+ return this;
}
- @SuppressWarnings("unchecked")
public HMICapabilities getHmiCapabilities() {
return (HMICapabilities) getObject(HMICapabilities.class, KEY_HMI_CAPABILITIES);
}
- public void setSdlVersion(String sdlVersion) {
- setParameters(KEY_SDL_VERSION, sdlVersion);
+ public RegisterAppInterfaceResponse setSdlVersion( String sdlVersion) {
+ setParameters(KEY_SDL_VERSION, sdlVersion);
+ return this;
}
public String getSdlVersion() {
return getString(KEY_SDL_VERSION);
}
- public void setSystemSoftwareVersion(String systemSoftwareVersion) {
- setParameters(KEY_SYSTEM_SOFTWARE_VERSION, systemSoftwareVersion);
+ public RegisterAppInterfaceResponse setSystemSoftwareVersion( String systemSoftwareVersion) {
+ setParameters(KEY_SYSTEM_SOFTWARE_VERSION, systemSoftwareVersion);
+ return this;
}
public String getSystemSoftwareVersion() {
@@ -446,11 +458,12 @@ public class RegisterAppInterfaceResponse extends RPCResponse {
* Sets Icon Resumed Boolean
* @param iconResumed - if param not included, set to false
*/
- public void setIconResumed(Boolean iconResumed){
+ public RegisterAppInterfaceResponse setIconResumed(Boolean iconResumed){
if(iconResumed == null){
iconResumed = false;
}
setParameters(KEY_ICON_RESUMED, iconResumed);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModule.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModule.java
index 807e239da..0c52a9e0a 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModule.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ReleaseInteriorVehicleDataModule.java
@@ -32,8 +32,9 @@ public class ReleaseInteriorVehicleDataModule extends RPCRequest {
* Sets the Module Type for this class
* @param type the Module Type to be set
*/
- public void setModuleType(@NonNull ModuleType type) {
+ public ReleaseInteriorVehicleDataModule setModuleType(@NonNull ModuleType type) {
setParameters(KEY_MODULE_TYPE, type);
+ return this;
}
/**
@@ -48,8 +49,9 @@ public class ReleaseInteriorVehicleDataModule extends RPCRequest {
* Sets the Module Ids for this class
* @param id the ids to be set
*/
- public void setModuleId(String id) {
+ public ReleaseInteriorVehicleDataModule setModuleId( String id) {
setParameters(KEY_MODULE_ID, id);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java
index 5703f1cc2..31fd12534 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/RemoteControlCapabilities.java
@@ -58,9 +58,10 @@ public class RemoteControlCapabilities extends RPCStruct {
* @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);
- }
+ public RemoteControlCapabilities setClimateControlCapabilities( List<ClimateControlCapabilities> climateControlCapabilities) {
+ setValue(KEY_CLIMATE_CONTROL_CAPABILITIES, climateControlCapabilities);
+ return this;
+ }
/**
* Gets the climateControlCapabilities portion of the RemoteControlCapabilities class
@@ -79,9 +80,10 @@ public class RemoteControlCapabilities extends RPCStruct {
* @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);
- }
+ public RemoteControlCapabilities setRadioControlCapabilities( List<RadioControlCapabilities> radioControlCapabilities) {
+ setValue(KEY_RADIO_CONTROL_CAPABILITIES, radioControlCapabilities);
+ return this;
+ }
/**
* Gets the radioControlCapabilities portion of the RemoteControlCapabilities class
@@ -99,9 +101,10 @@ public class RemoteControlCapabilities extends RPCStruct {
*
* @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);
- }
+ public RemoteControlCapabilities setButtonCapabilities( List<ButtonCapabilities> buttonCapabilities) {
+ setValue(KEY_BUTTON_CAPABILITIES, buttonCapabilities);
+ return this;
+ }
/**
* Gets the buttonCapabilities portion of the RemoteControlCapabilities class
@@ -118,9 +121,10 @@ public class RemoteControlCapabilities extends RPCStruct {
*
* @param seatControlCapabilities If included, the platform supports seat controls.
*/
- public void setSeatControlCapabilities(List<SeatControlCapabilities> seatControlCapabilities) {
- setValue(KEY_SEAT_CONTROL_CAPABILITIES, seatControlCapabilities);
- }
+ public RemoteControlCapabilities setSeatControlCapabilities( List<SeatControlCapabilities> seatControlCapabilities) {
+ setValue(KEY_SEAT_CONTROL_CAPABILITIES, seatControlCapabilities);
+ return this;
+ }
/**
* Gets the seatControlCapabilities portion of the RemoteControlCapabilities class
@@ -137,9 +141,10 @@ public class RemoteControlCapabilities extends RPCStruct {
*
* @param audioControlCapabilities If included, the platform supports audio controls.
*/
- public void setAudioControlCapabilities(List<AudioControlCapabilities> audioControlCapabilities) {
- setValue(KEY_AUDIO_CONTROL_CAPABILITIES, audioControlCapabilities);
- }
+ public RemoteControlCapabilities setAudioControlCapabilities( List<AudioControlCapabilities> audioControlCapabilities) {
+ setValue(KEY_AUDIO_CONTROL_CAPABILITIES, audioControlCapabilities);
+ return this;
+ }
/**
* Gets the audioControlCapabilities portion of the RemoteControlCapabilities class
@@ -156,9 +161,10 @@ public class RemoteControlCapabilities extends RPCStruct {
*
* @param hmiSettingsControlCapabilities If included, the platform supports hmi setting controls.
*/
- public void setHmiSettingsControlCapabilities(HMISettingsControlCapabilities hmiSettingsControlCapabilities) {
- setValue(KEY_HMI_SETTINGS_CONTROL_CAPABILITIES, hmiSettingsControlCapabilities);
- }
+ public RemoteControlCapabilities setHmiSettingsControlCapabilities( HMISettingsControlCapabilities hmiSettingsControlCapabilities) {
+ setValue(KEY_HMI_SETTINGS_CONTROL_CAPABILITIES, hmiSettingsControlCapabilities);
+ return this;
+ }
/**
* Gets the hmiSettingsControlCapabilities portion of the RemoteControlCapabilities class
@@ -174,9 +180,10 @@ public class RemoteControlCapabilities extends RPCStruct {
*
* @param lightControlCapabilities If included, the platform supports light controls.
*/
- public void setLightControlCapabilities(LightControlCapabilities lightControlCapabilities) {
- setValue(KEY_LIGHT_CONTROL_CAPABILITIES, lightControlCapabilities);
- }
+ public RemoteControlCapabilities setLightControlCapabilities( LightControlCapabilities lightControlCapabilities) {
+ setValue(KEY_LIGHT_CONTROL_CAPABILITIES, lightControlCapabilities);
+ return this;
+ }
/**
* Gets the lightControlCapabilities portion of the RemoteControlCapabilities class
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java
index a88ca2950..1bd508186 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ResetGlobalProperties.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -132,15 +132,16 @@ public class ResetGlobalProperties extends RPCRequest {
/**
* 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);
+ */
+ public ResetGlobalProperties setProperties(@NonNull List<GlobalProperty> properties) {
+ setParameters(KEY_PROPERTIES, properties);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java
index a5b9e1525..bf42b7079 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScreenParams.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -80,7 +80,7 @@ public class ScreenParams extends RPCStruct {
public ScreenParams() { }
/**
* <p>
- * Constructs a new ScreenParamst object indicated by the Hashtable
+ * Constructs a new ScreenParams object indicated by the Hashtable
* parameter
* </p>
*
@@ -101,18 +101,18 @@ public class ScreenParams extends RPCStruct {
setImageResolution(resolution);
}
- @SuppressWarnings("unchecked")
public ImageResolution getImageResolution() {
return (ImageResolution) getObject(ImageResolution.class, KEY_RESOLUTION);
}
- public void setImageResolution( @NonNull ImageResolution resolution ) {
+ public ScreenParams setImageResolution(@NonNull ImageResolution resolution) {
setValue(KEY_RESOLUTION, resolution);
+ return this;
}
- @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);
- }
+ public ScreenParams setTouchEventAvailable( TouchEventCapabilities touchEventAvailable) {
+ setValue(KEY_TOUCH_EVENT_AVAILABLE, touchEventAvailable);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java
index 1ad0d0846..5e1080182 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ScrollableMessage.java
@@ -72,7 +72,7 @@ import java.util.List;
* <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>minValue=1000; maxValue=65535; defValue=30000</td>
* <td>SmartDevice Link 1.0 </td>
* </tr>
* <tr>
@@ -144,15 +144,16 @@ public class ScrollableMessage extends RPCRequest {
/**
* 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);
+ public ScrollableMessage setScrollableMessageBody(@NonNull String scrollableMessageBody) {
+ setParameters(KEY_SCROLLABLE_MESSAGE_BODY, scrollableMessageBody);
+ return this;
}
/**
@@ -167,14 +168,15 @@ public class ScrollableMessage extends RPCRequest {
/**
* 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);
+ public ScrollableMessage setTimeout( Integer timeout) {
+ setParameters(KEY_TIMEOUT, timeout);
+ return this;
}
/**
@@ -189,15 +191,16 @@ public class ScrollableMessage extends RPCRequest {
/**
* 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);
+ public ScrollableMessage setSoftButtons( List<SoftButton> softButtons) {
+ setParameters(KEY_SOFT_BUTTONS, softButtons);
+ return this;
}
/**
@@ -227,7 +230,8 @@ public class ScrollableMessage extends RPCRequest {
*
* @since SmartDeviceLink 6.0
*/
- public void setCancelID(Integer cancelID) {
- setParameters(KEY_CANCEL_ID, cancelID);
- }
+ public ScrollableMessage setCancelID( Integer cancelID) {
+ setParameters(KEY_CANCEL_ID, cancelID);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java
index 8a2135753..0e8f9453f 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SdlMsgVersion.java
@@ -138,10 +138,11 @@ public class SdlMsgVersion extends RPCStruct {
* <li>minvalue="1"</li>
* <li>maxvalue="10"</li>
* </ul>
- * @param majorVersion minvalue="1" and maxvalue="10"
- */
- public void setMajorVersion( @NonNull Integer majorVersion ) {
+ * @param majorVersion minvalue="1" and maxvalue="10"
+ */
+ public SdlMsgVersion setMajorVersion(@NonNull Integer majorVersion) {
setValue(KEY_MAJOR_VERSION, majorVersion);
+ return this;
}
/**
* Get minor version
@@ -162,8 +163,9 @@ public class SdlMsgVersion extends RPCStruct {
* </ul>
* @param minorVersion min: 0; max: 1000
*/
- public void setMinorVersion( @NonNull Integer minorVersion ) {
+ public SdlMsgVersion setMinorVersion(@NonNull Integer minorVersion) {
setValue(KEY_MINOR_VERSION, minorVersion);
+ return this;
}
/**
@@ -185,8 +187,9 @@ public class SdlMsgVersion extends RPCStruct {
* </ul>
* @param patchVersion min: 0; max: 1000
*/
- public void setPatchVersion( Integer patchVersion ) {
+ public SdlMsgVersion setPatchVersion( Integer patchVersion) {
setValue(KEY_PATCH_VERSION, patchVersion);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java
index 106edf2cb..82d3cf72c 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlCapabilities.java
@@ -95,18 +95,20 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @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);
- }
+ public SeatControlCapabilities setModuleName(@NonNull String moduleName) {
+ setValue(KEY_MODULE_NAME, moduleName);
+ return this;
+ }
/**
* Sets the heatingEnabledAvailable portion of the SeatControlCapabilities class
*
* @param heatingEnabledAvailable
*/
- public void setHeatingEnabledAvailable(Boolean heatingEnabledAvailable) {
- setValue(KEY_HEATING_ENABLED_AVAILABLE, heatingEnabledAvailable);
- }
+ public SeatControlCapabilities setHeatingEnabledAvailable( Boolean heatingEnabledAvailable) {
+ setValue(KEY_HEATING_ENABLED_AVAILABLE, heatingEnabledAvailable);
+ return this;
+ }
/**
* Gets the heatingEnabledAvailable portion of the SeatControlCapabilities class
@@ -122,9 +124,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param coolingEnabledAvailable
*/
- public void setCoolingEnabledAvailable(Boolean coolingEnabledAvailable) {
- setValue(KEY_COOLING_ENABLED_AVAILABLE, coolingEnabledAvailable);
- }
+ public SeatControlCapabilities setCoolingEnabledAvailable( Boolean coolingEnabledAvailable) {
+ setValue(KEY_COOLING_ENABLED_AVAILABLE, coolingEnabledAvailable);
+ return this;
+ }
/**
* Gets the coolingEnabledAvailable portion of the SeatControlCapabilities class
@@ -140,9 +143,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param heatingLevelAvailable
*/
- public void setHeatingLevelAvailable(Boolean heatingLevelAvailable) {
- setValue(KEY_HEATING_LEVEL_AVAILABLE, heatingLevelAvailable);
- }
+ public SeatControlCapabilities setHeatingLevelAvailable( Boolean heatingLevelAvailable) {
+ setValue(KEY_HEATING_LEVEL_AVAILABLE, heatingLevelAvailable);
+ return this;
+ }
/**
* Gets the heatingLevelAvailable portion of the SeatControlCapabilities class
@@ -158,9 +162,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param coolingLevelAvailable
*/
- public void setCoolingLevelAvailable(Boolean coolingLevelAvailable) {
- setValue(KEY_COOLING_LEVEL_AVAILABLE, coolingLevelAvailable);
- }
+ public SeatControlCapabilities setCoolingLevelAvailable( Boolean coolingLevelAvailable) {
+ setValue(KEY_COOLING_LEVEL_AVAILABLE, coolingLevelAvailable);
+ return this;
+ }
/**
* Gets the coolingLevelAvailable portion of the SeatControlCapabilities class
@@ -176,9 +181,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param horizontalPositionAvailable
*/
- public void setHorizontalPositionAvailable(Boolean horizontalPositionAvailable) {
- setValue(KEY_HORIZONTAL_POSITION_AVAILABLE, horizontalPositionAvailable);
- }
+ public SeatControlCapabilities setHorizontalPositionAvailable( Boolean horizontalPositionAvailable) {
+ setValue(KEY_HORIZONTAL_POSITION_AVAILABLE, horizontalPositionAvailable);
+ return this;
+ }
/**
* Gets the horizontalPositionAvailable portion of the SeatControlCapabilities class
@@ -194,9 +200,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param verticalPositionAvailable
*/
- public void setVerticalPositionAvailable(Boolean verticalPositionAvailable) {
- setValue(KEY_VERTICAL_POSITION_AVAILABLE, verticalPositionAvailable);
- }
+ public SeatControlCapabilities setVerticalPositionAvailable( Boolean verticalPositionAvailable) {
+ setValue(KEY_VERTICAL_POSITION_AVAILABLE, verticalPositionAvailable);
+ return this;
+ }
/**
* Gets the verticalPositionAvailable portion of the SeatControlCapabilities class
@@ -212,9 +219,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param frontVerticalPositionAvailable
*/
- public void setFrontVerticalPositionAvailable(Boolean frontVerticalPositionAvailable) {
- setValue(KEY_FRONT_VERTICAL_POSITION_AVAILABLE, frontVerticalPositionAvailable);
- }
+ public SeatControlCapabilities setFrontVerticalPositionAvailable( Boolean frontVerticalPositionAvailable) {
+ setValue(KEY_FRONT_VERTICAL_POSITION_AVAILABLE, frontVerticalPositionAvailable);
+ return this;
+ }
/**
* Gets the frontVerticalPositionAvailable portion of the SeatControlCapabilities class
@@ -230,9 +238,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param backVerticalPositionAvailable
*/
- public void setBackVerticalPositionAvailable(Boolean backVerticalPositionAvailable) {
- setValue(KEY_BACK_VERTICAL_POSITION_AVAILABLE, backVerticalPositionAvailable);
- }
+ public SeatControlCapabilities setBackVerticalPositionAvailable( Boolean backVerticalPositionAvailable) {
+ setValue(KEY_BACK_VERTICAL_POSITION_AVAILABLE, backVerticalPositionAvailable);
+ return this;
+ }
/**
* Gets the backVerticalPositionAvailable portion of the SeatControlCapabilities class
@@ -248,9 +257,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param backTiltAngleAvailable
*/
- public void setBackTiltAngleAvailable(Boolean backTiltAngleAvailable) {
- setValue(KEY_BACK_TILT_ANGLE_AVAILABLE, backTiltAngleAvailable);
- }
+ public SeatControlCapabilities setBackTiltAngleAvailable( Boolean backTiltAngleAvailable) {
+ setValue(KEY_BACK_TILT_ANGLE_AVAILABLE, backTiltAngleAvailable);
+ return this;
+ }
/**
* Gets the backTiltAngleAvailable portion of the SeatControlCapabilities class
@@ -266,9 +276,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param headSupportHorizontalPositionAvailable
*/
- public void setHeadSupportHorizontalPositionAvailable(Boolean headSupportHorizontalPositionAvailable) {
- setValue(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE, headSupportHorizontalPositionAvailable);
- }
+ public SeatControlCapabilities setHeadSupportHorizontalPositionAvailable( Boolean headSupportHorizontalPositionAvailable) {
+ setValue(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION_AVAILABLE, headSupportHorizontalPositionAvailable);
+ return this;
+ }
/**
* Gets the headSupportHorizontalPositionAvailable portion of the SeatControlCapabilities class
@@ -284,9 +295,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param headSupportVerticalPositionAvailable
*/
- public void setHeadSupportVerticalPositionAvailable(Boolean headSupportVerticalPositionAvailable) {
- setValue(KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE, headSupportVerticalPositionAvailable);
- }
+ public SeatControlCapabilities setHeadSupportVerticalPositionAvailable( Boolean headSupportVerticalPositionAvailable) {
+ setValue(KEY_HEAD_SUPPORT_VERTICAL_POSITION_AVAILABLE, headSupportVerticalPositionAvailable);
+ return this;
+ }
/**
* Gets the headSupportVerticalPositionAvailable portion of the SeatControlCapabilities class
@@ -302,9 +314,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param massageEnabledAvailable
*/
- public void setMassageEnabledAvailable(Boolean massageEnabledAvailable) {
- setValue(KEY_MASSAGE_ENABLED_AVAILABLE, massageEnabledAvailable);
- }
+ public SeatControlCapabilities setMassageEnabledAvailable( Boolean massageEnabledAvailable) {
+ setValue(KEY_MASSAGE_ENABLED_AVAILABLE, massageEnabledAvailable);
+ return this;
+ }
/**
* Gets the massageEnabledAvailable portion of the SeatControlCapabilities class
@@ -320,9 +333,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param massageModeAvailable
*/
- public void setMassageModeAvailable(Boolean massageModeAvailable) {
- setValue(KEY_MASSAGE_MODE_AVAILABLE, massageModeAvailable);
- }
+ public SeatControlCapabilities setMassageModeAvailable( Boolean massageModeAvailable) {
+ setValue(KEY_MASSAGE_MODE_AVAILABLE, massageModeAvailable);
+ return this;
+ }
/**
* Gets the massageModeAvailable portion of the SeatControlCapabilities class
@@ -338,9 +352,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param massageCushionFirmnessAvailable
*/
- public void setMassageCushionFirmnessAvailable(Boolean massageCushionFirmnessAvailable) {
- setValue(KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE, massageCushionFirmnessAvailable);
- }
+ public SeatControlCapabilities setMassageCushionFirmnessAvailable( Boolean massageCushionFirmnessAvailable) {
+ setValue(KEY_MASSAGE_CUSHION_FIRMNESS_AVAILABLE, massageCushionFirmnessAvailable);
+ return this;
+ }
/**
* Gets the massageCushionFirmnessAvailable portion of the SeatControlCapabilities class
@@ -356,9 +371,10 @@ public class SeatControlCapabilities extends RPCStruct {
*
* @param memoryAvailable
*/
- public void setMemoryAvailable(Boolean memoryAvailable) {
- setValue(KEY_MEMORY_AVAILABLE, memoryAvailable);
- }
+ public SeatControlCapabilities setMemoryAvailable( Boolean memoryAvailable) {
+ setValue(KEY_MEMORY_AVAILABLE, memoryAvailable);
+ return this;
+ }
/**
* Gets the memoryAvailable portion of the SeatControlCapabilities class
@@ -373,9 +389,10 @@ public class SeatControlCapabilities extends RPCStruct {
* Sets ModuleInfo for this capability
* @param info the ModuleInfo to be set
*/
- public void setModuleInfo(ModuleInfo info) {
- setValue(KEY_MODULE_INFO, info);
- }
+ public SeatControlCapabilities setModuleInfo( ModuleInfo info) {
+ setValue(KEY_MODULE_INFO, info);
+ return this;
+ }
/**
* Gets a ModuleInfo of this capability
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java
index fbaf55fad..ad883e310 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatControlData.java
@@ -90,9 +90,10 @@ public class SeatControlData extends RPCStruct {
*
* @param id
*/
- public void setId(@NonNull SupportedSeat id) {
- setValue(KEY_ID, id);
- }
+ public SeatControlData setId(@NonNull SupportedSeat id) {
+ setValue(KEY_ID, id);
+ return this;
+ }
/**
* Gets the id portion of the SeatControlData class
@@ -108,9 +109,10 @@ public class SeatControlData extends RPCStruct {
*
* @param heatingEnabled
*/
- public void setHeatingEnabled(Boolean heatingEnabled) {
- setValue(KEY_HEATING_ENABLED, heatingEnabled);
- }
+ public SeatControlData setHeatingEnabled( Boolean heatingEnabled) {
+ setValue(KEY_HEATING_ENABLED, heatingEnabled);
+ return this;
+ }
/**
* Gets the heatingEnabled portion of the SeatControlData class
@@ -126,9 +128,10 @@ public class SeatControlData extends RPCStruct {
*
* @param coolingEnabled
*/
- public void setCoolingEnabled(Boolean coolingEnabled) {
- setValue(KEY_COOLING_ENABLED, coolingEnabled);
- }
+ public SeatControlData setCoolingEnabled( Boolean coolingEnabled) {
+ setValue(KEY_COOLING_ENABLED, coolingEnabled);
+ return this;
+ }
/**
* Gets the coolingEnabled portion of the SeatControlData class
@@ -144,9 +147,10 @@ public class SeatControlData extends RPCStruct {
*
* @param heatingLevel
*/
- public void setHeatingLevel(Integer heatingLevel) {
- setValue(KEY_HEATING_LEVEL, heatingLevel);
- }
+ public SeatControlData setHeatingLevel( Integer heatingLevel) {
+ setValue(KEY_HEATING_LEVEL, heatingLevel);
+ return this;
+ }
/**
* Gets the heatingLevel portion of the SeatControlData class
@@ -162,9 +166,10 @@ public class SeatControlData extends RPCStruct {
*
* @param coolingLevel
*/
- public void setCoolingLevel(Integer coolingLevel) {
- setValue(KEY_COOLING_LEVEL, coolingLevel);
- }
+ public SeatControlData setCoolingLevel( Integer coolingLevel) {
+ setValue(KEY_COOLING_LEVEL, coolingLevel);
+ return this;
+ }
/**
* Gets the coolingLevel portion of the SeatControlData class
@@ -180,9 +185,10 @@ public class SeatControlData extends RPCStruct {
*
* @param horizontalPosition
*/
- public void setHorizontalPosition(Integer horizontalPosition) {
- setValue(KEY_HORIZONTAL_POSITION, horizontalPosition);
- }
+ public SeatControlData setHorizontalPosition( Integer horizontalPosition) {
+ setValue(KEY_HORIZONTAL_POSITION, horizontalPosition);
+ return this;
+ }
/**
* Gets the horizontalPosition portion of the SeatControlData class
@@ -198,9 +204,10 @@ public class SeatControlData extends RPCStruct {
*
* @param verticalPosition
*/
- public void setVerticalPosition(Integer verticalPosition) {
- setValue(KEY_VERTICAL_POSITION, verticalPosition);
- }
+ public SeatControlData setVerticalPosition( Integer verticalPosition) {
+ setValue(KEY_VERTICAL_POSITION, verticalPosition);
+ return this;
+ }
/**
* Gets the verticalPosition portion of the SeatControlData class
@@ -216,9 +223,10 @@ public class SeatControlData extends RPCStruct {
*
* @param frontVerticalPosition
*/
- public void setFrontVerticalPosition(Integer frontVerticalPosition) {
- setValue(KEY_FRONT_VERTICAL_POSITION, frontVerticalPosition);
- }
+ public SeatControlData setFrontVerticalPosition( Integer frontVerticalPosition) {
+ setValue(KEY_FRONT_VERTICAL_POSITION, frontVerticalPosition);
+ return this;
+ }
/**
* Gets the frontVerticalPosition portion of the SeatControlData class
@@ -234,9 +242,10 @@ public class SeatControlData extends RPCStruct {
*
* @param backVerticalPosition
*/
- public void setBackVerticalPosition(Integer backVerticalPosition) {
- setValue(KEY_BACK_VERTICAL_POSITION, backVerticalPosition);
- }
+ public SeatControlData setBackVerticalPosition( Integer backVerticalPosition) {
+ setValue(KEY_BACK_VERTICAL_POSITION, backVerticalPosition);
+ return this;
+ }
/**
* Gets the backVerticalPosition portion of the SeatControlData class
@@ -252,9 +261,10 @@ public class SeatControlData extends RPCStruct {
*
* @param backTiltAngle
*/
- public void setBackTiltAngle(Integer backTiltAngle) {
- setValue(KEY_BACK_TILT_ANGLE, backTiltAngle);
- }
+ public SeatControlData setBackTiltAngle( Integer backTiltAngle) {
+ setValue(KEY_BACK_TILT_ANGLE, backTiltAngle);
+ return this;
+ }
/**
* Gets the backTiltAngle portion of the SeatControlData class
@@ -270,9 +280,10 @@ public class SeatControlData extends RPCStruct {
*
* @param headSupportHorizontalPosition
*/
- public void setHeadSupportHorizontalPosition(Integer headSupportHorizontalPosition) {
- setValue(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION, headSupportHorizontalPosition);
- }
+ public SeatControlData setHeadSupportHorizontalPosition( Integer headSupportHorizontalPosition) {
+ setValue(KEY_HEAD_SUPPORT_HORIZONTAL_POSITION, headSupportHorizontalPosition);
+ return this;
+ }
/**
* Gets the headSupportHorizontalPosition portion of the SeatControlData class
@@ -288,9 +299,10 @@ public class SeatControlData extends RPCStruct {
*
* @param headSupportVerticalPosition
*/
- public void setHeadSupportVerticalPosition(Integer headSupportVerticalPosition) {
- setValue(KEY_HEAD_SUPPORT_VERTICAL_POSITION, headSupportVerticalPosition);
- }
+ public SeatControlData setHeadSupportVerticalPosition( Integer headSupportVerticalPosition) {
+ setValue(KEY_HEAD_SUPPORT_VERTICAL_POSITION, headSupportVerticalPosition);
+ return this;
+ }
/**
* Gets the headSupportVerticalPosition portion of the SeatControlData class
@@ -306,9 +318,10 @@ public class SeatControlData extends RPCStruct {
*
* @param massageEnabled
*/
- public void setMassageEnabled(Boolean massageEnabled) {
- setValue(KEY_MASSAGE_ENABLED, massageEnabled);
- }
+ public SeatControlData setMassageEnabled( Boolean massageEnabled) {
+ setValue(KEY_MASSAGE_ENABLED, massageEnabled);
+ return this;
+ }
/**
* Gets the massageEnabled portion of the SeatControlData class
@@ -334,9 +347,10 @@ public class SeatControlData extends RPCStruct {
*
* @param massageMode
*/
- public void setMassageMode(List<MassageModeData> massageMode) {
- setValue(KEY_MASSAGE_MODE, massageMode);
- }
+ public SeatControlData setMassageMode( List<MassageModeData> massageMode) {
+ setValue(KEY_MASSAGE_MODE, massageMode);
+ return this;
+ }
/**
* Gets the List<MassageCushionFirmness> portion of the SeatControlData class
@@ -353,25 +367,26 @@ public class SeatControlData extends RPCStruct {
*
* @param massageCushionFirmness
*/
- public void setMassageCushionFirmness(List<MassageCushionFirmness> massageCushionFirmness) {
- setValue(KEY_MASSAGE_CUSHION_FIRMNESS, massageCushionFirmness);
- }
+ public SeatControlData setMassageCushionFirmness( List<MassageCushionFirmness> massageCushionFirmness) {
+ setValue(KEY_MASSAGE_CUSHION_FIRMNESS, massageCushionFirmness);
+ return this;
+ }
/**
* Sets the memory portion of the SeatControlData class
*
* @param memory
*/
- public void setMemory(SeatMemoryAction memory) {
- setValue(KEY_MEMORY, memory);
- }
+ public SeatControlData setMemory( SeatMemoryAction memory) {
+ setValue(KEY_MEMORY, memory);
+ return this;
+ }
/**
* 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/SeatLocation.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatLocation.java
index a4b33d1bd..a0b1338e7 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatLocation.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatLocation.java
@@ -17,8 +17,9 @@ public class SeatLocation extends RPCStruct {
* Sets grid data for this seat location
* @param grid the grid to be set
*/
- public void setGrid(Grid grid) {
+ public SeatLocation setGrid( Grid grid) {
setValue(KEY_GRID, grid);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatLocationCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatLocationCapability.java
index 3fc34bada..160e6c33e 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatLocationCapability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatLocationCapability.java
@@ -22,8 +22,9 @@ public class SeatLocationCapability extends RPCStruct {
* Sets the seat rows for this capability
* @param rows rows to be set
*/
- public void setRows(Integer rows) {
+ public SeatLocationCapability setRows( Integer rows) {
setValue(KEY_ROWS, rows);
+ return this;
}
/**
@@ -38,8 +39,9 @@ public class SeatLocationCapability extends RPCStruct {
* Sets the seat columns for this capability
* @param cols the seat columns to be set
*/
- public void setCols(Integer cols) {
+ public SeatLocationCapability setCols( Integer cols) {
setValue(KEY_COLS, cols);
+ return this;
}
/**
@@ -54,8 +56,9 @@ public class SeatLocationCapability extends RPCStruct {
* Sets the levels for this capability
* @param levels the levels to be set
*/
- public void setLevels(Integer levels) {
+ public SeatLocationCapability setLevels( Integer levels) {
setValue(KEY_LEVELS, levels);
+ return this;
}
/**
@@ -70,8 +73,9 @@ public class SeatLocationCapability extends RPCStruct {
* Sets the seat locations for this capability
* @param locations the locations to be set
*/
- public void setSeats(List<SeatLocation> locations) {
+ public SeatLocationCapability setSeats( List<SeatLocation> locations) {
setValue(KEY_SEATS, locations);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java
index af27805db..1dc2411ba 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SeatMemoryAction.java
@@ -75,9 +75,10 @@ public class SeatMemoryAction extends RPCStruct {
*
* @param id
*/
- public void setId(@NonNull Integer id) {
- setValue(KEY_ID, id);
- }
+ public SeatMemoryAction setId(@NonNull Integer id) {
+ setValue(KEY_ID, id);
+ return this;
+ }
/**
* Gets the id portion of the SeatMemoryAction class
@@ -93,9 +94,10 @@ public class SeatMemoryAction extends RPCStruct {
*
* @param label
*/
- public void setLabel(String label) {
- setValue(KEY_LABEL, label);
- }
+ public SeatMemoryAction setLabel( String label) {
+ setValue(KEY_LABEL, label);
+ return this;
+ }
/**
* Gets the label portion of the SeatMemoryAction class
@@ -111,9 +113,10 @@ public class SeatMemoryAction extends RPCStruct {
*
* @param action
*/
- public void setAction(@NonNull SeatMemoryActionType action) {
- setValue(KEY_ACTION, action);
- }
+ public SeatMemoryAction setAction(@NonNull SeatMemoryActionType action) {
+ setValue(KEY_ACTION, action);
+ return this;
+ }
/**
* Gets the action portion of the SeatMemoryAction class
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java
index 6cee332f1..34295d9c5 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendHapticData.java
@@ -71,9 +71,10 @@ public class SendHapticData extends RPCRequest {
* 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);
- }
+ public SendHapticData setHapticRectData( List<HapticRect> hapticRectData) {
+ setParameters(KEY_HAPTIC_RECT_DATA, hapticRectData);
+ return this;
+ }
/**
* Get the haptic data
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java
index 87fa67bb6..02cff3664 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SendLocation.java
@@ -97,8 +97,9 @@ public class SendLocation extends RPCRequest{
* Setter for longitude of the location to send.
* @param longitudeDegrees degrees of the longitudinal position
*/
- public void setLongitudeDegrees(Double longitudeDegrees){
+ public SendLocation setLongitudeDegrees( Double longitudeDegrees) {
setParameters(KEY_LON_DEGREES, longitudeDegrees);
+ return this;
}
/**
@@ -120,8 +121,9 @@ public class SendLocation extends RPCRequest{
* Setter for latitude of the location to send.
* @param latitudeDegrees degrees of the latitudinal position
*/
- public void setLatitudeDegrees(Double latitudeDegrees){
+ public SendLocation setLatitudeDegrees( Double latitudeDegrees) {
setParameters(KEY_LAT_DEGREES, latitudeDegrees);
+ return this;
}
/**
@@ -136,8 +138,9 @@ public class SendLocation extends RPCRequest{
* Setter for name of the location to send.
* @param locationName The name of the location
*/
- public void setLocationName(String locationName){
+ public SendLocation setLocationName( String locationName) {
setParameters(KEY_LOCATION_NAME, locationName);
+ return this;
}
/**
@@ -152,8 +155,9 @@ public class SendLocation extends RPCRequest{
* Setter for description of the location to send.
* @param locationDescription The description of the location
*/
- public void setLocationDescription(String locationDescription){
+ public SendLocation setLocationDescription( String locationDescription) {
setParameters(KEY_LOCATION_DESCRIPTION, locationDescription);
+ return this;
}
/**
@@ -168,8 +172,9 @@ public class SendLocation extends RPCRequest{
* Setter for phone number of the location to send.
* @param phoneNumber The phone number of the location
*/
- public void setPhoneNumber(String phoneNumber){
+ public SendLocation setPhoneNumber( String phoneNumber) {
setParameters(KEY_PHONE_NUMBER, phoneNumber);
+ return this;
}
/**
@@ -185,15 +190,15 @@ public class SendLocation extends RPCRequest{
* Setter for address lines of the location to send.
* @param addressLines The address lines of the location
*/
- public void setAddressLines(List<String> addressLines){
+ public SendLocation setAddressLines( List<String> addressLines) {
setParameters(KEY_ADDRESS_LINES, addressLines);
+ return this;
}
/**
* 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);
}
@@ -202,33 +207,35 @@ public class SendLocation extends RPCRequest{
* Setter for image of the location to send.
* @param locationImage The image of the location to send
*/
- public void setLocationImage(Image locationImage){
+ public SendLocation setLocationImage( Image locationImage) {
setParameters(KEY_LOCATION_IMAGE, locationImage);
+ return this;
}
public DeliveryMode getDeliveryMode() {
return (DeliveryMode) getObject(DeliveryMode.class, KEY_DELIVERY_MODE);
}
- public void setDeliveryMode(DeliveryMode deliveryMode) {
+ public SendLocation setDeliveryMode( DeliveryMode deliveryMode) {
setParameters(KEY_DELIVERY_MODE, deliveryMode);
- }
+ return this;
+ }
- @SuppressWarnings("unchecked")
- public DateTime getTimeStamp() {
+ public DateTime getTimeStamp() {
return (DateTime) getObject(DateTime.class, KEY_TIME_STAMP);
}
- public void setTimeStamp(DateTime timeStamp) {
+ public SendLocation setTimeStamp( DateTime timeStamp) {
setParameters(KEY_TIME_STAMP, timeStamp);
- }
+ return this;
+ }
- @SuppressWarnings("unchecked")
- public OasisAddress getAddress() {
+ public OasisAddress getAddress() {
return (OasisAddress) getObject(OasisAddress.class, KEY_ADDRESS);
}
- public void setAddress(OasisAddress address) {
+ public SendLocation setAddress( OasisAddress address) {
setParameters(KEY_ADDRESS, address);
- }
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java
index 6443be188..084332432 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetAppIcon.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -109,14 +109,15 @@ public class SetAppIcon extends RPCRequest {
/**
* 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);
+ public SetAppIcon setSdlFileName(@NonNull String sdlFileName) {
+ setParameters(KEY_SDL_FILE_NAME, sdlFileName);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java
index a457304e3..48bc1196d 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetCloudAppProperties.java
@@ -55,8 +55,9 @@ public class SetCloudAppProperties extends RPCRequest {
setParameters(KEY_PROPERTIES, cloudAppProperties);
}
- public void setProperties(@NonNull CloudAppProperties cloudAppProperties){
+ public SetCloudAppProperties setProperties(@NonNull CloudAppProperties cloudAppProperties) {
setParameters(KEY_PROPERTIES, cloudAppProperties);
+ return this;
}
public CloudAppProperties getProperties(){
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java
index 937c8e8da..1b07d047a 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayout.java
@@ -131,12 +131,13 @@ public class SetDisplayLayout extends RPCRequest {
* 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);
+ public SetDisplayLayout setDisplayLayout(@NonNull String displayLayout) {
+ setParameters(KEY_DISPLAY_LAYOUT, displayLayout);
+ return this;
}
/**
@@ -164,9 +165,10 @@ public class SetDisplayLayout extends RPCRequest {
* used for day color scheme
* @since SmartDeviceLink 5.0
*/
- public void setDayColorScheme(TemplateColorScheme templateColorScheme){
- setParameters(KEY_DAY_COLOR_SCHEME, templateColorScheme);
- }
+ public SetDisplayLayout setDayColorScheme( TemplateColorScheme templateColorScheme) {
+ setParameters(KEY_DAY_COLOR_SCHEME, templateColorScheme);
+ return this;
+ }
/**
* Gets the color scheme that is currently used for night
@@ -186,7 +188,8 @@ public class SetDisplayLayout extends RPCRequest {
* used for night color scheme
* @since SmartDeviceLink 5.0
*/
- public void setNightColorScheme(TemplateColorScheme templateColorScheme){
- setParameters(KEY_NIGHT_COLOR_SCHEME, templateColorScheme);
- }
+ public SetDisplayLayout setNightColorScheme( TemplateColorScheme templateColorScheme) {
+ setParameters(KEY_NIGHT_COLOR_SCHEME, templateColorScheme);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java
index 011dcf6ac..de955a5d0 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetDisplayLayoutResponse.java
@@ -82,13 +82,13 @@ public class SetDisplayLayoutResponse extends RPCResponse {
setResultCode(resultCode);
}
- @SuppressWarnings("unchecked")
public DisplayCapabilities getDisplayCapabilities() {
return (DisplayCapabilities) getObject(DisplayCapabilities.class, KEY_DISPLAY_CAPABILITIES);
}
- public void setDisplayCapabilities(DisplayCapabilities displayCapabilities) {
+ public SetDisplayLayoutResponse setDisplayCapabilities( DisplayCapabilities displayCapabilities) {
setParameters(KEY_DISPLAY_CAPABILITIES, displayCapabilities);
+ return this;
}
@SuppressWarnings("unchecked")
@@ -96,8 +96,9 @@ public class SetDisplayLayoutResponse extends RPCResponse {
return (List<ButtonCapabilities>) getObject(ButtonCapabilities.class, KEY_BUTTON_CAPABILITIES);
}
- public void setButtonCapabilities(List<ButtonCapabilities> buttonCapabilities) {
+ public SetDisplayLayoutResponse setButtonCapabilities( List<ButtonCapabilities> buttonCapabilities) {
setParameters(KEY_BUTTON_CAPABILITIES, buttonCapabilities);
+ return this;
}
@SuppressWarnings("unchecked")
@@ -105,17 +106,18 @@ public class SetDisplayLayoutResponse extends RPCResponse {
return (List<SoftButtonCapabilities>) getObject(SoftButtonCapabilities.class, KEY_SOFT_BUTTON_CAPABILITIES);
}
- public void setSoftButtonCapabilities(List<SoftButtonCapabilities> softButtonCapabilities) {
+ public SetDisplayLayoutResponse setSoftButtonCapabilities( List<SoftButtonCapabilities> softButtonCapabilities) {
setParameters(KEY_SOFT_BUTTON_CAPABILITIES, softButtonCapabilities);
+ return this;
}
- @SuppressWarnings("unchecked")
public PresetBankCapabilities getPresetBankCapabilities() {
return (PresetBankCapabilities) getObject(PresetBankCapabilities.class, KEY_PRESET_BANK_CAPABILITIES);
}
- public void setPresetBankCapabilities(PresetBankCapabilities presetBankCapabilities) {
+ public SetDisplayLayoutResponse setPresetBankCapabilities( PresetBankCapabilities presetBankCapabilities) {
setParameters(KEY_PRESET_BANK_CAPABILITIES, presetBankCapabilities);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java
index 82e7738ee..e38b38e10 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetGlobalProperties.java
@@ -83,7 +83,7 @@ import java.util.List;
* <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>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>
@@ -91,7 +91,7 @@ import java.util.List;
* <td>VrHelp</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>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 non-sequential 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>
@@ -188,7 +188,7 @@ public class SetGlobalProperties extends RPCRequest {
* 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>
@@ -197,9 +197,10 @@ public class SetGlobalProperties extends RPCRequest {
* <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);
+ */
+ public SetGlobalProperties setHelpPrompt( List<TTSChunk> helpPrompt) {
+ setParameters(KEY_HELP_PROMPT, helpPrompt);
+ return this;
}
/**
* Gets a List<TTSChunk> for Timeout Prompt representing Array of one or
@@ -217,10 +218,11 @@ public class SetGlobalProperties extends RPCRequest {
* 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);
+ *
+ */
+ public SetGlobalProperties setTimeoutPrompt( List<TTSChunk> timeoutPrompt) {
+ setParameters(KEY_TIMEOUT_PROMPT, timeoutPrompt);
+ return this;
}
/**
@@ -236,7 +238,7 @@ public class SetGlobalProperties extends RPCRequest {
/**
* Sets a voice recognition Help Title
- *
+ *
* @param vrHelpTitle
* a String value representing a voice recognition Help Title
* <p></p>
@@ -250,8 +252,9 @@ public class SetGlobalProperties extends RPCRequest {
* </ul>
* @since SmartDeviceLink 2.0
*/
- public void setVrHelpTitle(String vrHelpTitle) {
- setParameters(KEY_VR_HELP_TITLE, vrHelpTitle);
+ public SetGlobalProperties setVrHelpTitle( String vrHelpTitle) {
+ setParameters(KEY_VR_HELP_TITLE, vrHelpTitle);
+ return this;
}
/**
@@ -270,7 +273,7 @@ public class SetGlobalProperties extends RPCRequest {
/**
* 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
@@ -279,7 +282,7 @@ public class SetGlobalProperties extends RPCRequest {
* <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
+ * <li>If the list of VR Help Items contains non-sequential
* 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>
@@ -288,38 +291,42 @@ public class SetGlobalProperties extends RPCRequest {
* </ul>
* @since SmartDeviceLink 2.0
*/
- public void setVrHelp(List<VrHelpItem> vrHelp) {
- setParameters(KEY_VR_HELP, vrHelp);
+ public SetGlobalProperties setVrHelp( List<VrHelpItem> vrHelp) {
+ setParameters(KEY_VR_HELP, vrHelp);
+ return this;
}
public String getMenuTitle() {
return getString(KEY_MENU_TITLE);
}
- public void setMenuTitle(String menuTitle) {
- setParameters(KEY_MENU_TITLE, menuTitle);
+ public SetGlobalProperties setMenuTitle( String menuTitle) {
+ setParameters(KEY_MENU_TITLE, menuTitle);
+ return this;
}
- public void setMenuIcon(Image menuIcon) {
- setParameters(KEY_MENU_ICON, menuIcon);
+ public SetGlobalProperties setMenuIcon( Image menuIcon) {
+ setParameters(KEY_MENU_ICON, menuIcon);
+ return this;
}
- @SuppressWarnings("unchecked")
public Image getMenuIcon() {
return (Image) getObject(Image.class, KEY_MENU_ICON);
}
- public void setKeyboardProperties(KeyboardProperties keyboardProperties) {
- setParameters(KEY_KEYBOARD_PROPERTIES, keyboardProperties);
+ public SetGlobalProperties setKeyboardProperties( KeyboardProperties keyboardProperties) {
+ setParameters(KEY_KEYBOARD_PROPERTIES, keyboardProperties);
+ return this;
}
/**
* Sets the user seat location
* @param location the location to be set
*/
- public void setUserLocation(SeatLocation location) {
- setParameters(KEY_USER_LOCATION, location);
- }
+ public SetGlobalProperties setUserLocation( SeatLocation location) {
+ setParameters(KEY_USER_LOCATION, location);
+ return this;
+ }
/**
* Gets the user seat location
@@ -329,7 +336,6 @@ public class SetGlobalProperties extends RPCRequest {
return (SeatLocation) getObject(SeatLocation.class, KEY_USER_LOCATION);
}
- @SuppressWarnings("unchecked")
public KeyboardProperties getKeyboardProperties() {
return (KeyboardProperties) getObject(KeyboardProperties.class, KEY_KEYBOARD_PROPERTIES);
}
@@ -339,16 +345,16 @@ public class SetGlobalProperties extends RPCRequest {
* the head unit will change the display to the new layout type.
* @param menuLayout - the menuLayout
*/
- public void setMenuLayout(MenuLayout menuLayout) {
- setParameters(KEY_MENU_LAYOUT, menuLayout);
- }
+ public SetGlobalProperties setMenuLayout( MenuLayout menuLayout) {
+ setParameters(KEY_MENU_LAYOUT, menuLayout);
+ return this;
+ }
/**
* Sets the layout of the main menu screen. If this is sent while a menu is already on-screen,
* the head unit will change the display to the new layout type.
* @return the MenuLayout
*/
- @SuppressWarnings("unchecked")
public MenuLayout getMenuLayout() {
return (MenuLayout) getObject(MenuLayout.class, KEY_MENU_LAYOUT);
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java
index 130d1e277..60e792023 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleData.java
@@ -78,8 +78,9 @@ public class SetInteriorVehicleData extends RPCRequest {
*
* @param moduleData
*/
- public void setModuleData(@NonNull ModuleData moduleData) {
+ public SetInteriorVehicleData setModuleData(@NonNull ModuleData moduleData) {
setParameters(KEY_MODULE_DATA, moduleData);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java
index 81390e64a..01ceed4ea 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java
@@ -86,7 +86,8 @@ public class SetInteriorVehicleDataResponse extends RPCResponse {
*
* @param moduleData
*/
- public void setModuleData(ModuleData moduleData) {
- setParameters(KEY_MODULE_DATA, moduleData);
- }
+ public SetInteriorVehicleDataResponse setModuleData( ModuleData moduleData) {
+ setParameters(KEY_MODULE_DATA, moduleData);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java
index 67353132f..af8ad974a 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetMediaClockTimer.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -46,7 +46,7 @@ import java.util.Hashtable;
* count-down, etc.)
*
* <p>Function Group: Base </p>
- * <p><b>HMILevel needs to be FULL, LIMITIED or BACKGROUND</b></p>
+ * <p><b>HMILevel needs to be FULL, LIMITED or BACKGROUND</b></p>
*
* <p><b>Parameter List</b></p>
*
@@ -262,13 +262,12 @@ public class SetMediaClockTimer extends RPCRequest {
* @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>
@@ -278,18 +277,19 @@ public class SetMediaClockTimer extends RPCRequest {
* 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);
+ */
+ public SetMediaClockTimer setStartTime( StartTime startTime) {
+ setParameters(KEY_START_TIME, startTime);
+ return this;
}
- @SuppressWarnings("unchecked")
public StartTime getEndTime() {
return (StartTime) getObject(StartTime.class, KEY_END_TIME);
}
- public void setEndTime( StartTime endTime ) {
- setParameters(KEY_END_TIME, endTime);
+ public SetMediaClockTimer setEndTime( StartTime endTime) {
+ setParameters(KEY_END_TIME, endTime);
+ return this;
}
/**
@@ -302,7 +302,7 @@ public class SetMediaClockTimer extends RPCRequest {
}
/**
* Sets the media clock/timer update mode (COUNTUP/COUNTDOWN/PAUSE/RESUME)
- *
+ *
* @param updateMode
* a Enumeration value (COUNTUP/COUNTDOWN/PAUSE/RESUME)
* <p></p>
@@ -313,9 +313,10 @@ public class SetMediaClockTimer extends RPCRequest {
* <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);
+ */
+ public SetMediaClockTimer setUpdateMode(@NonNull UpdateMode updateMode) {
+ setParameters(KEY_UPDATE_MODE, updateMode);
+ return this;
}
/**
@@ -330,7 +331,8 @@ public class SetMediaClockTimer extends RPCRequest {
/**
* Sets the playback status of a media app
*/
- public void setAudioStreamingIndicator(AudioStreamingIndicator audioStreamingIndicator ) {
- setParameters(KEY_AUDIO_STREAMING_INDICATOR, audioStreamingIndicator);
- }
+ public SetMediaClockTimer setAudioStreamingIndicator( AudioStreamingIndicator audioStreamingIndicator) {
+ setParameters(KEY_AUDIO_STREAMING_INDICATOR, audioStreamingIndicator);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Show.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Show.java
index e663c9f2b..f49b3ec0e 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Show.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Show.java
@@ -238,7 +238,7 @@ public class Show extends RPCRequest {
/**
* 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
@@ -251,9 +251,10 @@ public class Show extends RPCRequest {
* <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);
+ */
+ public Show setMainField1( String mainField1) {
+ setParameters(KEY_MAIN_FIELD_1, mainField1);
+ return this;
}
/**
* Gets the text displayed on the second display line of a two-line display
@@ -266,7 +267,7 @@ public class Show extends RPCRequest {
}
/**
* 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
@@ -281,9 +282,10 @@ public class Show extends RPCRequest {
* parameter is ignored</li>
* <li>Maxlength = 500</li>
* </ul>
- */
- public void setMainField2(String mainField2) {
- setParameters(KEY_MAIN_FIELD_2, mainField2);
+ */
+ public Show setMainField2( String mainField2) {
+ setParameters(KEY_MAIN_FIELD_2, mainField2);
+ return this;
}
/**
@@ -299,7 +301,7 @@ public class Show extends RPCRequest {
/**
* 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
@@ -316,8 +318,9 @@ public class Show extends RPCRequest {
* </ul>
* @since SmartDeviceLink 2.0
*/
- public void setMainField3(String mainField3) {
- setParameters(KEY_MAIN_FIELD_3, mainField3);
+ public Show setMainField3( String mainField3) {
+ setParameters(KEY_MAIN_FIELD_3, mainField3);
+ return this;
}
/**
@@ -333,7 +336,7 @@ public class Show extends RPCRequest {
/**
* 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
@@ -350,8 +353,9 @@ public class Show extends RPCRequest {
* </ul>
* @since SmartDeviceLink 2.0
*/
- public void setMainField4(String mainField4) {
- setParameters(KEY_MAIN_FIELD_4, mainField4);
+ public Show setMainField4( String mainField4) {
+ setParameters(KEY_MAIN_FIELD_4, mainField4);
+ return this;
}
/**
* Gets the alignment that Specifies how mainField1 and mainField2 text
@@ -365,7 +369,7 @@ public class Show extends RPCRequest {
/**
* Sets the alignment that Specifies how mainField1 and mainField2 text
* should be aligned on display
- *
+ *
* @param alignment
* an Enumeration value
* <p></p>
@@ -377,9 +381,10 @@ public class Show extends RPCRequest {
* mainField2 will be centered</li>
* <li>Has no effect with navigation display</li>
* </ul>
- */
- public void setAlignment(TextAlignment alignment) {
- setParameters(KEY_ALIGNMENT, alignment);
+ */
+ public Show setAlignment( TextAlignment alignment) {
+ setParameters(KEY_ALIGNMENT, alignment);
+ return this;
}
/**
* Gets text in the Status Bar
@@ -391,7 +396,7 @@ public class Show extends RPCRequest {
}
/**
* Sets text in the Status Bar
- *
+ *
* @param statusBar
* a String representing the text you want to add in the Status
* Bar
@@ -406,9 +411,10 @@ public class Show extends RPCRequest {
* <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);
+ */
+ public Show setStatusBar( String statusBar) {
+ setParameters(KEY_STATUS_BAR, statusBar);
+ return this;
}
/**
* Gets the String value of the MediaClock
@@ -422,9 +428,9 @@ public class Show extends RPCRequest {
/**
* Sets the value for the MediaClock field using a format described in the
* MediaClockFormat enumeration
- *
+ *
* @param mediaClock
- * a String value for the MdaiaClock
+ * a String value for the MediaClock
* <p></p>
* <b>Notes: </b>
* <ul>
@@ -436,8 +442,9 @@ public class Show extends RPCRequest {
* </ul>
*/
@Deprecated
- public void setMediaClock(String mediaClock) {
- setParameters(KEY_MEDIA_CLOCK, mediaClock);
+ public Show setMediaClock( String mediaClock) {
+ setParameters(KEY_MEDIA_CLOCK, mediaClock);
+ return this;
}
/**
* Gets the text in the track field
@@ -449,7 +456,7 @@ public class Show extends RPCRequest {
}
/**
* Sets the text in the track field
- *
+ *
* @param mediaTrack
* a String value displayed in the track field
* <p></p>
@@ -459,14 +466,15 @@ public class Show extends RPCRequest {
* <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);
+ */
+ public Show setMediaTrack( String mediaTrack) {
+ setParameters(KEY_MEDIA_TRACK, mediaTrack);
+ return this;
}
/**
* Sets an image to be shown on supported displays
- *
+ *
* @param graphic
* the value representing the image shown on supported displays
* <p></p>
@@ -474,8 +482,9 @@ public class Show extends RPCRequest {
* graphic shall not change
* @since SmartDeviceLink 2.0
*/
- public void setGraphic(Image graphic) {
- setParameters(KEY_GRAPHIC, graphic);
+ public Show setGraphic( Image graphic) {
+ setParameters(KEY_GRAPHIC, graphic);
+ return this;
}
/**
@@ -485,18 +494,17 @@ public class Show extends RPCRequest {
* 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);
+ public Show setSecondaryGraphic( Image secondaryGraphic) {
+ setParameters(KEY_SECONDARY_GRAPHIC, secondaryGraphic);
+ return this;
}
- @SuppressWarnings("unchecked")
public Image getSecondaryGraphic() {
return (Image) getObject(Image.class, KEY_SECONDARY_GRAPHIC);
}
@@ -516,9 +524,9 @@ public class Show extends RPCRequest {
/**
* Sets the the Soft buttons defined by the App
- *
+ *
* @param softButtons
- * a List value represemting the Soft buttons defined by the
+ * a List value representing the Soft buttons defined by the
* App
* <p></p>
* <b>Notes: </b>
@@ -528,11 +536,12 @@ public class Show extends RPCRequest {
* <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);
+ public Show setSoftButtons( List<SoftButton> softButtons) {
+ setParameters(KEY_SOFT_BUTTONS, softButtons);
+ return this;
}
/**
@@ -549,7 +558,7 @@ public class Show extends RPCRequest {
/**
* Sets the Custom Presets defined by the App
- *
+ *
* @param customPresets
* a List value representing the Custom Presets defined by the
* App
@@ -561,8 +570,9 @@ public class Show extends RPCRequest {
* </ul>
* @since SmartDeviceLink 2.0
*/
- public void setCustomPresets(List<String> customPresets) {
- setParameters(KEY_CUSTOM_PRESETS, customPresets);
+ public Show setCustomPresets( List<String> customPresets) {
+ setParameters(KEY_CUSTOM_PRESETS, customPresets);
+ return this;
}
/**
@@ -574,9 +584,10 @@ public class Show extends RPCRequest {
* <ul>
* @since SmartDeviceLink 4.5.0
*/
- public void setMetadataTags(MetadataTags metadataTags){
- setParameters(KEY_METADATA_TAGS, metadataTags);
- }
+ public Show setMetadataTags( MetadataTags metadataTags) {
+ setParameters(KEY_METADATA_TAGS, metadataTags);
+ return this;
+ }
/**
* Gets text field metadata defined by the App
@@ -599,9 +610,10 @@ public class Show extends RPCRequest {
*
* @since 6.0
*/
- public void setWindowID(Integer windowID) {
- setParameters(KEY_WINDOW_ID, windowID);
- }
+ public Show setWindowID( Integer windowID) {
+ setParameters(KEY_WINDOW_ID, windowID);
+ return this;
+ }
/**
* Gets the windowID.
@@ -619,7 +631,6 @@ public class Show extends RPCRequest {
*
* @since 6.0
*/
- @SuppressWarnings("unchecked")
public TemplateConfiguration getTemplateConfiguration() {
return (TemplateConfiguration) getObject(TemplateConfiguration.class, KEY_TEMPLATE_CONFIGURATION);
}
@@ -628,9 +639,10 @@ public class Show extends RPCRequest {
* Sets the templateConfiguration. It's used to set an alternate template layout to a window.
* @param templateConfiguration
*/
- public void setTemplateConfiguration(TemplateConfiguration templateConfiguration) {
- setParameters(KEY_TEMPLATE_CONFIGURATION, templateConfiguration);
- }
+ public Show setTemplateConfiguration( TemplateConfiguration templateConfiguration) {
+ setParameters(KEY_TEMPLATE_CONFIGURATION, templateConfiguration);
+ return this;
+ }
/**
* Sets the title of the new template that will be displayed.
@@ -643,9 +655,10 @@ public class Show extends RPCRequest {
* </ul>
* @since SmartDeviceLink 6.0.0
*/
- public void setTemplateTitle(String templateTitle){
- setParameters(KEY_TEMPLATE_TITLE, templateTitle);
- }
+ public Show setTemplateTitle( String templateTitle) {
+ setParameters(KEY_TEMPLATE_TITLE, templateTitle);
+ return this;
+ }
/**
* Gets the title of the new template that will be displayed
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowAppMenu.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowAppMenu.java
index 6c6c2e7c9..6531427d8 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowAppMenu.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowAppMenu.java
@@ -68,9 +68,10 @@ public class ShowAppMenu extends RPCRequest {
* previously added using `AddSubMenu`.
* @param menuID - The SubMenu ID to open
*/
- public void setMenuID(Integer menuID){
- setParameters(KEY_MENU_ID, menuID);
- }
+ public ShowAppMenu setMenuID( Integer menuID) {
+ setParameters(KEY_MENU_ID, menuID);
+ return this;
+ }
/**
* If omitted the HMI opens the apps menu.
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java
index 43ab3a137..b6c050739 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/ShowConstantTbt.java
@@ -84,14 +84,15 @@ public class ShowConstantTbt extends RPCRequest{
/**
* 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){
+ public ShowConstantTbt setNavigationText1( String navigationText1) {
setParameters(KEY_TEXT1, navigationText1);
+ return this;
}
/**
@@ -105,14 +106,15 @@ public class ShowConstantTbt extends RPCRequest{
/**
* 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){
+ public ShowConstantTbt setNavigationText2( String navigationText2) {
setParameters(KEY_TEXT2, navigationText2);
+ return this;
}
/**
@@ -126,14 +128,15 @@ public class ShowConstantTbt extends RPCRequest{
/**
* 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){
+ public ShowConstantTbt setEta( String eta) {
setParameters(KEY_ETA, eta);
+ return this;
}
/**
@@ -147,14 +150,15 @@ public class ShowConstantTbt extends RPCRequest{
/**
* 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){
+ public ShowConstantTbt setTotalDistance( String totalDistance) {
setParameters(KEY_TOTAL_DISTANCE, totalDistance);
+ return this;
}
/**
@@ -167,33 +171,34 @@ public class ShowConstantTbt extends RPCRequest{
}
/**
- * Sets an Image for turnicon
- *
+ * Sets an Image for turn icon
+ *
* @param turnIcon
* an Image value
*/
- public void setTurnIcon(Image turnIcon){
+ public ShowConstantTbt setTurnIcon( Image turnIcon) {
setParameters(KEY_MANEUVER_IMAGE, turnIcon);
+ return this;
}
/**
- * Gets an Image for turnicon
+ * Gets an Image for turn icon
*
* @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){
+ public ShowConstantTbt setNextTurnIcon( Image nextTurnIcon) {
setParameters(KEY_NEXT_MANEUVER_IMAGE, nextTurnIcon);
+ return this;
}
/**
@@ -201,21 +206,21 @@ public class ShowConstantTbt extends RPCRequest{
*
* @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){
+ public ShowConstantTbt setDistanceToManeuver( Double distanceToManeuver) {
setParameters(KEY_MANEUVER_DISTANCE, distanceToManeuver);
+ return this;
}
/**
@@ -229,14 +234,15 @@ public class ShowConstantTbt extends RPCRequest{
/**
* 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){
+ public ShowConstantTbt setDistanceToManeuverScale( Double distanceToManeuverScale) {
setParameters(KEY_MANEUVER_DISTANCE_SCALE, distanceToManeuverScale);
+ return this;
}
/**
@@ -252,13 +258,14 @@ public class ShowConstantTbt extends RPCRequest{
* <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){
+ public ShowConstantTbt setManeuverComplete( Boolean maneuverComplete) {
setParameters(KEY_MANEUVER_COMPLETE, maneuverComplete);
+ return this;
}
/**
@@ -273,14 +280,15 @@ public class ShowConstantTbt extends RPCRequest{
/**
* <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){
+ public ShowConstantTbt setSoftButtons( List<SoftButton> softButtons) {
setParameters(KEY_SOFT_BUTTONS, softButtons);
+ return this;
}
/**
@@ -294,8 +302,9 @@ public class ShowConstantTbt extends RPCRequest{
return (List<SoftButton>) getObject(SoftButton.class, KEY_SOFT_BUTTONS);
}
- public void setTimeToDestination(String timeToDestination){
+ public ShowConstantTbt setTimeToDestination( String timeToDestination) {
setParameters(KEY_TIME_TO_DESTINATION, timeToDestination);
+ return this;
}
public String getTimeToDestination(){
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java
index 7a0edfa3c..faadb2406 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SingleTireStatus.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -105,8 +105,9 @@ public class SingleTireStatus extends RPCStruct {
* 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);
+ public SingleTireStatus setStatus(@NonNull ComponentVolumeStatus status) {
+ setValue(KEY_STATUS, status);
+ return this;
}
/**
@@ -121,7 +122,10 @@ public class SingleTireStatus extends RPCStruct {
* 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); }
+ public SingleTireStatus setTPMS(@NonNull TPMS tpms) {
+ setValue(KEY_TPMS, tpms);
+ return this;
+ }
/**
* Get the status of TPMS according to the particular tire.
@@ -134,7 +138,10 @@ public class SingleTireStatus extends RPCStruct {
/**
* @param pressure The pressure value of the particular tire in kilo pascal.
*/
- public void setPressure(@NonNull Float pressure) { setValue(KEY_PRESSURE, pressure); }
+ public SingleTireStatus setPressure(@NonNull Float pressure) {
+ setValue(KEY_PRESSURE, pressure);
+ return this;
+ }
/**
* @return the pressure value of the particular tire in kilo pascal.
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java
index be97e14cd..0862ccc5e 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SisData.java
@@ -63,9 +63,10 @@ public class SisData extends RPCStruct {
*
* @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);
- }
+ public SisData setStationShortName( String stationShortName) {
+ setValue(KEY_STATION_SHORT_NAME, stationShortName);
+ return this;
+ }
/**
* Gets the stationShortName portion of the SisData class
@@ -81,16 +82,16 @@ public class SisData extends RPCStruct {
*
* @param stationIDNumber Consists of Country Code and FCC Facility ID
*/
- public void setStationIDNumber(StationIDNumber stationIDNumber) {
- setValue(KEY_STATION_ID_NUMBER, stationIDNumber);
- }
+ public SisData setStationIDNumber( StationIDNumber stationIDNumber) {
+ setValue(KEY_STATION_ID_NUMBER, stationIDNumber);
+ return this;
+ }
/**
* 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);
}
@@ -100,9 +101,10 @@ public class SisData extends RPCStruct {
*
* @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);
- }
+ public SisData setStationLongName( String stationLongName) {
+ setValue(KEY_STATION_LONG_NAME, stationLongName);
+ return this;
+ }
/**
* Gets the stationLongName portion of the SisData class
@@ -118,16 +120,16 @@ public class SisData extends RPCStruct {
*
* @param stationLocation Provides the 3-dimensional geographic station location.
*/
- public void setStationLocation(GPSData stationLocation) {
- setValue(KEY_STATION_LOCATION, stationLocation);
- }
+ public SisData setStationLocation( GPSData stationLocation) {
+ setValue(KEY_STATION_LOCATION, stationLocation);
+ return this;
+ }
/**
* 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);
}
@@ -138,9 +140,10 @@ public class SisData extends RPCStruct {
* @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);
- }
+ public SisData setStationMessage( String stationMessage) {
+ setValue(KEY_STATION_MESSAGE, stationMessage);
+ return this;
+ }
/**
* Gets the stationMessage portion of the SisData class
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java
index 374c610fe..0b9f10491 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Slider.java
@@ -168,15 +168,16 @@ public class Slider extends RPCRequest {
/**
* 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);
+ public Slider setNumTicks(@NonNull Integer numTicks) {
+ setParameters(KEY_NUM_TICKS, numTicks);
+ return this;
}
/**
@@ -191,15 +192,16 @@ public class Slider extends RPCRequest {
/**
* 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);
+ public Slider setPosition(@NonNull Integer position) {
+ setParameters(KEY_POSITION, position);
+ return this;
}
/**
@@ -214,14 +216,15 @@ public class Slider extends RPCRequest {
/**
* 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);
+ public Slider setSliderHeader(@NonNull String sliderHeader) {
+ setParameters(KEY_SLIDER_HEADER, sliderHeader);
+ return this;
}
/**
@@ -235,14 +238,15 @@ public class Slider extends RPCRequest {
/**
* 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);
+ public Slider setSliderFooter( List<String> sliderFooter) {
+ setParameters(KEY_SLIDER_FOOTER, sliderFooter);
+ return this;
}
/**
@@ -257,14 +261,15 @@ public class Slider extends RPCRequest {
/**
* 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);
+ public Slider setTimeout( Integer timeout) {
+ setParameters(KEY_TIMEOUT, timeout);
+ return this;
}
/**
@@ -293,7 +298,8 @@ public class Slider extends RPCRequest {
*
* @since SmartDeviceLink 6.0
*/
- public void setCancelID(Integer cancelID) {
- setParameters(KEY_CANCEL_ID, cancelID);
- }
+ public Slider setCancelID( Integer cancelID) {
+ setParameters(KEY_CANCEL_ID, cancelID);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java
index cad93b19b..5f802bd19 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SliderResponse.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -81,8 +81,9 @@ public class SliderResponse extends RPCResponse {
* 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);
+ public SliderResponse setSliderPosition( Integer sliderPosition) {
+ setParameters(KEY_SLIDER_POSITION, sliderPosition);
+ return this;
}
/**
* Gets an Initial position of slider control
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java
index bfafea14e..8ff2868a6 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButton.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -136,39 +136,44 @@ public class SoftButton extends RPCStruct {
setSoftButtonID(softButtonID);
}
- public void setType(@NonNull SoftButtonType type) {
+ public SoftButton setType(@NonNull SoftButtonType type) {
setValue(KEY_TYPE, type);
+ return this;
}
public SoftButtonType getType() {
return (SoftButtonType) getObject(SoftButtonType.class, KEY_TYPE);
}
- public void setText(String text) {
+ public SoftButton setText( String text) {
setValue(KEY_TEXT, text);
+ return this;
}
public String getText() {
return getString(KEY_TEXT);
}
- public void setImage(Image image) {
+ public SoftButton setImage( Image image) {
setValue(KEY_IMAGE, image);
+ return this;
}
- @SuppressWarnings("unchecked")
public Image getImage() {
return (Image) getObject(Image.class, KEY_IMAGE);
}
- public void setIsHighlighted(Boolean isHighlighted) {
+ public SoftButton setIsHighlighted( Boolean isHighlighted) {
setValue(KEY_IS_HIGHLIGHTED, isHighlighted);
+ return this;
}
public Boolean getIsHighlighted() {
return getBoolean(KEY_IS_HIGHLIGHTED);
}
- public void setSoftButtonID(@NonNull Integer softButtonID) {
+ public SoftButton setSoftButtonID(@NonNull Integer softButtonID) {
setValue(KEY_SOFT_BUTTON_ID, softButtonID);
+ return this;
}
public Integer getSoftButtonID() {
return getInteger(KEY_SOFT_BUTTON_ID);
}
- public void setSystemAction(SystemAction systemAction) {
+ public SoftButton setSystemAction( SystemAction systemAction) {
setValue(KEY_SYSTEM_ACTION, systemAction);
+ return this;
}
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
index bdd2a0b9b..baac6ecda 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SoftButtonCapabilities.java
@@ -131,8 +131,9 @@ public class SoftButtonCapabilities extends RPCStruct {
* set the button supports a short press.
* @param shortPressAvailable whether the button supports a short press.
*/
- public void setShortPressAvailable(@NonNull Boolean shortPressAvailable) {
+ public SoftButtonCapabilities setShortPressAvailable(@NonNull Boolean shortPressAvailable) {
setValue(KEY_SHORT_PRESS_AVAILABLE, shortPressAvailable);
+ return this;
}
/**
@@ -147,8 +148,9 @@ public class SoftButtonCapabilities extends RPCStruct {
* set the button supports a LONG press.
* @param longPressAvailable whether the button supports a long press
*/
- public void setLongPressAvailable(@NonNull Boolean longPressAvailable) {
+ public SoftButtonCapabilities setLongPressAvailable(@NonNull Boolean longPressAvailable) {
setValue(KEY_LONG_PRESS_AVAILABLE, longPressAvailable);
+ return this;
}
/**
@@ -160,11 +162,12 @@ public class SoftButtonCapabilities extends RPCStruct {
}
/**
- * set the button supports "button down" and "button up".
- * @param upDownAvailable the button supports "button down" and "button up".
+ * 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) {
+ public SoftButtonCapabilities setUpDownAvailable(@NonNull Boolean upDownAvailable) {
setValue(KEY_UP_DOWN_AVAILABLE, upDownAvailable);
+ return this;
}
/**
@@ -179,8 +182,9 @@ public class SoftButtonCapabilities extends RPCStruct {
* 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) {
+ public SoftButtonCapabilities setImageSupported(@NonNull Boolean imageSupported) {
setValue(KEY_IMAGE_SUPPORTED, imageSupported);
+ return this;
}
/**
@@ -196,8 +200,9 @@ public class SoftButtonCapabilities extends RPCStruct {
* @param textSupported whether the button supports the use of text or not.
* @since 6.0
*/
- public void setTextSupported(Boolean textSupported) {
+ public SoftButtonCapabilities setTextSupported( Boolean textSupported) {
setValue(KEY_TEXT_SUPPORTED, textSupported);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java
index a0c66a99f..d48e6e757 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Speak.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -180,7 +180,7 @@ public class Speak extends RPCRequest {
/**
* 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
@@ -192,8 +192,9 @@ public class Speak extends RPCRequest {
* 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);
+ */
+ public Speak setTtsChunks(@NonNull List<TTSChunk> ttsChunks) {
+ setParameters(KEY_TTS_CHUNKS, ttsChunks);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/StabilityControlsStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/StabilityControlsStatus.java
new file mode 100644
index 000000000..78eb84149
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/StabilityControlsStatus.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2017 - 2020, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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.VehicleDataStatus;
+
+import java.util.Hashtable;
+
+/**
+ *
+ * <p><b>Parameter List</b></p>
+ *
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Required</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>escSystem</td>
+ * <td>VehicleDataStatus</td>
+ * <td>true if vehicle stability control is ON, else false</td>
+ * <td>N</td>
+ * <td></td>
+ * <td></td>
+ * </tr>
+ * <tr>
+ * <td>trailerSwayControl</td>
+ * <td>VehicleDataStatus</td>
+ * <td>true if vehicle trailer sway control is ON, else false</td>
+ * <td>N</td>
+ * <td></td>
+ * <td></td>
+ * </tr>
+ * </table>
+ * @since SmartDeviceLink 7.0.0
+ */
+public class StabilityControlsStatus extends RPCStruct {
+ public static final String KEY_ESC_SYSTEM = "escSystem";
+ public static final String KEY_TRAILER_SWAY_CONTROL = "trailerSwayControl";
+
+
+ /**
+ * Constructs a new StabilityControlsStatus object
+ */
+ public StabilityControlsStatus() { }
+
+ /**
+ * Constructs a new StabilityControlsStatus object indicated by the Hashtable parameter
+ *
+ * @param hash The Hashtable to use
+ */
+ public StabilityControlsStatus(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ /**
+ * Gets the escSystem.
+ *
+ * @return VehicleDataStatus true if vehicle stability control is ON, else false
+ */
+ public VehicleDataStatus getEscSystem() {
+ return (VehicleDataStatus) getObject(VehicleDataStatus.class, KEY_ESC_SYSTEM);
+ }
+
+ /**
+ * Sets the escSystem.
+ *
+ * @param escSystem true if vehicle stability control is ON, else false
+ */
+ public StabilityControlsStatus setEscSystem( VehicleDataStatus escSystem) {
+ setValue(KEY_ESC_SYSTEM, escSystem);
+ return this;
+ }
+
+ /**
+ * Sets the trailerSwayControl.
+ *
+ * @param trailerSwayControl true if vehicle trailer sway control is ON, else false
+ */
+ public StabilityControlsStatus setTrailerSwayControl( VehicleDataStatus trailerSwayControl) {
+ setValue(KEY_TRAILER_SWAY_CONTROL, trailerSwayControl);
+ return this;
+ }
+
+ /**
+ * Gets the trailerSwayControl.
+ *
+ * @return VehicleDataStatus true if vehicle trailer sway control is ON, else false
+ */
+ public VehicleDataStatus getTrailerSwayControl() {
+ return (VehicleDataStatus) getObject(VehicleDataStatus.class, KEY_TRAILER_SWAY_CONTROL);
+ }
+}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java
index 96060d535..fd7f640bf 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/StartTime.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -124,9 +124,10 @@ public class StartTime extends RPCStruct {
* 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 ) {
+ */
+ public StartTime setHours(@NonNull Integer hours) {
setValue(KEY_HOURS, hours);
+ return this;
}
/**
* Get the minute. Minvalue="0", maxvalue="59".
@@ -138,9 +139,10 @@ public class StartTime extends RPCStruct {
/**
* Set the minute. Minvalue="0", maxvalue="59".
* @param minutes min: 0; max: 59
- */
- public void setMinutes( @NonNull Integer minutes ) {
+ */
+ public StartTime setMinutes(@NonNull Integer minutes) {
setValue(KEY_MINUTES, minutes);
+ return this;
}
/**
* Get the second. Minvalue="0", maxvalue="59".
@@ -152,8 +154,9 @@ public class StartTime extends RPCStruct {
/**
* Set the second. Minvalue="0", maxvalue="59".
* @param seconds min: 0 max: 59
- */
- public void setSeconds( @NonNull Integer seconds ) {
+ */
+ public StartTime setSeconds(@NonNull Integer seconds) {
setValue(KEY_SECONDS, seconds);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java
index b75cb3752..fd0365e66 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/StationIDNumber.java
@@ -51,9 +51,10 @@ public class StationIDNumber extends RPCStruct {
*
* @param countryCode Binary Representation of ITU Country Code. USA Code is 001.
*/
- public void setCountryCode(Integer countryCode) {
- setValue(KEY_COUNTRY_CODE, countryCode);
- }
+ public StationIDNumber setCountryCode( Integer countryCode) {
+ setValue(KEY_COUNTRY_CODE, countryCode);
+ return this;
+ }
/**
* Gets the countryCode portion of the StationIDNumber class
@@ -69,9 +70,10 @@ public class StationIDNumber extends RPCStruct {
*
* @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);
- }
+ public StationIDNumber setFccFacilityId( Integer fccFacilityId) {
+ setValue(KEY_FCC_FACILITY_ID, fccFacilityId);
+ return this;
+ }
/**
* Gets the fccFacilityId portion of the StationIDNumber class
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java
index 3c830dd61..171c4b18e 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeButton.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -144,9 +144,10 @@ public class SubscribeButton extends RPCRequest {
}
/**
* 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 ) {
+ * @param buttonName a <i>{@linkplain ButtonName}</i> value
+ */
+ public SubscribeButton setButtonName(@NonNull ButtonName buttonName) {
setParameters(KEY_BUTTON_NAME, buttonName);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java
index 9b67c145f..437b42de7 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleData.java
@@ -84,23 +84,31 @@ import java.util.Hashtable;
* <tr>
* <td>fuelLevel</td>
* <td>Boolean</td>
- * <td>The fuel level in the tank (percentage)</td>
+ * <td>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec7.0, please see fuelRange.</td>
* <td>N</td>
* <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
+ * <td>SmartDeviceLink 7.0.0</td>
* </tr>
* <tr>
* <td>fuelLevel_State</td>
* <td>Boolean</td>
- * <td>The fuel level state</td>
+ * <td>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange.</td>
* <td>N</td>
* <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
+ * <tr>
+ * <td>fuelRange</td>
+ * <td>Boolean</td>
+ * <td>The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle. See struct FuelRange for details.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 5.0.0</td>
* </tr>
* <tr>
* <td>instantFuelConsumption</td>
* <td>Boolean</td>
- * <td>The instantaneous fuel consumption in microlitres</td>
+ * <td>The instantaneous fuel consumption in micro litres</td>
* <td>N</td>
* <td>Subscribable</td>
* <td>SmartDeviceLink 2.0 </td>
@@ -293,6 +301,13 @@ import java.util.Hashtable;
* <td>N</td>
* <td>SmartDeviceLink 7.0.0</td>
* </tr>
+ * <tr>
+ * <td>stabilityControlsStatus</td>
+ * <td>Boolean</td>
+ * <td>See StabilityControlsStatus</td>
+ * <td>N</td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
* </table>
*
* <p> <b>Response</b></p>
@@ -315,14 +330,12 @@ import java.util.Hashtable;
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";
@@ -345,6 +358,17 @@ public class SubscribeVehicleData extends RPCRequest {
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
public static final String KEY_WINDOW_STATUS = "windowStatus";
public static final String KEY_GEAR_STATUS = "gearStatus";
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
/**
* Constructs a new SubscribeVehicleData object
@@ -367,12 +391,13 @@ public class SubscribeVehicleData extends RPCRequest {
/**
* Sets a boolean value. If true, subscribes Gps data
- *
+ *
* @param gps
* a boolean value
*/
- public void setGps(Boolean gps) {
- setParameters(KEY_GPS, gps);
+ public SubscribeVehicleData setGps( Boolean gps) {
+ setParameters(KEY_GPS, gps);
+ return this;
}
/**
@@ -387,12 +412,13 @@ public class SubscribeVehicleData extends RPCRequest {
/**
* Sets a boolean value. If true, subscribes speed data
- *
+ *
* @param speed
* a boolean value
*/
- public void setSpeed(Boolean speed) {
- setParameters(KEY_SPEED, speed);
+ public SubscribeVehicleData setSpeed( Boolean speed) {
+ setParameters(KEY_SPEED, speed);
+ return this;
}
/**
@@ -407,12 +433,13 @@ public class SubscribeVehicleData extends RPCRequest {
/**
* Sets a boolean value. If true, subscribes rpm data
- *
+ *
* @param rpm
* a boolean value
*/
- public void setRpm(Boolean rpm) {
- setParameters(KEY_RPM, rpm);
+ public SubscribeVehicleData setRpm( Boolean rpm) {
+ setParameters(KEY_RPM, rpm);
+ return this;
}
/**
@@ -426,34 +453,38 @@ public class SubscribeVehicleData extends RPCRequest {
}
/**
- * Sets a boolean value. If true, subscribes FuelLevel data
- *
- * @param fuelLevel
- * a boolean value
+ * Sets the fuelLevel.
+ *
+ * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
*/
- public void setFuelLevel(Boolean fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ @Deprecated
+ public SubscribeVehicleData setFuelLevel( Boolean fuelLevel) {
+ setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ return this;
}
/**
- * Gets a boolean value. If true, means the FuelLevel data has been
- * subscribed.
+ * Gets the fuelLevel.
*
- * @return Boolean -a Boolean value. If true, means the FuelLevel data has
- * been subscribed.
+ * @return Float The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
*/
+ @Deprecated
public Boolean getFuelLevel() {
return getBoolean(KEY_FUEL_LEVEL);
}
/**
* 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);
+ @Deprecated
+ public SubscribeVehicleData setFuelLevelState( Boolean fuelLevelState) {
+ setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ return this;
}
/**
@@ -463,18 +494,20 @@ public class SubscribeVehicleData extends RPCRequest {
* @return Boolean -a Boolean value. If true, means the fuelLevelState data
* has been subscribed.
*/
- public Boolean getFuelLevelState() {
+ @Deprecated
+ 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);
+ public SubscribeVehicleData setInstantFuelConsumption( Boolean instantFuelConsumption) {
+ setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ return this;
}
/**
@@ -490,12 +523,13 @@ public class SubscribeVehicleData extends RPCRequest {
/**
* Sets a boolean value. If true, subscribes externalTemperature data
- *
+ *
* @param externalTemperature
* a boolean value
*/
- public void setExternalTemperature(Boolean externalTemperature) {
- setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ public SubscribeVehicleData setExternalTemperature( Boolean externalTemperature) {
+ setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ return this;
}
/**
@@ -515,8 +549,9 @@ public class SubscribeVehicleData extends RPCRequest {
* @param gearStatus See GearStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setGearStatus(Boolean gearStatus) {
+ public SubscribeVehicleData setGearStatus( Boolean gearStatus) {
setParameters(KEY_GEAR_STATUS, gearStatus);
+ return this;
}
/**
@@ -536,8 +571,9 @@ public class SubscribeVehicleData extends RPCRequest {
* @deprecated in SmartDeviceLink 7.0.0
*/
@Deprecated
- public void setPrndl(Boolean prndl) {
- setParameters(KEY_PRNDL, prndl);
+ public SubscribeVehicleData setPrndl( Boolean prndl) {
+ setParameters(KEY_PRNDL, prndl);
+ return this;
}
/**
@@ -553,12 +589,13 @@ public class SubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public SubscribeVehicleData setTirePressure( Boolean tirePressure) {
+ setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ return this;
}
/**
@@ -574,12 +611,13 @@ public class SubscribeVehicleData extends RPCRequest {
/**
* Sets a boolean value. If true, subscribes odometer data
- *
+ *
* @param odometer
* a boolean value
*/
- public void setOdometer(Boolean odometer) {
- setParameters(KEY_ODOMETER, odometer);
+ public SubscribeVehicleData setOdometer( Boolean odometer) {
+ setParameters(KEY_ODOMETER, odometer);
+ return this;
}
/**
@@ -595,12 +633,13 @@ public class SubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public SubscribeVehicleData setBeltStatus( Boolean beltStatus) {
+ setParameters(KEY_BELT_STATUS, beltStatus);
+ return this;
}
/**
@@ -616,12 +655,13 @@ public class SubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public SubscribeVehicleData setBodyInformation( Boolean bodyInformation) {
+ setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ return this;
}
/**
@@ -637,12 +677,13 @@ public class SubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public SubscribeVehicleData setDeviceStatus( Boolean deviceStatus) {
+ setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ return this;
}
/**
@@ -658,12 +699,13 @@ public class SubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public SubscribeVehicleData setDriverBraking( Boolean driverBraking) {
+ setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ return this;
}
/**
@@ -679,12 +721,13 @@ public class SubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public SubscribeVehicleData setWiperStatus( Boolean wiperStatus) {
+ setParameters(KEY_WIPER_STATUS, wiperStatus);
+ return this;
}
/**
@@ -700,12 +743,13 @@ public class SubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public SubscribeVehicleData setHeadLampStatus( Boolean headLampStatus) {
+ setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ return this;
}
/**
@@ -725,9 +769,10 @@ public class SubscribeVehicleData extends RPCRequest {
* @param engineTorque
* a boolean value
*/
- public void setEngineTorque(Boolean engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- }
+ public SubscribeVehicleData setEngineTorque( Boolean engineTorque) {
+ setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ return this;
+ }
/**
* Gets a boolean value. If true, means the Engine Oil Life data has been
@@ -746,9 +791,10 @@ public class SubscribeVehicleData extends RPCRequest {
* @param engineOilLife
* a boolean value
*/
- public void setEngineOilLife(Boolean engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- }
+ public SubscribeVehicleData setEngineOilLife( Boolean engineOilLife) {
+ setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ return this;
+ }
/**
* Gets a boolean value. If true, means the Engine Torque data has been
@@ -767,8 +813,9 @@ public class SubscribeVehicleData extends RPCRequest {
* @param accPedalPosition
* a boolean value
*/
- public void setAccPedalPosition(Boolean accPedalPosition) {
- setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ public SubscribeVehicleData setAccPedalPosition( Boolean accPedalPosition) {
+ setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ return this;
}
/**
@@ -782,61 +829,68 @@ public class SubscribeVehicleData extends RPCRequest {
return getBoolean(KEY_ACC_PEDAL_POSITION);
}
- public void setSteeringWheelAngle(Boolean steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ public SubscribeVehicleData setSteeringWheelAngle( Boolean steeringWheelAngle) {
+ setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ return this;
}
public Boolean getSteeringWheelAngle() {
return getBoolean(KEY_STEERING_WHEEL_ANGLE);
}
- public void setECallInfo(Boolean eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
+ public SubscribeVehicleData setECallInfo( Boolean eCallInfo) {
+ setParameters(KEY_E_CALL_INFO, eCallInfo);
+ return this;
}
public Boolean getECallInfo() {
return getBoolean(KEY_E_CALL_INFO);
}
- public void setAirbagStatus(Boolean airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ public SubscribeVehicleData setAirbagStatus( Boolean airbagStatus) {
+ setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ return this;
}
public Boolean getAirbagStatus() {
return getBoolean(KEY_AIRBAG_STATUS);
}
- public void setEmergencyEvent(Boolean emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ public SubscribeVehicleData setEmergencyEvent( Boolean emergencyEvent) {
+ setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ return this;
}
public Boolean getEmergencyEvent() {
return getBoolean(KEY_EMERGENCY_EVENT);
}
- public void setClusterModeStatus(Boolean clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ public SubscribeVehicleData setClusterModeStatus( Boolean clusterModeStatus) {
+ setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ return this;
}
public Boolean getClusterModeStatus() {
return getBoolean(KEY_CLUSTER_MODE_STATUS);
}
- public void setMyKey(Boolean myKey) {
- setParameters(KEY_MY_KEY, myKey);
+ public SubscribeVehicleData setMyKey( Boolean myKey) {
+ setParameters(KEY_MY_KEY, myKey);
+ return this;
}
public Boolean getMyKey() {
return getBoolean(KEY_MY_KEY);
}
/**
- * Sets a boolean value. If true, subscribes fuelRange data
+ * Sets the fuelRange.
*
- * @param fuelRange
- * a boolean value
+ * @param fuelRange The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
+ * vehicle. See struct FuelRange for details.
+ * @since SmartDeviceLink 5.0.0
*/
- public void setFuelRange(Boolean fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- }
+ public SubscribeVehicleData setFuelRange( Boolean fuelRange) {
+ setParameters(KEY_FUEL_RANGE, fuelRange);
+ return this;
+ }
/**
- * 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.
+ * Gets the fuelRange.
*
+ * @return Boolean The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
+ * vehicle. See struct FuelRange for details.
+ * @since SmartDeviceLink 5.0.0
*/
public Boolean getFuelRange() {
return getBoolean(KEY_FUEL_RANGE);
@@ -846,7 +900,10 @@ public class SubscribeVehicleData extends RPCRequest {
* Sets a boolean value. If true, subscribes turnSignal data
* @param turnSignal a boolean value
*/
- public void setTurnSignal(Boolean turnSignal) { setParameters(KEY_TURN_SIGNAL, turnSignal); }
+ public SubscribeVehicleData setTurnSignal( Boolean turnSignal) {
+ setParameters(KEY_TURN_SIGNAL, turnSignal);
+ return this;
+ }
/**
* Gets a boolean value. If true, means the turnSignal data has been subscribed.
@@ -858,9 +915,10 @@ public class SubscribeVehicleData extends RPCRequest {
* 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);
- }
+ public SubscribeVehicleData setElectronicParkBrakeStatus( boolean electronicParkBrakeStatus) {
+ setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ return this;
+ }
/**
* Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed.
@@ -874,9 +932,10 @@ public class SubscribeVehicleData extends RPCRequest {
* 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);
- }
+ public SubscribeVehicleData setCloudAppVehicleID( boolean cloudAppVehicleID) {
+ setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ return this;
+ }
/**
* Gets a boolean value. If true, means the cloudAppVehicleDataID data has been subscribed.
@@ -891,9 +950,10 @@ public class SubscribeVehicleData extends RPCRequest {
* @param vehicleDataName a String value
* @param vehicleDataState a boolean value
*/
- public void setOEMCustomVehicleData(String vehicleDataName, Boolean vehicleDataState){
- setParameters(vehicleDataName, vehicleDataState);
- }
+ public SubscribeVehicleData setOEMCustomVehicleData( String vehicleDataName, Boolean vehicleDataState) {
+ setParameters(vehicleDataName, vehicleDataState);
+ return this;
+ }
/**
* Gets a boolean value for OEM Custom VehicleData.
@@ -909,8 +969,9 @@ public class SubscribeVehicleData extends RPCRequest {
* @param windowStatus See WindowStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setWindowStatus(Boolean windowStatus) {
+ public SubscribeVehicleData setWindowStatus( Boolean windowStatus) {
setParameters(KEY_WINDOW_STATUS, windowStatus);
+ return this;
}
/**
@@ -929,8 +990,9 @@ public class SubscribeVehicleData extends RPCRequest {
* @param handsOffSteering To indicate whether driver hands are off the steering wheel
* @since SmartDeviceLink 7.0.0
*/
- public void setHandsOffSteering(Boolean handsOffSteering) {
+ public SubscribeVehicleData setHandsOffSteering( Boolean handsOffSteering) {
setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
+ return this;
}
/**
@@ -942,4 +1004,25 @@ public class SubscribeVehicleData extends RPCRequest {
public Boolean getHandsOffSteering() {
return getBoolean(KEY_HANDS_OFF_STEERING);
}
+
+ /**
+ * Gets the stabilityControlsStatus.
+ *
+ * @return Boolean See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public Boolean getStabilityControlsStatus() {
+ return getBoolean(KEY_STABILITY_CONTROLS_STATUS);
+ }
+
+ /**
+ * Sets the stabilityControlsStatus.
+ *
+ * @param stabilityControlsStatus See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public SubscribeVehicleData setStabilityControlsStatus( Boolean stabilityControlsStatus) {
+ setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java
index cb869336a..a32b7d5ed 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubscribeVehicleDataResponse.java
@@ -47,7 +47,6 @@ import java.util.Hashtable;
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";
@@ -55,7 +54,6 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
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";
@@ -77,6 +75,17 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
public static final String KEY_GEAR_STATUS = "gearStatus";
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
public static final String KEY_WINDOW_STATUS = "windowStatus";
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
/**
* Constructs a new SubscribeVehicleDataResponse object
@@ -109,14 +118,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Gps
* @param gps a VehicleDataResult related to GPS
*/
- public void setGps(VehicleDataResult gps) {
+ public SubscribeVehicleDataResponse setGps( VehicleDataResult gps) {
setParameters(KEY_GPS, gps);
+ return this;
}
/**
* Gets Gps
* @return a VehicleDataResult related to GPS
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getGps() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GPS);
}
@@ -124,14 +133,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Speed
* @param speed a VehicleDataResult related to speed
*/
- public void setSpeed(VehicleDataResult speed) {
+ public SubscribeVehicleDataResponse setSpeed( VehicleDataResult speed) {
setParameters(KEY_SPEED, speed);
+ return this;
}
/**
* Gets Speed
* @return a VehicleDataResult related to speed
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getSpeed() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_SPEED);
}
@@ -139,29 +148,35 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets rpm
* @param rpm a VehicleDataResult related to RPM
*/
- public void setRpm(VehicleDataResult rpm) {
+ public SubscribeVehicleDataResponse setRpm( VehicleDataResult rpm) {
setParameters(KEY_RPM, rpm);
+ return this;
}
/**
* 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
+ * Sets the fuelLevel.
+ *
+ * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
*/
- public void setFuelLevel(VehicleDataResult fuelLevel) {
+ @Deprecated
+ public SubscribeVehicleDataResponse setFuelLevel( VehicleDataResult fuelLevel) {
setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ return this;
}
/**
- * Gets Fuel Level
- * @return a VehicleDataResult related to FuelLevel
+ * Gets the fuelLevel.
+ *
+ * @return VehicleDataResult The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
*/
- @SuppressWarnings("unchecked")
+ @Deprecated
public VehicleDataResult getFuelLevel() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL);
}
@@ -169,14 +184,16 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Fuel Level State
* @param fuelLevelState a VehicleDataResult related to FuelLevel State
*/
- public void setFuelLevelState(VehicleDataResult fuelLevelState) {
+ @Deprecated
+ public SubscribeVehicleDataResponse setFuelLevelState( VehicleDataResult fuelLevelState) {
setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ return this;
}
/**
* Gets Fuel Level State
* @return a VehicleDataResult related to FuelLevel State
*/
- @SuppressWarnings("unchecked")
+ @Deprecated
public VehicleDataResult getFuelLevelState() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL_STATE);
}
@@ -184,14 +201,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Instant Fuel Consumption
* @param instantFuelConsumption a VehicleDataResult related to instant fuel consumption
*/
- public void setInstantFuelConsumption(VehicleDataResult instantFuelConsumption) {
+ public SubscribeVehicleDataResponse setInstantFuelConsumption( VehicleDataResult instantFuelConsumption) {
setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ return this;
}
/**
* 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);
}
@@ -199,14 +216,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets External Temperature
* @param externalTemperature a VehicleDataResult related to external temperature
*/
- public void setExternalTemperature(VehicleDataResult externalTemperature) {
+ public SubscribeVehicleDataResponse setExternalTemperature( VehicleDataResult externalTemperature) {
setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ return this;
}
/**
* Gets External Temperature
* @return a VehicleDataResult related to external temperature
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getExternalTemperature() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EXTERNAL_TEMPERATURE);
}
@@ -217,8 +234,9 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* @deprecated in SmartDeviceLink 7.0.0
*/
@Deprecated
- public void setPrndl(VehicleDataResult prndl) {
+ public SubscribeVehicleDataResponse setPrndl( VehicleDataResult prndl) {
setParameters(KEY_PRNDL, prndl);
+ return this;
}
/**
* Gets the prndl.
@@ -227,7 +245,6 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* @deprecated in SmartDeviceLink 7.0.0
*/
@Deprecated
- @SuppressWarnings("unchecked")
public VehicleDataResult getPrndl() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_PRNDL);
}
@@ -235,14 +252,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Tire Pressure
* @param tirePressure a VehicleDataResult related to tire pressure
*/
- public void setTirePressure(VehicleDataResult tirePressure) {
+ public SubscribeVehicleDataResponse setTirePressure( VehicleDataResult tirePressure) {
setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ return this;
}
/**
* Gets Tire Pressure
* @return a VehicleDataResult related to tire pressure
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getTirePressure() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TIRE_PRESSURE);
}
@@ -250,14 +267,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Odometer
* @param odometer a VehicleDataResult related to the odometer
*/
- public void setOdometer(VehicleDataResult odometer) {
+ public SubscribeVehicleDataResponse setOdometer( VehicleDataResult odometer) {
setParameters(KEY_ODOMETER, odometer);
+ return this;
}
/**
* Gets Odometer
* @return a VehicleDataResult related to the odometer
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getOdometer() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ODOMETER);
}
@@ -265,14 +282,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Belt Status
* @param beltStatus a VehicleDataResult related to the seat belt status
*/
- public void setBeltStatus(VehicleDataResult beltStatus) {
+ public SubscribeVehicleDataResponse setBeltStatus( VehicleDataResult beltStatus) {
setParameters(KEY_BELT_STATUS, beltStatus);
+ return this;
}
/**
* 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);
}
@@ -280,14 +297,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Body Information
* @param bodyInformation a VehicleDataResult related to the body info
*/
- public void setBodyInformation(VehicleDataResult bodyInformation) {
+ public SubscribeVehicleDataResponse setBodyInformation( VehicleDataResult bodyInformation) {
setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ return this;
}
/**
* Gets Body Information
* @return a VehicleDataResult related to the body info
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getBodyInformation() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BODY_INFORMATION);
}
@@ -295,14 +312,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Device Status
* @param deviceStatus a VehicleDataResult related to the device status of the connected device
*/
- public void setDeviceStatus(VehicleDataResult deviceStatus) {
+ public SubscribeVehicleDataResponse setDeviceStatus( VehicleDataResult deviceStatus) {
setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ return this;
}
/**
* 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);
}
@@ -310,14 +327,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Driver Braking
* @param driverBraking a VehicleDataResult related to the driver breaking status
*/
- public void setDriverBraking(VehicleDataResult driverBraking) {
+ public SubscribeVehicleDataResponse setDriverBraking( VehicleDataResult driverBraking) {
setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ return this;
}
/**
* 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);
}
@@ -325,14 +342,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Wiper Status
* @param wiperStatus a VehicleDataResult related to the wiper status
*/
- public void setWiperStatus(VehicleDataResult wiperStatus) {
+ public SubscribeVehicleDataResponse setWiperStatus( VehicleDataResult wiperStatus) {
setParameters(KEY_WIPER_STATUS, wiperStatus);
+ return this;
}
/**
* Gets Wiper Status
* @return a VehicleDataResult related to the wiper status
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getWiperStatus() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WIPER_STATUS);
}
@@ -340,14 +357,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Head Lamp Status
* @param headLampStatus a VehicleDataResult related to the headlamp status
*/
- public void setHeadLampStatus(VehicleDataResult headLampStatus) {
+ public SubscribeVehicleDataResponse setHeadLampStatus( VehicleDataResult headLampStatus) {
setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ return this;
}
/**
* 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);
}
@@ -355,14 +372,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Engine Torque
* @param engineTorque a VehicleDataResult related to the engine's torque
*/
- public void setEngineTorque(VehicleDataResult engineTorque) {
+ public SubscribeVehicleDataResponse setEngineTorque( VehicleDataResult engineTorque) {
setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ return this;
}
/**
* 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);
}
@@ -370,14 +387,14 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets Engine Oil Life
* @param engineOilLife a VehicleDataResult related to the engine's oil life
*/
- public void setEngineOilLife(VehicleDataResult engineOilLife) {
+ public SubscribeVehicleDataResponse setEngineOilLife( VehicleDataResult engineOilLife) {
setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ return this;
}
/**
* 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);
}
@@ -385,76 +402,82 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets AccPedal Position
* @param accPedalPosition a VehicleDataResult related to the accelerator pedal's position
*/
- public void setAccPedalPosition(VehicleDataResult accPedalPosition) {
+ public SubscribeVehicleDataResponse setAccPedalPosition( VehicleDataResult accPedalPosition) {
setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ return this;
}
/**
* 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) {
+ public SubscribeVehicleDataResponse setSteeringWheelAngle( VehicleDataResult steeringWheelAngle) {
setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ return this;
}
- @SuppressWarnings("unchecked")
public VehicleDataResult getSteeringWheelAngle() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STEERING_WHEEL_ANGLE);
}
- public void setECallInfo(VehicleDataResult eCallInfo) {
+ public SubscribeVehicleDataResponse setECallInfo( VehicleDataResult eCallInfo) {
setParameters(KEY_E_CALL_INFO, eCallInfo);
+ return this;
}
- @SuppressWarnings("unchecked")
public VehicleDataResult getECallInfo() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_E_CALL_INFO);
}
- public void setAirbagStatus(VehicleDataResult airbagStatus) {
+ public SubscribeVehicleDataResponse setAirbagStatus( VehicleDataResult airbagStatus) {
setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public VehicleDataResult getAirbagStatus() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_AIRBAG_STATUS);
}
- public void setEmergencyEvent(VehicleDataResult emergencyEvent) {
+ public SubscribeVehicleDataResponse setEmergencyEvent( VehicleDataResult emergencyEvent) {
setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ return this;
}
- @SuppressWarnings("unchecked")
public VehicleDataResult getEmergencyEvent() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EMERGENCY_EVENT);
}
- public void setClusterModeStatus(VehicleDataResult clusterModeStatus) {
+ public SubscribeVehicleDataResponse setClusterModeStatus( VehicleDataResult clusterModeStatus) {
setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public VehicleDataResult getClusterModeStatus() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLUSTER_MODE_STATUS);
}
- public void setMyKey(VehicleDataResult myKey) {
+ public SubscribeVehicleDataResponse setMyKey( VehicleDataResult myKey) {
setParameters(KEY_MY_KEY, myKey);
+ return this;
}
- @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
+ * Sets the fuelRange.
+ *
+ * @param fuelRange The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
+ * vehicle. See struct FuelRange for details.
+ * @since SmartDeviceLink 5.0.0
*/
- public void setFuelRange(VehicleDataResult fuelRange) {
+ public SubscribeVehicleDataResponse setFuelRange( VehicleDataResult fuelRange) {
setParameters(KEY_FUEL_RANGE, fuelRange);
+ return this;
}
/**
- * Gets Fuel Range
- * @return a VehicleDataResult related to the fuel range
+ * Gets the fuelRange.
+ *
+ * @return VehicleDataResult The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
+ * vehicle. See struct FuelRange for details.
+ * @since SmartDeviceLink 5.0.0
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getFuelRange() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_RANGE);
}
@@ -463,15 +486,15 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets turnSignal
* @param turnSignal a VehicleDataResult related to the turn signal status
*/
- public void setTurnSignal(VehicleDataResult turnSignal) {
+ public SubscribeVehicleDataResponse setTurnSignal( VehicleDataResult turnSignal) {
setParameters(KEY_TURN_SIGNAL, turnSignal);
+ return this;
}
/**
* Gets turnSignal
* @return a VehicleDataResult related to the turn signal status
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getTurnSignal() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TURN_SIGNAL);
}
@@ -480,8 +503,9 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets electronicParkBrakeStatus
* @param electronicParkBrakeStatus a VehicleDataResult related to the electronic park brake status
*/
- public void setElectronicParkBrakeStatus(VehicleDataResult electronicParkBrakeStatus){
+ public SubscribeVehicleDataResponse setElectronicParkBrakeStatus( VehicleDataResult electronicParkBrakeStatus) {
setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ return this;
}
/**
@@ -496,8 +520,9 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* Sets cloudAppVehicleID
* @param cloudAppVehicleID a VehicleDataResult related to the cloud app vehicle ID
*/
- public void setCloudAppVehicleID(VehicleDataResult cloudAppVehicleID){
+ public SubscribeVehicleDataResponse setCloudAppVehicleID( VehicleDataResult cloudAppVehicleID) {
setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ return this;
}
/**
@@ -513,8 +538,9 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* @param vehicleDataName a String value
* @param vehicleDataState a VehicleDataResult value
*/
- public void setOEMCustomVehicleData(String vehicleDataName, VehicleDataResult vehicleDataState){
+ public SubscribeVehicleDataResponse setOEMCustomVehicleData( String vehicleDataName, VehicleDataResult vehicleDataState) {
setParameters(vehicleDataName, vehicleDataState);
+ return this;
}
/**
@@ -531,8 +557,9 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* @param handsOffSteering To indicate whether driver hands are off the steering wheel
* @since SmartDeviceLink 7.0.0
*/
- public void setHandsOffSteering(VehicleDataResult handsOffSteering) {
+ public SubscribeVehicleDataResponse setHandsOffSteering( VehicleDataResult handsOffSteering) {
setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
+ return this;
}
/**
@@ -550,8 +577,9 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* @param gearStatus See GearStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setGearStatus(VehicleDataResult gearStatus){
+ public SubscribeVehicleDataResponse setGearStatus( VehicleDataResult gearStatus) {
setParameters(KEY_GEAR_STATUS, gearStatus);
+ return this;
}
/**
@@ -560,7 +588,6 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* @return VehicleDataResult See GearStatus
* @since SmartDeviceLink 7.0.0
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getGearStatus(){
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GEAR_STATUS);
}
@@ -571,8 +598,9 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
* @param windowStatus See WindowStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setWindowStatus(VehicleDataResult windowStatus) {
+ public SubscribeVehicleDataResponse setWindowStatus( VehicleDataResult windowStatus) {
setParameters(KEY_WINDOW_STATUS, windowStatus);
+ return this;
}
/**
@@ -584,4 +612,25 @@ public class SubscribeVehicleDataResponse extends RPCResponse {
public VehicleDataResult getWindowStatus() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WINDOW_STATUS);
}
+
+ /**
+ * Gets the stabilityControlsStatus.
+ *
+ * @return VehicleDataResult See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public VehicleDataResult getStabilityControlsStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STABILITY_CONTROLS_STATUS);
+ }
+
+ /**
+ * Sets the stabilityControlsStatus.
+ *
+ * @param stabilityControlsStatus See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public SubscribeVehicleDataResponse setStabilityControlsStatus( VehicleDataResult stabilityControlsStatus) {
+ setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubtleAlert.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubtleAlert.java
index 42752ff8d..cc0908f58 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubtleAlert.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubtleAlert.java
@@ -79,7 +79,7 @@ import java.util.List;
* <tr>
* <td>ttsChunks</td>
* <td>List<TTSChunk></td>
- * <td>An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least oneitem.</td>
+ * <td>An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one item.</td>
* <td>N</td>
* <td>Min Value: 1; Max Value: 100</td>
* <td></td>
@@ -95,7 +95,7 @@ import java.util.List;
* <tr>
* <td>softButtons</td>
* <td>List<SoftButton></td>
- * <td>App defined SoftButtons. If omitted on supported displays, the displayed alert shall nothave any SoftButtons.</td>
+ * <td>App defined SoftButtons. If omitted on supported displays, the displayed alert shall not have any SoftButtons.</td>
* <td>N</td>
* <td>Min Value: 0; Max Value: 2</td>
* <td></td>
@@ -142,8 +142,9 @@ public class SubtleAlert extends RPCRequest {
*
* @param alertText1 The first line of the alert text field
*/
- public void setAlertText1(String alertText1) {
+ public SubtleAlert setAlertText1( String alertText1) {
setParameters(KEY_ALERT_TEXT_1, alertText1);
+ return this;
}
/**
@@ -160,8 +161,9 @@ public class SubtleAlert extends RPCRequest {
*
* @param alertText2 The second line of the alert text field
*/
- public void setAlertText2(String alertText2) {
+ public SubtleAlert setAlertText2( String alertText2) {
setParameters(KEY_ALERT_TEXT_2, alertText2);
+ return this;
}
/**
@@ -179,8 +181,9 @@ public class SubtleAlert extends RPCRequest {
* @param alertIcon Image to be displayed for the corresponding alert. See Image. If omitted on supported
* displays, no (or the default if applicable) icon should be displayed.
*/
- public void setAlertIcon(Image alertIcon) {
+ public SubtleAlert setAlertIcon( Image alertIcon) {
setParameters(KEY_ALERT_ICON, alertIcon);
+ return this;
}
/**
@@ -199,8 +202,9 @@ public class SubtleAlert extends RPCRequest {
* @param ttsChunks An array of text chunks of type TTSChunk. See TTSChunk. The array must have at least one
* item.
*/
- public void setTtsChunks(List<TTSChunk> ttsChunks) {
+ public SubtleAlert setTtsChunks( List<TTSChunk> ttsChunks) {
setParameters(KEY_TTS_CHUNKS, ttsChunks);
+ return this;
}
/**
@@ -220,8 +224,9 @@ public class SubtleAlert extends RPCRequest {
* @param duration Timeout in milliseconds. Typical timeouts are 3-5 seconds. If omitted, timeout is set to
* 5s.
*/
- public void setDuration(Integer duration) {
+ public SubtleAlert setDuration( Integer duration) {
setParameters(KEY_DURATION, duration);
+ return this;
}
/**
@@ -240,8 +245,9 @@ public class SubtleAlert extends RPCRequest {
* @param softButtons App defined SoftButtons. If omitted on supported displays, the displayed alert shall not
* have any SoftButtons.
*/
- public void setSoftButtons(List<SoftButton> softButtons) {
+ public SubtleAlert setSoftButtons( List<SoftButton> softButtons) {
setParameters(KEY_SOFT_BUTTONS, softButtons);
+ return this;
}
/**
@@ -260,8 +266,9 @@ public class SubtleAlert extends RPCRequest {
*
* @param cancelID An ID for this specific alert to allow cancellation through the `CancelInteraction` RPC.
*/
- public void setCancelID(Integer cancelID) {
+ public SubtleAlert setCancelID( Integer cancelID) {
setParameters(KEY_CANCEL_ID, cancelID);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubtleAlertResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubtleAlertResponse.java
index a15dbe13b..9e1e5b2c3 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SubtleAlertResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SubtleAlertResponse.java
@@ -80,8 +80,9 @@ public class SubtleAlertResponse extends RPCResponse {
* 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.
*/
- public void setTryAgainTime(Integer tryAgainTime) {
+ public SubtleAlertResponse setTryAgainTime( Integer tryAgainTime) {
setParameters(KEY_TRY_AGAIN_TIME, tryAgainTime);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
index 470321627..6ae6fa914 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemCapability.java
@@ -79,8 +79,9 @@ public class SystemCapability extends RPCStruct {
/**
* @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){
+ public SystemCapability setSystemCapabilityType(@NonNull SystemCapabilityType value) {
setValue(KEY_SYSTEM_CAPABILITY_TYPE, value);
+ return this;
}
public Object getCapabilityForType(SystemCapabilityType type) {
@@ -107,9 +108,9 @@ public class SystemCapability extends RPCStruct {
}
}
- public void setCapabilityForType(SystemCapabilityType type, Object capability) {
+ public SystemCapability setCapabilityForType( SystemCapabilityType type, Object capability) {
if (type == null) {
- return;
+ return this;
} else if (type.equals(SystemCapabilityType.NAVIGATION)) {
setValue(KEY_NAVIGATION_CAPABILITY, capability);
} else if (type.equals(SystemCapabilityType.PHONE_CALL)) {
@@ -127,8 +128,9 @@ public class SystemCapability extends RPCStruct {
} else if (type.equals(SystemCapabilityType.DRIVER_DISTRACTION)) {
setValue(KEY_DRIVER_DISTRACTION_CAPABILITY, capability);
} else {
- return;
+ return this;
}
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java
index 5c02cfe7d..839d49953 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SystemRequest.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -118,31 +118,35 @@ public class SystemRequest extends RPCRequest {
return (List<String>) getObject(String.class, KEY_DATA);
}
- public void setLegacyData( List<String> data ) {
+ public SystemRequest setLegacyData( List<String> data) {
setParameters(KEY_DATA, data);
- }
+ return this;
+ }
public String getFileName() {
return getString(KEY_FILE_NAME);
}
- public void setFileName(String fileName) {
+ public SystemRequest setFileName( String fileName) {
setParameters(KEY_FILE_NAME, fileName);
- }
+ return this;
+ }
public RequestType getRequestType() {
return (RequestType) getObject(RequestType.class, KEY_REQUEST_TYPE);
}
- public void setRequestType(@NonNull RequestType requestType) {
+ public SystemRequest setRequestType(@NonNull RequestType requestType) {
setParameters(KEY_REQUEST_TYPE, requestType);
+ return this;
}
public String getRequestSubType() {
return getString(KEY_REQUEST_SUB_TYPE);
}
- public void setRequestSubType(String requestSubType) {
+ public SystemRequest setRequestSubType( String requestSubType) {
setParameters(KEY_REQUEST_SUB_TYPE, requestSubType);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java
index fbd526b30..438757bd1 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TTSChunk.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -43,9 +43,9 @@ import java.util.Hashtable;
* 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.
+ * <p>In SDL, words, and therefore sentences, can be built up from phonemes and are used to explicitly provide the proper pronunciation 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>
+ * the developer would use phonemes to express this desired pronunciation.</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">
@@ -105,9 +105,10 @@ public class TTSChunk extends RPCStruct {
/**
* 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 ) {
+ */
+ public TTSChunk setText(@NonNull String text) {
setValue(KEY_TEXT, text);
+ return this;
}
/**
* Get the type of information in the "text" field (e.g. phrase to be spoken, phoneme specification, name of pre-recorded sound).
@@ -117,10 +118,11 @@ public class TTSChunk extends RPCStruct {
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).
+ * 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 ) {
+ */
+ public TTSChunk setType(@NonNull SpeechCapabilities type) {
setValue(KEY_TYPE, type);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java
index c2c809f13..9bd23d4a0 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Temperature.java
@@ -65,8 +65,9 @@ public class Temperature extends RPCStruct{
* @param unit
* Temperature Unit.
*/
- public void setUnit(@NonNull TemperatureUnit unit) {
+ public Temperature setUnit(@NonNull TemperatureUnit unit) {
setValue(KEY_UNIT, unit);
+ return this;
}
/**
@@ -94,7 +95,8 @@ public class Temperature extends RPCStruct{
* @param value
* Temperature Value in TemperatureUnit specified unit. Range depends on OEM and is not checked by SDL.
*/
- public void setValue(@NonNull Float value) {
+ public Temperature setValue(@NonNull Float value) {
setValue(KEY_VALUE, value);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java
index aa2e2b2f6..e65f25659 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateColorScheme.java
@@ -94,8 +94,9 @@ public class TemplateColorScheme extends RPCStruct {
* Sets the primaryColor of the scheme
* @param color an RGBColor object representing the primaryColor
*/
- public void setPrimaryColor(RGBColor color) {
+ public TemplateColorScheme setPrimaryColor( RGBColor color) {
setValue(KEY_PRIMARY_COLOR, color);
+ return this;
}
/**
@@ -110,8 +111,9 @@ public class TemplateColorScheme extends RPCStruct {
* Sets the secondaryColor of the scheme
* @param color an RGBColor object representing the secondaryColor
*/
- public void setSecondaryColor(RGBColor color) {
+ public TemplateColorScheme setSecondaryColor( RGBColor color) {
setValue(KEY_SECONDARY_COLOR, color);
+ return this;
}
/**
@@ -126,8 +128,9 @@ public class TemplateColorScheme extends RPCStruct {
* Sets the backgroundColor of the scheme
* @param color an RGBColor object representing the backgroundColor
*/
- public void setBackgroundColor(RGBColor color) {
+ public TemplateColorScheme setBackgroundColor( RGBColor color) {
setValue(KEY_BACKGROUND_COLOR, color);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateConfiguration.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateConfiguration.java
index c82b4c481..fdde09f13 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateConfiguration.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TemplateConfiguration.java
@@ -55,8 +55,9 @@ public class TemplateConfiguration extends RPCStruct {
*
* @param template Predefined or dynamically created window template. Currently only predefined window template layouts are defined.
*/
- public void setTemplate(@NonNull String template) {
+ public TemplateConfiguration setTemplate(@NonNull String template) {
setValue(KEY_TEMPLATE, template);
+ return this;
}
/**
@@ -64,7 +65,6 @@ public class TemplateConfiguration extends RPCStruct {
*
* @return TemplateColorScheme
*/
- @SuppressWarnings("unchecked")
public TemplateColorScheme getDayColorScheme() {
return (TemplateColorScheme) getObject(TemplateColorScheme.class, KEY_DAY_COLOR_SCHEME);
}
@@ -74,8 +74,9 @@ public class TemplateConfiguration extends RPCStruct {
*
* @param dayColorScheme TemplateColorScheme for the day
*/
- public void setDayColorScheme(TemplateColorScheme dayColorScheme) {
+ public TemplateConfiguration setDayColorScheme( TemplateColorScheme dayColorScheme) {
setValue(KEY_DAY_COLOR_SCHEME, dayColorScheme);
+ return this;
}
/**
@@ -83,7 +84,6 @@ public class TemplateConfiguration extends RPCStruct {
*
* @return TemplateColorScheme
*/
- @SuppressWarnings("unchecked")
public TemplateColorScheme getNightColorScheme() {
return (TemplateColorScheme) getObject(TemplateColorScheme.class, KEY_NIGHT_COLOR_SCHEME);
}
@@ -93,7 +93,8 @@ public class TemplateConfiguration extends RPCStruct {
*
* @param nightColorScheme TemplateColorScheme for the night
*/
- public void setNightColorScheme(TemplateColorScheme nightColorScheme) {
+ public TemplateConfiguration setNightColorScheme( TemplateColorScheme nightColorScheme) {
setValue(KEY_NIGHT_COLOR_SCHEME, nightColorScheme);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java
index dc9907bad..317138936 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TextField.java
@@ -135,11 +135,12 @@ public class TextField extends RPCStruct {
return (TextFieldName) getObject(TextFieldName.class, KEY_NAME);
}
/**
- * Set the enumeration identifying the field.
+ * Set the enumeration identifying the field.
* @param name the name of TextField
- */
- public void setName(@NonNull TextFieldName name ) {
+ */
+ public TextField setName(@NonNull TextFieldName name) {
setValue(KEY_NAME, name);
+ return this;
}
/**
* Get the character set that is supported in this field.
@@ -155,9 +156,10 @@ public class TextField extends RPCStruct {
* @param characterSet - The set of characters that are supported by this text field.
* All text is sent in UTF-8 format, but not all systems may support all of the characters expressed by UTF-8.
* All systems will support at least ASCII, but they may support more, either the LATIN-1 character set, or the full UTF-8 character set.
- */
- public void setCharacterSet(@NonNull CharacterSet characterSet ) {
+ */
+ public TextField setCharacterSet(@NonNull CharacterSet characterSet) {
setValue(KEY_CHARACTER_SET, characterSet);
+ return this;
}
/**
* Get the number of characters in one row of this field.
@@ -177,9 +179,10 @@ public class TextField extends RPCStruct {
* <li>maxvalue="500"</li>
* </ul>
* @param width the number of characters in one row of this field
- */
- public void setWidth(@NonNull Integer width ) {
+ */
+ public TextField setWidth(@NonNull Integer width) {
setValue(KEY_WIDTH, width);
+ return this;
}
/**
*Get the number of rows for this text field.
@@ -192,7 +195,8 @@ public class TextField extends RPCStruct {
public Integer getRows() {
return getInteger( KEY_ROWS );
}
- public void setRows(@NonNull Integer rows ) {
+ public TextField setRows(@NonNull Integer rows) {
setValue(KEY_ROWS, rows);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java
index c5e2626b8..e3cef24a8 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java
@@ -141,51 +141,52 @@ public class TireStatus extends RPCStruct {
setInnerRightRear(innerRightRear);
}
- public void setPressureTellTale(@NonNull WarningLightStatus pressureTellTale) {
- setValue(KEY_PRESSURE_TELL_TALE, pressureTellTale);
+ public TireStatus setPressureTellTale(@NonNull WarningLightStatus pressureTellTale) {
+ setValue(KEY_PRESSURE_TELL_TALE, pressureTellTale);
+ return this;
}
public WarningLightStatus getPressureTellTale() {
return (WarningLightStatus) getObject(WarningLightStatus.class, KEY_PRESSURE_TELL_TALE);
}
- public void setLeftFront(@NonNull SingleTireStatus leftFront) {
- setValue(KEY_LEFT_FRONT, leftFront);
+ public TireStatus setLeftFront(@NonNull SingleTireStatus leftFront) {
+ setValue(KEY_LEFT_FRONT, leftFront);
+ return this;
}
- @SuppressWarnings("unchecked")
public SingleTireStatus getLeftFront() {
return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_LEFT_FRONT);
}
- public void setRightFront(@NonNull SingleTireStatus rightFront) {
- setValue(KEY_RIGHT_FRONT, rightFront);
+ public TireStatus setRightFront(@NonNull SingleTireStatus rightFront) {
+ setValue(KEY_RIGHT_FRONT, rightFront);
+ return this;
}
- @SuppressWarnings("unchecked")
public SingleTireStatus getRightFront() {
return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_RIGHT_FRONT);
}
- public void setLeftRear(@NonNull SingleTireStatus leftRear) {
- setValue(KEY_LEFT_REAR, leftRear);
+ public TireStatus setLeftRear(@NonNull SingleTireStatus leftRear) {
+ setValue(KEY_LEFT_REAR, leftRear);
+ return this;
}
- @SuppressWarnings("unchecked")
public SingleTireStatus getLeftRear() {
return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_LEFT_REAR);
}
- public void setRightRear(@NonNull SingleTireStatus rightRear) {
- setValue(KEY_RIGHT_REAR, rightRear);
+ public TireStatus setRightRear(@NonNull SingleTireStatus rightRear) {
+ setValue(KEY_RIGHT_REAR, rightRear);
+ return this;
}
- @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);
+ public TireStatus setInnerLeftRear(@NonNull SingleTireStatus innerLeftRear) {
+ setValue(KEY_INNER_LEFT_REAR, innerLeftRear);
+ return this;
}
- @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);
+ public TireStatus setInnerRightRear(@NonNull SingleTireStatus innerRightRear) {
+ setValue(KEY_INNER_RIGHT_REAR, innerRightRear);
+ return this;
}
- @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
index 3e33369cf..c2f71e09e 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchCoord.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -101,16 +101,18 @@ public class TouchCoord extends RPCStruct {
setY(y);
}
- public void setX(@NonNull Integer x) {
+ public TouchCoord setX(@NonNull Integer x) {
setValue(KEY_X, x);
+ return this;
}
public Integer getX() {
return getInteger(KEY_X);
}
- public void setY(@NonNull Integer y) {
+ public TouchCoord setY(@NonNull Integer y) {
setValue(KEY_Y, y);
+ return this;
}
public Integer getY() {
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java
index 47f29c0b1..86171a5da 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEvent.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -116,8 +116,9 @@ public class TouchEvent extends RPCStruct {
setTouchCoordinates(c);
}
- public void setId(@NonNull Integer id) {
+ public TouchEvent setId(@NonNull Integer id) {
setValue(KEY_ID, id);
+ return this;
}
public Integer getId() {
@@ -143,11 +144,11 @@ public class TouchEvent extends RPCStruct {
if(obj instanceof Integer){ //Backwards case
int size = list.size();
List<Integer> listOfInt = (List<Integer>) list;
- List<Long> listofLongs = new ArrayList<Long>(size);
+ List<Long> listOfLongs = new ArrayList<>(size);
for(int i = 0; i<size;i++){
- listofLongs.add(listOfInt.get(i).longValue());
+ listOfLongs.add(listOfInt.get(i).longValue());
}
- return listofLongs;
+ return listOfLongs;
}else if(obj instanceof Long){
return (List<Long>) list;
}
@@ -156,18 +157,20 @@ public class TouchEvent extends RPCStruct {
return null;
}
- public void setTimestamps(@NonNull List<Long> ts){
+ public TouchEvent setTimestamps(@NonNull List<Long> ts) {
setValue(KEY_TS, ts);
+ return this;
}
/**
- * Use setTimestamps.
+ * Use setTimestamps.
* @deprecated 4.0.2
* @param ts
*/
@Deprecated
- public void setTs(List<Long> ts) {
- setTimestamps(ts);
+ public TouchEvent setTs( List<Long> ts) {
+ setTimestamps(ts);
+ return this;
}
/**
@@ -190,11 +193,13 @@ public class TouchEvent extends RPCStruct {
* @return
*/
@Deprecated
- public void setC( List<TouchCoord> c ) {
- setTouchCoordinates(c);
+ public TouchEvent setC( List<TouchCoord> c) {
+ setTouchCoordinates(c);
+ return this;
}
- public void setTouchCoordinates(@NonNull List<TouchCoord> c ) {
+ public TouchEvent setTouchCoordinates(@NonNull List<TouchCoord> c) {
setValue(KEY_C, c);
- }
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java
index 423ae4fa2..cb455bf59 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TouchEventCapabilities.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -99,24 +99,27 @@ public class TouchEventCapabilities extends RPCStruct {
setDoublePressAvailable(doublePressAvailable);
}
- public void setPressAvailable(@NonNull Boolean pressAvailable) {
+ public TouchEventCapabilities setPressAvailable(@NonNull Boolean pressAvailable) {
setValue(KEY_PRESS_AVAILABLE, pressAvailable);
+ return this;
}
public Boolean getPressAvailable() {
return getBoolean(KEY_PRESS_AVAILABLE);
}
- public void setMultiTouchAvailable(@NonNull Boolean multiTouchAvailable) {
+ public TouchEventCapabilities setMultiTouchAvailable(@NonNull Boolean multiTouchAvailable) {
setValue(KEY_MULTI_TOUCH_AVAILABLE, multiTouchAvailable);
+ return this;
}
public Boolean getMultiTouchAvailable() {
return getBoolean(KEY_MULTI_TOUCH_AVAILABLE);
}
- public void setDoublePressAvailable(@NonNull Boolean doublePressAvailable) {
+ public TouchEventCapabilities setDoublePressAvailable(@NonNull Boolean doublePressAvailable) {
setValue(KEY_DOUBLE_PRESS_AVAILABLE, doublePressAvailable);
+ return this;
}
public Boolean getDoublePressAvailable() {
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java
index 0498023ea..bdfb7d4b4 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/Turn.java
@@ -49,7 +49,7 @@ import java.util.Hashtable;
* <tr>
* <td>navigationText</td>
* <td>String</td>
- * <td>Text to describe the turn (e.g. streetname)
+ * <td>Text to describe the turn (e.g. street name)
* <ul>
* <li>Maxlength = 500</li>
* </ul>
@@ -76,19 +76,20 @@ public class Turn extends RPCStruct{
}
/**
- * set the text to describe the turn (e.g. streetname)
- *
+ * set the text to describe the turn (e.g. street name)
+ *
* @param navigationText
- * the text to describe the turn (e.g. streetname)
+ * the text to describe the turn (e.g. street name)
*/
- public void setNavigationText(String navigationText){
+ public Turn setNavigationText( String navigationText) {
setValue(KEY_NAVIGATION_TEXT, navigationText);
+ return this;
}
/**
- * get the text to describe the turn (e.g. streetname)
+ * get the text to describe the turn (e.g. street name)
*
- * @return the text to describe the turn (e.g. streetname)
+ * @return the text to describe the turn (e.g. street name)
*/
public String getNavigationText(){
return getString(KEY_NAVIGATION_TEXT);
@@ -96,12 +97,13 @@ public class Turn extends RPCStruct{
/**
* set Image to be shown for a turn
- *
+ *
* @param turnIcon
* the image to be shown for a turn
*/
- public void setTurnIcon(Image turnIcon){
+ public Turn setTurnIcon( Image turnIcon) {
setValue(KEY_TURN_IMAGE, turnIcon);
+ return this;
}
/**
@@ -109,7 +111,6 @@ public class Turn extends RPCStruct{
*
* @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/UnpublishAppService.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppService.java
index 6e509fe1f..60a59f77b 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppService.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnpublishAppService.java
@@ -80,9 +80,10 @@ public class UnpublishAppService extends RPCRequest {
* The ID of the service to be unpublished.
* @param serviceID - set the service ID for the service to be unpublished
*/
- public void setServiceID(String serviceID){
- setParameters(KEY_SERVICE_ID, serviceID);
- }
+ public UnpublishAppService setServiceID( String serviceID) {
+ setParameters(KEY_SERVICE_ID, serviceID);
+ return this;
+ }
/**
* The ID of the service to be unpublished.
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java
index 48c287ea8..87dcc9cfb 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeButton.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -121,10 +121,11 @@ public class UnsubscribeButton extends RPCRequest {
}
/**
* Sets the name of the button to unsubscribe from
- *
- * @param buttonName an enum value, see <i> {@linkplain com.smartdevicelink.proxy.rpc.enums.ButtonName}</i>
+ *
+ * @param buttonName an enum value, see <i> {@linkplain ButtonName}</i>
*/
- public void setButtonName(@NonNull ButtonName buttonName ) {
- setParameters(KEY_BUTTON_NAME, buttonName);
+ public UnsubscribeButton setButtonName(@NonNull ButtonName buttonName) {
+ setParameters(KEY_BUTTON_NAME, buttonName);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java
index 5a998a268..751f9621f 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleData.java
@@ -79,23 +79,31 @@ import java.util.Hashtable;
* <tr>
* <td>fuelLevel</td>
* <td>Boolean</td>
- * <td>The fuel level in the tank (percentage)</td>
+ * <td>The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec7.0, please see fuelRange.</td>
* <td>N</td>
* <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
+ * <td>SmartDeviceLink 7.0.0</td>
* </tr>
* <tr>
* <td>fuelLevel_State</td>
* <td>Boolean</td>
- * <td>The fuel level state</td>
+ * <td>The fuel level state. This parameter is deprecated starting RPC Spec 7.0, please see fuelRange.</td>
* <td>N</td>
* <td>Subscribable</td>
- * <td>SmartDeviceLink 2.0 </td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
+ * <tr>
+ * <td>fuelRange</td>
+ * <td>Boolean</td>
+ * <td>The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the vehicle. See struct FuelRange for details.</td>
+ * <td>N</td>
+ * <td>Subscribable</td>
+ * <td>SmartDeviceLink 5.0.0</td>
* </tr>
* <tr>
* <td>instantFuelConsumption</td>
* <td>Boolean</td>
- * <td>The instantaneous fuel consumption in microlitres</td>
+ * <td>The instantaneous fuel consumption in micro litres</td>
* <td>N</td>
* <td>Subscribable</td>
* <td>SmartDeviceLink 2.0 </td>
@@ -280,6 +288,15 @@ import java.util.Hashtable;
* <td>N</td>
* <td>SmartDeviceLink 7.0.0</td>
* </tr>
+ * <tr>
+ * <td>stabilityControlsStatus</td>
+ * <td>Boolean</td>
+ * <td>See StabilityControlsStatus</td>
+ * <td>N</td>
+ * <td>SmartDeviceLink 7.0.0</td>
+ * </tr>
+ *
+
* </table>
* <p><b> Response</b></p>
* <p><b>Non-default Result Codes:</b></p>
@@ -301,14 +318,12 @@ 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";
@@ -330,6 +345,17 @@ public class UnsubscribeVehicleData extends RPCRequest {
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
public static final String KEY_GEAR_STATUS = "gearStatus";
public static final String KEY_WINDOW_STATUS = "windowStatus";
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
/**
* Constructs a new UnsubscribeVehicleData object
@@ -352,12 +378,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* Sets a boolean value. If true, unsubscribes from Gps data
- *
+ *
* @param gps
* a boolean value
*/
- public void setGps(Boolean gps) {
- setParameters(KEY_GPS, gps);
+ public UnsubscribeVehicleData setGps( Boolean gps) {
+ setParameters(KEY_GPS, gps);
+ return this;
}
/**
@@ -372,12 +399,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* Sets a boolean value. If true, unsubscribes from speed data
- *
+ *
* @param speed
* a boolean value
*/
- public void setSpeed(Boolean speed) {
- setParameters(KEY_SPEED, speed);
+ public UnsubscribeVehicleData setSpeed( Boolean speed) {
+ setParameters(KEY_SPEED, speed);
+ return this;
}
/**
@@ -392,12 +420,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* Sets a boolean value. If true, unsubscribe data
- *
+ *
* @param rpm
* a boolean value
*/
- public void setRpm(Boolean rpm) {
- setParameters(KEY_RPM, rpm);
+ public UnsubscribeVehicleData setRpm( Boolean rpm) {
+ setParameters(KEY_RPM, rpm);
+ return this;
}
/**
@@ -411,55 +440,62 @@ public class UnsubscribeVehicleData extends RPCRequest {
}
/**
- * Sets a boolean value. If true, unsubscribes from FuelLevel data
- *
- * @param fuelLevel
- * a boolean value
+ * Sets the fuelLevel.
+ *
+ * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
*/
- public void setFuelLevel(Boolean fuelLevel) {
- setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ @Deprecated
+ public UnsubscribeVehicleData setFuelLevel( Boolean fuelLevel) {
+ setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ return this;
}
/**
- * Gets a boolean value. If true, means the FuelLevel data has been
- * unsubscribed.
+ * Gets the fuelLevel.
*
- * @return Boolean -a Boolean value. If true, means the FuelLevel data has
- * been unsubscribed.
+ * @return Boolean The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
*/
+ @Deprecated
public Boolean getFuelLevel() {
return getBoolean(KEY_FUEL_LEVEL);
}
- /**
- * 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);
+ /**
+ * Sets the fuelRange.
+ *
+ * @param fuelLevelState The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
+ * vehicle. See struct FuelRange for details.
+ * @since SmartDeviceLink 5.0.0
+ */
+ @Deprecated
+ public UnsubscribeVehicleData setFuelLevelState( Boolean fuelLevelState) {
+ setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ return this;
}
- /**
- * 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.
- */
+ /**
+ * Gets the fuelRange.
+ *
+ * @return Boolean The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
+ * vehicle. See struct FuelRange for details.
+ * @since SmartDeviceLink 5.0.0
+ */
+ @Deprecated
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);
+ public UnsubscribeVehicleData setInstantFuelConsumption( Boolean instantFuelConsumption) {
+ setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ return this;
}
/**
@@ -475,12 +511,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public UnsubscribeVehicleData setExternalTemperature( Boolean externalTemperature) {
+ setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ return this;
}
/**
@@ -501,8 +538,9 @@ public class UnsubscribeVehicleData extends RPCRequest {
* @deprecated in SmartDeviceLink 7.0.0
*/
@Deprecated
- public void setPrndl(Boolean prndl) {
+ public UnsubscribeVehicleData setPrndl( Boolean prndl) {
setParameters(KEY_PRNDL, prndl);
+ return this;
}
/**
@@ -518,12 +556,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public UnsubscribeVehicleData setTirePressure( Boolean tirePressure) {
+ setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ return this;
}
/**
@@ -539,12 +578,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* Sets a boolean value. If true, unsubscribes from odometer data
- *
+ *
* @param odometer
* a boolean value
*/
- public void setOdometer(Boolean odometer) {
- setParameters(KEY_ODOMETER, odometer);
+ public UnsubscribeVehicleData setOdometer( Boolean odometer) {
+ setParameters(KEY_ODOMETER, odometer);
+ return this;
}
/**
@@ -560,12 +600,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public UnsubscribeVehicleData setBeltStatus( Boolean beltStatus) {
+ setParameters(KEY_BELT_STATUS, beltStatus);
+ return this;
}
/**
@@ -581,12 +622,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public UnsubscribeVehicleData setBodyInformation( Boolean bodyInformation) {
+ setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ return this;
}
/**
@@ -602,12 +644,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public UnsubscribeVehicleData setDeviceStatus( Boolean deviceStatus) {
+ setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ return this;
}
/**
@@ -623,12 +666,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public UnsubscribeVehicleData setDriverBraking( Boolean driverBraking) {
+ setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ return this;
}
/**
@@ -644,12 +688,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public UnsubscribeVehicleData setWiperStatus( Boolean wiperStatus) {
+ setParameters(KEY_WIPER_STATUS, wiperStatus);
+ return this;
}
/**
@@ -665,12 +710,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public UnsubscribeVehicleData setHeadLampStatus( Boolean headLampStatus) {
+ setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ return this;
}
/**
@@ -690,9 +736,10 @@ public class UnsubscribeVehicleData extends RPCRequest {
* @param engineTorque
* a boolean value
*/
- public void setEngineTorque(Boolean engineTorque) {
- setParameters(KEY_ENGINE_TORQUE, engineTorque);
- }
+ public UnsubscribeVehicleData setEngineTorque( Boolean engineTorque) {
+ setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ return this;
+ }
/**
* Gets a boolean value. If true, means the Engine Torque data has been
@@ -711,9 +758,10 @@ public class UnsubscribeVehicleData extends RPCRequest {
* @param engineOilLife
* a boolean value
*/
- public void setEngineOilLife(Boolean engineOilLife) {
- setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
- }
+ public UnsubscribeVehicleData setEngineOilLife( Boolean engineOilLife) {
+ setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ return this;
+ }
/**
* Gets a boolean value. If true, means the Engine Oil Life data has been
@@ -729,12 +777,13 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* 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);
+ public UnsubscribeVehicleData setAccPedalPosition( Boolean accPedalPosition) {
+ setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ return this;
}
/**
@@ -748,40 +797,46 @@ public class UnsubscribeVehicleData extends RPCRequest {
return getBoolean(KEY_ACC_PEDAL_POSITION);
}
- public void setSteeringWheelAngle(Boolean steeringWheelAngle) {
- setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ public UnsubscribeVehicleData setSteeringWheelAngle( Boolean steeringWheelAngle) {
+ setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ return this;
}
public Boolean getSteeringWheelAngle() {
return getBoolean(KEY_STEERING_WHEEL_ANGLE);
}
- public void setECallInfo(Boolean eCallInfo) {
- setParameters(KEY_E_CALL_INFO, eCallInfo);
+ public UnsubscribeVehicleData setECallInfo( Boolean eCallInfo) {
+ setParameters(KEY_E_CALL_INFO, eCallInfo);
+ return this;
}
public Boolean getECallInfo() {
return getBoolean(KEY_E_CALL_INFO);
}
- public void setAirbagStatus(Boolean airbagStatus) {
- setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ public UnsubscribeVehicleData setAirbagStatus( Boolean airbagStatus) {
+ setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ return this;
}
public Boolean getAirbagStatus() {
return getBoolean(KEY_AIRBAG_STATUS);
}
- public void setEmergencyEvent(Boolean emergencyEvent) {
- setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ public UnsubscribeVehicleData setEmergencyEvent( Boolean emergencyEvent) {
+ setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ return this;
}
public Boolean getEmergencyEvent() {
return getBoolean(KEY_EMERGENCY_EVENT);
}
- public void setClusterModeStatus(Boolean clusterModeStatus) {
- setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ public UnsubscribeVehicleData setClusterModeStatus( Boolean clusterModeStatus) {
+ setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ return this;
}
public Boolean getClusterModeStatus() {
return getBoolean(KEY_CLUSTER_MODE_STATUS);
}
- public void setMyKey(Boolean myKey) {
- setParameters(KEY_MY_KEY, myKey);
+ public UnsubscribeVehicleData setMyKey( Boolean myKey) {
+ setParameters(KEY_MY_KEY, myKey);
+ return this;
}
public Boolean getMyKey() {
return getBoolean(KEY_MY_KEY);
@@ -793,9 +848,10 @@ public class UnsubscribeVehicleData extends RPCRequest {
* @param fuelRange
* a boolean value
*/
- public void setFuelRange(Boolean fuelRange) {
- setParameters(KEY_FUEL_RANGE, fuelRange);
- }
+ public UnsubscribeVehicleData setFuelRange( Boolean fuelRange) {
+ setParameters(KEY_FUEL_RANGE, fuelRange);
+ return this;
+ }
/**
* Gets a boolean value. If true, means the fuelRange data has been
@@ -812,7 +868,10 @@ public class UnsubscribeVehicleData extends RPCRequest {
* 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); }
+ public UnsubscribeVehicleData setTurnSignal( Boolean turnSignal) {
+ setParameters(KEY_TURN_SIGNAL, turnSignal);
+ return this;
+ }
/**
* Gets a boolean value. If true, means the turnSignal data has been unsubscribed.
@@ -824,9 +883,10 @@ public class UnsubscribeVehicleData extends RPCRequest {
* 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);
- }
+ public UnsubscribeVehicleData setElectronicParkBrakeStatus( Boolean electronicParkBrakeStatus) {
+ setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ return this;
+ }
/**
* Gets a boolean value. If true, means the electronicParkBrakeStatus data has been subscribed.
@@ -838,11 +898,12 @@ public class UnsubscribeVehicleData extends RPCRequest {
/**
* Sets a boolean value. If true, unsubscribes from cloudAppVehicleID data
- * @param cloudAppVehicleID a boolean value.
+ * @param cloudAppVehicleID a boolean value.
*/
- public void setCloudAppVehicleID(boolean cloudAppVehicleID){
- setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
- }
+ public UnsubscribeVehicleData setCloudAppVehicleID( boolean cloudAppVehicleID) {
+ setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ return this;
+ }
/**
* Gets a boolean value. If true, means the cloudAppVehicleID data has been unsubscribed.
@@ -857,9 +918,10 @@ public class UnsubscribeVehicleData extends RPCRequest {
* @param vehicleDataName a String value
* @param vehicleDataState a boolean value
*/
- public void setOEMCustomVehicleData(String vehicleDataName, Boolean vehicleDataState){
- setParameters(vehicleDataName, vehicleDataState);
- }
+ public UnsubscribeVehicleData setOEMCustomVehicleData( String vehicleDataName, Boolean vehicleDataState) {
+ setParameters(vehicleDataName, vehicleDataState);
+ return this;
+ }
/**
* Gets a boolean value for OEM Custom VehicleData.
@@ -875,8 +937,9 @@ public class UnsubscribeVehicleData extends RPCRequest {
* @param gearStatus See GearStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setGearStatus(Boolean gearStatus) {
+ public UnsubscribeVehicleData setGearStatus( Boolean gearStatus) {
setParameters(KEY_GEAR_STATUS, gearStatus);
+ return this;
}
/**
@@ -895,8 +958,9 @@ public class UnsubscribeVehicleData extends RPCRequest {
* @param handsOffSteering To indicate whether driver hands are off the steering wheel
* @since SmartDeviceLink 7.0.0
*/
- public void setHandsOffSteering(Boolean handsOffSteering) {
+ public UnsubscribeVehicleData setHandsOffSteering( Boolean handsOffSteering) {
setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
+ return this;
}
/**
@@ -915,8 +979,9 @@ public class UnsubscribeVehicleData extends RPCRequest {
* @param windowStatus See WindowStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setWindowStatus(Boolean windowStatus) {
+ public UnsubscribeVehicleData setWindowStatus( Boolean windowStatus) {
setParameters(KEY_WINDOW_STATUS, windowStatus);
+ return this;
}
/**
@@ -928,4 +993,25 @@ public class UnsubscribeVehicleData extends RPCRequest {
public Boolean getWindowStatus() {
return getBoolean(KEY_WINDOW_STATUS);
}
+
+ /**
+ * Sets the stabilityControlsStatus.
+ *
+ * @param stabilityControlsStatus See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public UnsubscribeVehicleData setStabilityControlsStatus( Boolean stabilityControlsStatus) {
+ setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
+ return this;
+ }
+
+ /**
+ * Gets the stabilityControlsStatus.
+ *
+ * @return Boolean See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public Boolean getStabilityControlsStatus() {
+ return getBoolean(KEY_STABILITY_CONTROLS_STATUS);
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java
index 37b1f0c51..3e4609f2b 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java
@@ -47,7 +47,6 @@ import java.util.Hashtable;
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";
@@ -55,7 +54,6 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
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";
@@ -77,6 +75,17 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
public static final String KEY_HANDS_OFF_STEERING = "handsOffSteering";
public static final String KEY_WINDOW_STATUS = "windowStatus";
public static final String KEY_GEAR_STATUS = "gearStatus";
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL = "fuelLevel";
+ /**
+ * @deprecated
+ */
+ @Deprecated
+ public static final String KEY_FUEL_LEVEL_STATE = "fuelLevel_State";
+ public static final String KEY_STABILITY_CONTROLS_STATUS = "stabilityControlsStatus";
/**
* Constructs a new UnsubscribeVehicleDataResponse object
@@ -111,14 +120,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Gps
* @param gps a VehicleDataResult related to GPS
*/
- public void setGps(VehicleDataResult gps) {
+ public UnsubscribeVehicleDataResponse setGps( VehicleDataResult gps) {
setParameters(KEY_GPS, gps);
+ return this;
}
/**
* Gets Gps
* @return a VehicleDataResult related to GPS
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getGps() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GPS);
}
@@ -126,14 +135,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Speed
* @param speed a VehicleDataResult related to speed
*/
- public void setSpeed(VehicleDataResult speed) {
+ public UnsubscribeVehicleDataResponse setSpeed( VehicleDataResult speed) {
setParameters(KEY_SPEED, speed);
+ return this;
}
/**
* Gets Speed
* @return a VehicleDataResult related to speed
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getSpeed() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_SPEED);
}
@@ -141,29 +150,35 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets rpm
* @param rpm a VehicleDataResult related to RPM
*/
- public void setRpm(VehicleDataResult rpm) {
+ public UnsubscribeVehicleDataResponse setRpm( VehicleDataResult rpm) {
setParameters(KEY_RPM, rpm);
+ return this;
}
/**
* 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
+ * Sets the fuelLevel.
+ *
+ * @param fuelLevel The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
*/
- public void setFuelLevel(VehicleDataResult fuelLevel) {
+ @Deprecated
+ public UnsubscribeVehicleDataResponse setFuelLevel( VehicleDataResult fuelLevel) {
setParameters(KEY_FUEL_LEVEL, fuelLevel);
+ return this;
}
/**
- * Gets Fuel Level
- * @return a VehicleDataResult related to FuelLevel
+ * Gets the fuelLevel.
+ *
+ * @return VehicleDataResult The fuel level in the tank (percentage). This parameter is deprecated starting RPC Spec
+ * 7.0, please see fuelRange.
*/
- @SuppressWarnings("unchecked")
+ @Deprecated
public VehicleDataResult getFuelLevel() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL);
}
@@ -171,14 +186,16 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Fuel Level State
* @param fuelLevelState a VehicleDataResult related to FuelLevel State
*/
- public void setFuelLevelState(VehicleDataResult fuelLevelState) {
+ @Deprecated
+ public UnsubscribeVehicleDataResponse setFuelLevelState( VehicleDataResult fuelLevelState) {
setParameters(KEY_FUEL_LEVEL_STATE, fuelLevelState);
+ return this;
}
/**
* Gets Fuel Level State
* @return a VehicleDataResult related to FuelLevel State
*/
- @SuppressWarnings("unchecked")
+ @Deprecated
public VehicleDataResult getFuelLevelState() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_LEVEL_STATE);
}
@@ -186,14 +203,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Instant Fuel Consumption
* @param instantFuelConsumption a VehicleDataResult related to instant fuel consumption
*/
- public void setInstantFuelConsumption(VehicleDataResult instantFuelConsumption) {
+ public UnsubscribeVehicleDataResponse setInstantFuelConsumption( VehicleDataResult instantFuelConsumption) {
setParameters(KEY_INSTANT_FUEL_CONSUMPTION, instantFuelConsumption);
+ return this;
}
/**
* 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);
}
@@ -201,14 +218,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets External Temperature
* @param externalTemperature a VehicleDataResult related to external temperature
*/
- public void setExternalTemperature(VehicleDataResult externalTemperature) {
+ public UnsubscribeVehicleDataResponse setExternalTemperature( VehicleDataResult externalTemperature) {
setParameters(KEY_EXTERNAL_TEMPERATURE, externalTemperature);
+ return this;
}
/**
* Gets External Temperature
* @return a VehicleDataResult related to external temperature
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getExternalTemperature() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EXTERNAL_TEMPERATURE);
}
@@ -219,8 +236,9 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* @deprecated in SmartDeviceLink 7.0.0
*/
@Deprecated
- public void setPrndl(VehicleDataResult prndl) {
+ public UnsubscribeVehicleDataResponse setPrndl( VehicleDataResult prndl) {
setParameters(KEY_PRNDL, prndl);
+ return this;
}
/**
* Gets the prndl.
@@ -229,7 +247,6 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* @deprecated in SmartDeviceLink 7.0.0
*/
@Deprecated
- @SuppressWarnings("unchecked")
public VehicleDataResult getPrndl() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_PRNDL);
}
@@ -237,14 +254,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Tire Pressure
* @param tirePressure a VehicleDataResult related to tire pressure
*/
- public void setTirePressure(VehicleDataResult tirePressure) {
+ public UnsubscribeVehicleDataResponse setTirePressure( VehicleDataResult tirePressure) {
setParameters(KEY_TIRE_PRESSURE, tirePressure);
+ return this;
}
/**
* Gets Tire Pressure
* @return a VehicleDataResult related to tire pressure
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getTirePressure() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TIRE_PRESSURE);
}
@@ -252,14 +269,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Odometer
* @param odometer a VehicleDataResult related to the odometer
*/
- public void setOdometer(VehicleDataResult odometer) {
+ public UnsubscribeVehicleDataResponse setOdometer( VehicleDataResult odometer) {
setParameters(KEY_ODOMETER, odometer);
+ return this;
}
/**
* Gets Odometer
* @return a VehicleDataResult related to the odometer
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getOdometer() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ODOMETER);
}
@@ -267,14 +284,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Belt Status
* @param beltStatus a VehicleDataResult related to the seat belt status
*/
- public void setBeltStatus(VehicleDataResult beltStatus) {
+ public UnsubscribeVehicleDataResponse setBeltStatus( VehicleDataResult beltStatus) {
setParameters(KEY_BELT_STATUS, beltStatus);
+ return this;
}
/**
* 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);
}
@@ -282,14 +299,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Body Information
* @param bodyInformation a VehicleDataResult related to the body info
*/
- public void setBodyInformation(VehicleDataResult bodyInformation) {
+ public UnsubscribeVehicleDataResponse setBodyInformation( VehicleDataResult bodyInformation) {
setParameters(KEY_BODY_INFORMATION, bodyInformation);
+ return this;
}
/**
* Gets Body Information
* @return a VehicleDataResult related to the body info
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getBodyInformation() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_BODY_INFORMATION);
}
@@ -297,14 +314,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Device Status
* @param deviceStatus a VehicleDataResult related to the device status of the connected device
*/
- public void setDeviceStatus(VehicleDataResult deviceStatus) {
+ public UnsubscribeVehicleDataResponse setDeviceStatus( VehicleDataResult deviceStatus) {
setParameters(KEY_DEVICE_STATUS, deviceStatus);
+ return this;
}
/**
* 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);
}
@@ -312,14 +329,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Driver Braking
* @param driverBraking a VehicleDataResult related to the driver breaking status
*/
- public void setDriverBraking(VehicleDataResult driverBraking) {
+ public UnsubscribeVehicleDataResponse setDriverBraking( VehicleDataResult driverBraking) {
setParameters(KEY_DRIVER_BRAKING, driverBraking);
+ return this;
}
/**
* 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);
}
@@ -327,14 +344,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Wiper Status
* @param wiperStatus a VehicleDataResult related to the wiper status
*/
- public void setWiperStatus(VehicleDataResult wiperStatus) {
+ public UnsubscribeVehicleDataResponse setWiperStatus( VehicleDataResult wiperStatus) {
setParameters(KEY_WIPER_STATUS, wiperStatus);
+ return this;
}
/**
* Gets Wiper Status
* @return a VehicleDataResult related to the wiper status
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getWiperStatus() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_WIPER_STATUS);
}
@@ -342,14 +359,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Head Lamp Status
* @param headLampStatus a VehicleDataResult related to the headlamp status
*/
- public void setHeadLampStatus(VehicleDataResult headLampStatus) {
+ public UnsubscribeVehicleDataResponse setHeadLampStatus( VehicleDataResult headLampStatus) {
setParameters(KEY_HEAD_LAMP_STATUS, headLampStatus);
+ return this;
}
/**
* 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);
}
@@ -357,14 +374,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Engine Torque
* @param engineTorque a VehicleDataResult related to the engine's torque
*/
- public void setEngineTorque(VehicleDataResult engineTorque) {
+ public UnsubscribeVehicleDataResponse setEngineTorque( VehicleDataResult engineTorque) {
setParameters(KEY_ENGINE_TORQUE, engineTorque);
+ return this;
}
/**
* Gets Engine Torque
- * @return a VehicleDataResult related to the enginer's torque
+ * @return a VehicleDataResult related to the engine's torque
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getEngineTorque() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_ENGINE_TORQUE);
}
@@ -372,14 +389,14 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets Engine Oil Life
* @param engineOilLife a VehicleDataResult related to the engine's oil life
*/
- public void setEngineOilLife(VehicleDataResult engineOilLife) {
+ public UnsubscribeVehicleDataResponse setEngineOilLife( VehicleDataResult engineOilLife) {
setParameters(KEY_ENGINE_OIL_LIFE, engineOilLife);
+ return this;
}
/**
* 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);
}
@@ -387,76 +404,82 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets AccPedal Position
* @param accPedalPosition a VehicleDataResult related to the accelerator pedal's position
*/
- public void setAccPedalPosition(VehicleDataResult accPedalPosition) {
+ public UnsubscribeVehicleDataResponse setAccPedalPosition( VehicleDataResult accPedalPosition) {
setParameters(KEY_ACC_PEDAL_POSITION, accPedalPosition);
+ return this;
}
/**
* 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) {
+ public UnsubscribeVehicleDataResponse setSteeringWheelAngle( VehicleDataResult steeringWheelAngle) {
setParameters(KEY_STEERING_WHEEL_ANGLE, steeringWheelAngle);
+ return this;
}
- @SuppressWarnings("unchecked")
public VehicleDataResult getSteeringWheelAngle() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STEERING_WHEEL_ANGLE);
}
- public void setECallInfo(VehicleDataResult eCallInfo) {
+ public UnsubscribeVehicleDataResponse setECallInfo( VehicleDataResult eCallInfo) {
setParameters(KEY_E_CALL_INFO, eCallInfo);
+ return this;
}
- @SuppressWarnings("unchecked")
public VehicleDataResult getECallInfo() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_E_CALL_INFO);
}
- public void setAirbagStatus(VehicleDataResult airbagStatus) {
+ public UnsubscribeVehicleDataResponse setAirbagStatus( VehicleDataResult airbagStatus) {
setParameters(KEY_AIRBAG_STATUS, airbagStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public VehicleDataResult getAirbagStatus() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_AIRBAG_STATUS);
}
- public void setEmergencyEvent(VehicleDataResult emergencyEvent) {
+ public UnsubscribeVehicleDataResponse setEmergencyEvent( VehicleDataResult emergencyEvent) {
setParameters(KEY_EMERGENCY_EVENT, emergencyEvent);
+ return this;
}
- @SuppressWarnings("unchecked")
public VehicleDataResult getEmergencyEvent() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_EMERGENCY_EVENT);
}
- public void setClusterModeStatus(VehicleDataResult clusterModeStatus) {
+ public UnsubscribeVehicleDataResponse setClusterModeStatus( VehicleDataResult clusterModeStatus) {
setParameters(KEY_CLUSTER_MODE_STATUS, clusterModeStatus);
+ return this;
}
- @SuppressWarnings("unchecked")
public VehicleDataResult getClusterModeStatus() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_CLUSTER_MODE_STATUS);
}
- public void setMyKey(VehicleDataResult myKey) {
+ public UnsubscribeVehicleDataResponse setMyKey( VehicleDataResult myKey) {
setParameters(KEY_MY_KEY, myKey);
+ return this;
}
- @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
+ * Sets the fuelRange.
+ *
+ * @param fuelRange The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
+ * vehicle. See struct FuelRange for details.
+ * @since SmartDeviceLink 5.0.0
*/
- public void setFuelRange(VehicleDataResult fuelRange) {
+ public UnsubscribeVehicleDataResponse setFuelRange( VehicleDataResult fuelRange) {
setParameters(KEY_FUEL_RANGE, fuelRange);
+ return this;
}
/**
- * Gets Fuel Range
- * @return a VehicleDataResult related to the fuel range
+ * Gets the fuelRange.
+ *
+ * @return VehicleDataResult The fuel type, estimated range in KM, fuel level/capacity and fuel level state for the
+ * vehicle. See struct FuelRange for details.
+ * @since SmartDeviceLink 5.0.0
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getFuelRange() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_FUEL_RANGE);
}
@@ -465,15 +488,15 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets turnSignal
* @param turnSignal a VehicleDataResult related to the turn signal status
*/
- public void setTurnSignal(VehicleDataResult turnSignal) {
+ public UnsubscribeVehicleDataResponse setTurnSignal( VehicleDataResult turnSignal) {
setParameters(KEY_TURN_SIGNAL, turnSignal);
+ return this;
}
/**
* Gets turnSignal
* @return a VehicleDataResult related to the turn signal status
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getTurnSignal() {
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_TURN_SIGNAL);
}
@@ -482,8 +505,9 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets electronicParkBrakeStatus
* @param electronicParkBrakeStatus a VehicleDataResult related to the electronic park brake status
*/
- public void setElectronicParkBrakeStatus(VehicleDataResult electronicParkBrakeStatus){
+ public UnsubscribeVehicleDataResponse setElectronicParkBrakeStatus( VehicleDataResult electronicParkBrakeStatus) {
setParameters(KEY_ELECTRONIC_PARK_BRAKE_STATUS, electronicParkBrakeStatus);
+ return this;
}
/**
@@ -498,8 +522,9 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* Sets cloudAppVehicleID
* @param cloudAppVehicleID a VehicleDataResult related to the cloud app vehicle ID
*/
- public void setCloudAppVehicleID(VehicleDataResult cloudAppVehicleID){
+ public UnsubscribeVehicleDataResponse setCloudAppVehicleID( VehicleDataResult cloudAppVehicleID) {
setParameters(KEY_CLOUD_APP_VEHICLE_ID, cloudAppVehicleID);
+ return this;
}
/**
@@ -515,8 +540,9 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* @param vehicleDataName a String value
* @param vehicleDataState a VehicleDataResult value
*/
- public void setOEMCustomVehicleData(String vehicleDataName, VehicleDataResult vehicleDataState){
+ public UnsubscribeVehicleDataResponse setOEMCustomVehicleData( String vehicleDataName, VehicleDataResult vehicleDataState) {
setParameters(vehicleDataName, vehicleDataState);
+ return this;
}
/**
@@ -533,8 +559,9 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* @param handsOffSteering To indicate whether driver hands are off the steering wheel
* @since SmartDeviceLink 7.0.0
*/
- public void setHandsOffSteering(VehicleDataResult handsOffSteering) {
+ public UnsubscribeVehicleDataResponse setHandsOffSteering( VehicleDataResult handsOffSteering) {
setParameters(KEY_HANDS_OFF_STEERING, handsOffSteering);
+ return this;
}
/**
@@ -553,8 +580,9 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* @param windowStatus See WindowStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setWindowStatus(VehicleDataResult windowStatus) {
+ public UnsubscribeVehicleDataResponse setWindowStatus( VehicleDataResult windowStatus) {
setParameters(KEY_WINDOW_STATUS, windowStatus);
+ return this;
}
/**
@@ -573,8 +601,9 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* @param gearStatus See GearStatus
* @since SmartDeviceLink 7.0.0
*/
- public void setGearStatus(VehicleDataResult gearStatus){
+ public UnsubscribeVehicleDataResponse setGearStatus( VehicleDataResult gearStatus) {
setParameters(KEY_GEAR_STATUS, gearStatus);
+ return this;
}
/**
@@ -583,8 +612,28 @@ public class UnsubscribeVehicleDataResponse extends RPCResponse {
* @return VehicleDataResult See GearStatus
* @since SmartDeviceLink 7.0.0
*/
- @SuppressWarnings("unchecked")
public VehicleDataResult getGearStatus(){
return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_GEAR_STATUS);
}
+
+ /**
+ * Gets the stabilityControlsStatus.
+ *
+ * @return VehicleDataResult See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public VehicleDataResult getStabilityControlsStatus() {
+ return (VehicleDataResult) getObject(VehicleDataResult.class, KEY_STABILITY_CONTROLS_STATUS);
+ }
+
+ /**
+ * Sets the stabilityControlsStatus.
+ *
+ * @param stabilityControlsStatus See StabilityControlsStatus
+ * @since SmartDeviceLink 7.0.0
+ */
+ public UnsubscribeVehicleDataResponse setStabilityControlsStatus( VehicleDataResult stabilityControlsStatus) {
+ setParameters(KEY_STABILITY_CONTROLS_STATUS, stabilityControlsStatus);
+ return this;
+ }
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java
index cafd04d88..8782b120c 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/UpdateTurnList.java
@@ -38,8 +38,8 @@ 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
+ * Updates the list of next maneuvers, which can be requested by the user pressing the soft button "Turns" on the
+ * Navigation base screen. Three soft buttons are predefined by the system: Up, Down, Close
*
* <p>Function Group: Navigation</p>
*
@@ -75,14 +75,15 @@ public class UpdateTurnList extends RPCRequest{
/**
* 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){
+ public UpdateTurnList setTurnList( List<Turn> turnList) {
setParameters(KEY_TURN_LIST, turnList);
+ return this;
}
/**
@@ -108,7 +109,7 @@ public class UpdateTurnList extends RPCRequest{
/**
* Sets the SoftButtons
- *
+ *
* @param softButtons
* a List<SoftButton> value
* <p>
@@ -121,8 +122,9 @@ public class UpdateTurnList extends RPCRequest{
* @since SmartDeviceLink 2.0
*/
- public void setSoftButtons(List<SoftButton> softButtons){
+ public UpdateTurnList setSoftButtons( List<SoftButton> softButtons) {
setParameters(KEY_SOFT_BUTTONS, softButtons);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java
index 5e50f18e9..cf22bc11c 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleDataResult.java
@@ -100,25 +100,28 @@ public class VehicleDataResult extends RPCStruct {
setResultCode(resultCode);
}
- public void setResultCode(@NonNull VehicleDataResultCode resultCode) {
- setValue(KEY_RESULT_CODE, resultCode);
- }
+ public VehicleDataResult setResultCode(@NonNull VehicleDataResultCode resultCode) {
+ setValue(KEY_RESULT_CODE, resultCode);
+ return this;
+ }
public VehicleDataResultCode getResultCode() {
return (VehicleDataResultCode) getObject(VehicleDataResultCode.class, KEY_RESULT_CODE);
}
- public void setDataType(@NonNull VehicleDataType dataType) {
- setValue(KEY_DATA_TYPE, dataType);
- }
+ public VehicleDataResult setDataType(@NonNull VehicleDataType dataType) {
+ setValue(KEY_DATA_TYPE, dataType);
+ return this;
+ }
public VehicleDataType getDataType() {
return (VehicleDataType) getObject(VehicleDataType.class, KEY_DATA_TYPE);
}
- public void setOEMCustomVehicleDataType(String oemCustomDataType) {
- setValue(KEY_OEM_CUSTOM_DATA_TYPE, oemCustomDataType);
- }
+ public VehicleDataResult setOEMCustomVehicleDataType( String oemCustomDataType) {
+ setValue(KEY_OEM_CUSTOM_DATA_TYPE, oemCustomDataType);
+ return this;
+ }
public String getOEMCustomVehicleDataType() {
return (String) getObject(String.class, KEY_OEM_CUSTOM_DATA_TYPE);
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java
index 5858ce39e..27b1ff42a 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VehicleType.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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;
@@ -119,8 +119,9 @@ public class VehicleType extends RPCStruct {
* set the make of the vehicle
*@param make the make of the vehicle
*/
- public void setMake(String make) {
+ public VehicleType setMake( String make) {
setValue(KEY_MAKE, make);
+ return this;
}
/**
@@ -135,8 +136,9 @@ public class VehicleType extends RPCStruct {
* set the model of the vehicle
* @param model the model of the vehicle
*/
- public void setModel(String model) {
+ public VehicleType setModel( String model) {
setValue(KEY_MODEL, model);
+ return this;
}
/**
@@ -151,8 +153,9 @@ public class VehicleType extends RPCStruct {
* set the model year of the vehicle
* @param modelYear the model year of the vehicle
*/
- public void setModelYear(String modelYear) {
+ public VehicleType setModelYear( String modelYear) {
setValue(KEY_MODEL_YEAR, modelYear);
+ return this;
}
/**
@@ -167,7 +170,8 @@ public class VehicleType extends RPCStruct {
* set the trim of the vehicle
* @param trim the trim of the vehicle
*/
- public void setTrim(String trim) {
+ public VehicleType setTrim( String trim) {
setValue(KEY_TRIM, trim);
+ return this;
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java
index 4c9574213..c5a22fd42 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingCapability.java
@@ -54,9 +54,10 @@ public class VideoStreamingCapability extends RPCStruct {
public VideoStreamingCapability(){}
public VideoStreamingCapability(Hashtable<String, Object> hash){super(hash);}
- public void setPreferredResolution(ImageResolution res){
- setValue(KEY_PREFERRED_RESOLUTION, res);
- }
+ public VideoStreamingCapability setPreferredResolution( ImageResolution res) {
+ setValue(KEY_PREFERRED_RESOLUTION, res);
+ return this;
+ }
public ImageResolution getPreferredResolution(){
return (ImageResolution) getObject(ImageResolution.class, KEY_PREFERRED_RESOLUTION);
@@ -68,9 +69,10 @@ public class VideoStreamingCapability extends RPCStruct {
* <b>NOTE: </b> Unit is in kbps.
* @param maxBitrate in kbps
*/
- public void setMaxBitrate(Integer maxBitrate){
- setValue(KEY_MAX_BITRATE, maxBitrate);
- }
+ public VideoStreamingCapability setMaxBitrate( Integer maxBitrate) {
+ setValue(KEY_MAX_BITRATE, maxBitrate);
+ return this;
+ }
/**
* Retrieves the max bitrate supported by this module.
@@ -82,9 +84,10 @@ public class VideoStreamingCapability extends RPCStruct {
return getInteger(KEY_MAX_BITRATE);
}
- public void setSupportedFormats(List<VideoStreamingFormat> formats){
- setValue(KEY_SUPPORTED_FORMATS, formats);
- }
+ public VideoStreamingCapability setSupportedFormats( List<VideoStreamingFormat> formats) {
+ setValue(KEY_SUPPORTED_FORMATS, formats);
+ return this;
+ }
public List<VideoStreamingFormat> getSupportedFormats(){
return (List<VideoStreamingFormat>) getObject(VideoStreamingFormat.class, KEY_SUPPORTED_FORMATS);
@@ -94,9 +97,10 @@ public class VideoStreamingCapability extends RPCStruct {
return getBoolean(KEY_HAPTIC_SPATIAL_DATA_SUPPORTED);
}
- public void setIsHapticSpatialDataSupported(Boolean hapticSpatialDataSupported) {
- setValue(KEY_HAPTIC_SPATIAL_DATA_SUPPORTED, hapticSpatialDataSupported);
- }
+ public VideoStreamingCapability setIsHapticSpatialDataSupported( Boolean hapticSpatialDataSupported) {
+ setValue(KEY_HAPTIC_SPATIAL_DATA_SUPPORTED, hapticSpatialDataSupported);
+ return this;
+ }
/**
* @return the diagonal screen size in inches.
@@ -109,9 +113,10 @@ public class VideoStreamingCapability extends RPCStruct {
/**
* @param diagonalScreenSize the diagonal screen size in inches.
*/
- public void setDiagonalScreenSize(Double diagonalScreenSize) {
- setValue(KEY_DIAGONAL_SCREEN_SIZE, diagonalScreenSize);
- }
+ public VideoStreamingCapability setDiagonalScreenSize( Double diagonalScreenSize) {
+ setValue(KEY_DIAGONAL_SCREEN_SIZE, diagonalScreenSize);
+ return this;
+ }
/**
* @return the diagonal resolution in pixels divided by the diagonal screen size in inches.
@@ -124,9 +129,10 @@ public class VideoStreamingCapability extends RPCStruct {
/**
* @param pixelPerInch the diagonal resolution in pixels divided by the diagonal screen size in inches.
*/
- public void setPixelPerInch(Double pixelPerInch) {
- setValue(KEY_PIXEL_PER_INCH, pixelPerInch);
- }
+ public VideoStreamingCapability setPixelPerInch( Double pixelPerInch) {
+ setValue(KEY_PIXEL_PER_INCH, pixelPerInch);
+ return this;
+ }
/**
* @return the scaling factor the app should use to change the size of the projecting view.
@@ -139,8 +145,9 @@ public class VideoStreamingCapability extends RPCStruct {
/**
* @param scale the scaling factor the app should use to change the size of the projecting view.
*/
- public void setScale(Double scale) {
+ public VideoStreamingCapability setScale( Double scale) {
setValue(KEY_SCALE, scale);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java
index 92c16cebc..ba3f6a9f9 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VideoStreamingFormat.java
@@ -61,17 +61,19 @@ public class VideoStreamingFormat extends RPCStruct {
setCodec(codec);
}
- public void setProtocol(@NonNull VideoStreamingProtocol protocol){
- setValue(KEY_PROTOCOL, protocol);
- }
+ public VideoStreamingFormat setProtocol(@NonNull VideoStreamingProtocol protocol) {
+ setValue(KEY_PROTOCOL, protocol);
+ return this;
+ }
public VideoStreamingProtocol getProtocol(){
return (VideoStreamingProtocol) getObject(VideoStreamingProtocol.class, KEY_PROTOCOL);
}
- public void setCodec(@NonNull VideoStreamingCodec codec){
- setValue(KEY_CODEC, codec);
- }
+ public VideoStreamingFormat setCodec(@NonNull VideoStreamingCodec codec) {
+ setValue(KEY_CODEC, codec);
+ return this;
+ }
public VideoStreamingCodec getCodec(){
return (VideoStreamingCodec) getObject(VideoStreamingCodec.class, KEY_CODEC);
@@ -88,7 +90,7 @@ public class VideoStreamingFormat extends RPCStruct {
@Override
public String toString() {
- return "codec=" + String.valueOf(getCodec()) +
- ", protocol=" + String.valueOf(getProtocol());
+ return "codec=" + getCodec() +
+ ", protocol=" + 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
index 0acb5b8dd..7b0c9b7ec 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/VrHelpItem.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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 androidx.annotation.NonNull;
@@ -107,21 +107,23 @@ public class VrHelpItem extends RPCStruct {
setPosition(position);
}
- public void setText(@NonNull String text) {
+ public VrHelpItem setText(@NonNull String text) {
setValue(KEY_TEXT, text);
+ return this;
}
public String getText() {
return getString(KEY_TEXT);
}
- public void setImage(Image image) {
+ public VrHelpItem setImage( Image image) {
setValue(KEY_IMAGE, image);
+ return this;
}
- @SuppressWarnings("unchecked")
public Image getImage() {
return (Image) getObject(Image.class, KEY_IMAGE);
}
- public void setPosition(@NonNull Integer position) {
+ public VrHelpItem setPosition(@NonNull Integer position) {
setValue(KEY_POSITION, position);
+ return this;
}
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
index 2d3afdfb4..23f183da5 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherAlert.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherAlert.java
@@ -66,9 +66,10 @@ public class WeatherAlert extends RPCStruct {
/**
* @param title -
*/
- public void setTitle(String title) {
- setValue(KEY_TITLE, title);
- }
+ public WeatherAlert setTitle( String title) {
+ setValue(KEY_TITLE, title);
+ return this;
+ }
/**
* @return title
@@ -80,9 +81,10 @@ public class WeatherAlert extends RPCStruct {
/**
* @param summary -
*/
- public void setSummary(String summary) {
- setValue(KEY_SUMMARY, summary);
- }
+ public WeatherAlert setSummary( String summary) {
+ setValue(KEY_SUMMARY, summary);
+ return this;
+ }
/**
* @return summary
@@ -94,9 +96,10 @@ public class WeatherAlert extends RPCStruct {
/**
* @param severity -
*/
- public void setSeverity(String severity) {
- setValue(KEY_SEVERITY, severity);
- }
+ public WeatherAlert setSeverity( String severity) {
+ setValue(KEY_SEVERITY, severity);
+ return this;
+ }
/**
* @return severity
@@ -109,9 +112,10 @@ public class WeatherAlert extends RPCStruct {
* Min Size: 1, Max Size: 99
* @param regions -
*/
- public void setRegions(@NonNull List<String> regions) {
- setValue(KEY_REGIONS, regions);
- }
+ public WeatherAlert setRegions(@NonNull List<String> regions) {
+ setValue(KEY_REGIONS, regions);
+ return this;
+ }
/**
* @return regions list
@@ -124,9 +128,10 @@ public class WeatherAlert extends RPCStruct {
/**
* @param expires -
*/
- public void setExpires(DateTime expires) {
- setValue(KEY_EXPIRES, expires);
- }
+ public WeatherAlert setExpires( DateTime expires) {
+ setValue(KEY_EXPIRES, expires);
+ return this;
+ }
/**
* @return expires
@@ -138,9 +143,10 @@ public class WeatherAlert extends RPCStruct {
/**
* @param timeIssued -
*/
- public void setTimeIssued(DateTime timeIssued) {
- setValue(KEY_TIME_ISSUED, timeIssued);
- }
+ public WeatherAlert setTimeIssued( DateTime timeIssued) {
+ setValue(KEY_TIME_ISSUED, timeIssued);
+ return this;
+ }
/**
* @return timeIssued
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherData.java
index a3b897acb..c9bbf02f4 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherData.java
@@ -73,9 +73,10 @@ public class WeatherData extends RPCStruct {
/**
* @param currentTemperature -
*/
- public void setCurrentTemperature(Temperature currentTemperature) {
- setValue(KEY_CURRENT_TEMPERATURE, currentTemperature);
- }
+ public WeatherData setCurrentTemperature( Temperature currentTemperature) {
+ setValue(KEY_CURRENT_TEMPERATURE, currentTemperature);
+ return this;
+ }
/**
* @return currentTemperature
@@ -87,9 +88,10 @@ public class WeatherData extends RPCStruct {
/**
* @param temperatureHigh -
*/
- public void setTemperatureHigh(Temperature temperatureHigh) {
- setValue(KEY_TEMPERATURE_HIGH, temperatureHigh);
- }
+ public WeatherData setTemperatureHigh( Temperature temperatureHigh) {
+ setValue(KEY_TEMPERATURE_HIGH, temperatureHigh);
+ return this;
+ }
/**
* @return temperatureHigh
@@ -101,9 +103,10 @@ public class WeatherData extends RPCStruct {
/**
* @param temperatureLow -
*/
- public void setTemperatureLow(Temperature temperatureLow) {
- setValue(KEY_TEMPERATURE_LOW, temperatureLow);
- }
+ public WeatherData setTemperatureLow( Temperature temperatureLow) {
+ setValue(KEY_TEMPERATURE_LOW, temperatureLow);
+ return this;
+ }
/**
* @return temperatureLow
@@ -115,9 +118,10 @@ public class WeatherData extends RPCStruct {
/**
* @param apparentTemperature -
*/
- public void setApparentTemperature(Temperature apparentTemperature) {
- setValue(KEY_APPARENT_TEMPERATURE, apparentTemperature);
- }
+ public WeatherData setApparentTemperature( Temperature apparentTemperature) {
+ setValue(KEY_APPARENT_TEMPERATURE, apparentTemperature);
+ return this;
+ }
/**
* @return apparentTemperature
@@ -129,9 +133,10 @@ public class WeatherData extends RPCStruct {
/**
* @param apparentTemperatureHigh -
*/
- public void setApparentTemperatureHigh(Temperature apparentTemperatureHigh) {
- setValue(KEY_APPARENT_TEMPERATURE_HIGH, apparentTemperatureHigh);
- }
+ public WeatherData setApparentTemperatureHigh( Temperature apparentTemperatureHigh) {
+ setValue(KEY_APPARENT_TEMPERATURE_HIGH, apparentTemperatureHigh);
+ return this;
+ }
/**
* @return apparentTemperatureHigh
@@ -143,9 +148,10 @@ public class WeatherData extends RPCStruct {
/**
* @param apparentTemperatureLow -
*/
- public void setApparentTemperatureLow(Temperature apparentTemperatureLow) {
- setValue(KEY_APPARENT_TEMPERATURE_LOW, apparentTemperatureLow);
- }
+ public WeatherData setApparentTemperatureLow( Temperature apparentTemperatureLow) {
+ setValue(KEY_APPARENT_TEMPERATURE_LOW, apparentTemperatureLow);
+ return this;
+ }
/**
* @return apparentTemperatureLow
@@ -157,9 +163,10 @@ public class WeatherData extends RPCStruct {
/**
* @param weatherSummary -
*/
- public void setWeatherSummary(String weatherSummary) {
- setValue(KEY_WEATHER_SUMMARY, weatherSummary);
- }
+ public WeatherData setWeatherSummary( String weatherSummary) {
+ setValue(KEY_WEATHER_SUMMARY, weatherSummary);
+ return this;
+ }
/**
* @return weatherSummary
@@ -171,9 +178,10 @@ public class WeatherData extends RPCStruct {
/**
* @param time -
*/
- public void setTime(DateTime time) {
- setValue(KEY_TIME, time);
- }
+ public WeatherData setTime( DateTime time) {
+ setValue(KEY_TIME, time);
+ return this;
+ }
/**
* @return time
@@ -186,9 +194,10 @@ public class WeatherData extends RPCStruct {
* minValue: 0, maxValue: 1
* @param humidity - percentage humidity
*/
- public void setHumidity(Float humidity) {
- setValue(KEY_HUMIDITY, humidity);
- }
+ public WeatherData setHumidity( Float humidity) {
+ setValue(KEY_HUMIDITY, humidity);
+ return this;
+ }
/**
* minValue: 0, maxValue: 1
@@ -202,9 +211,10 @@ public class WeatherData extends RPCStruct {
* minValue: 0, maxValue: 1
* @param cloudCover - cloud cover
*/
- public void setCloudCover(Float cloudCover) {
- setValue(KEY_CLOUD_COVER, cloudCover);
- }
+ public WeatherData setCloudCover( Float cloudCover) {
+ setValue(KEY_CLOUD_COVER, cloudCover);
+ return this;
+ }
/**
* minValue: 0, maxValue: 1
@@ -218,9 +228,10 @@ public class WeatherData extends RPCStruct {
* 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);
- }
+ public WeatherData setMoonPhase( Float moonPhase) {
+ setValue(KEY_MOON_PHASE, moonPhase);
+ return this;
+ }
/**
* minValue: 0, maxValue: 1
@@ -233,9 +244,10 @@ public class WeatherData extends RPCStruct {
/**
* @param windBearing - In degrees, true north at 0 degrees
*/
- public void setWindBearing(Integer windBearing) {
- setValue(KEY_WIND_BEARING, windBearing);
- }
+ public WeatherData setWindBearing( Integer windBearing) {
+ setValue(KEY_WIND_BEARING, windBearing);
+ return this;
+ }
/**
* @return windBearing - In degrees, true north at 0 degrees
@@ -247,9 +259,10 @@ public class WeatherData extends RPCStruct {
/**
* @param windGust - km/hr
*/
- public void setWindGust(Float windGust) {
- setValue(KEY_WIND_GUST, windGust);
- }
+ public WeatherData setWindGust( Float windGust) {
+ setValue(KEY_WIND_GUST, windGust);
+ return this;
+ }
/**
* @return windGust - km/hr
@@ -261,9 +274,10 @@ public class WeatherData extends RPCStruct {
/**
* @param windSpeed - km/hr
*/
- public void setWindSpeed(Float windSpeed) {
- setValue(KEY_WIND_SPEED, windSpeed);
- }
+ public WeatherData setWindSpeed( Float windSpeed) {
+ setValue(KEY_WIND_SPEED, windSpeed);
+ return this;
+ }
/**
* @return windSpeed - km/hr
@@ -275,9 +289,10 @@ public class WeatherData extends RPCStruct {
/**
* @param nearestStormBearing - In degrees, true north at 0 degrees
*/
- public void setNearestStormBearing(Integer nearestStormBearing) {
- setValue(KEY_NEAREST_STORM_BEARING, nearestStormBearing);
- }
+ public WeatherData setNearestStormBearing( Integer nearestStormBearing) {
+ setValue(KEY_NEAREST_STORM_BEARING, nearestStormBearing);
+ return this;
+ }
/**
* @return nearestStormBearing - In degrees, true north at 0 degrees
@@ -289,9 +304,10 @@ public class WeatherData extends RPCStruct {
/**
* @param nearestStormDistance - In km
*/
- public void setNearestStormDistance(Integer nearestStormDistance) {
- setValue(KEY_NEAREST_STORM_DISTANCE, nearestStormDistance);
- }
+ public WeatherData setNearestStormDistance( Integer nearestStormDistance) {
+ setValue(KEY_NEAREST_STORM_DISTANCE, nearestStormDistance);
+ return this;
+ }
/**
* @return nearestStormDistance - In km
@@ -303,9 +319,10 @@ public class WeatherData extends RPCStruct {
/**
* @param precipAccumulation - cm
*/
- public void setPrecipAccumulation(Float precipAccumulation) {
- setValue(KEY_PRECIP_ACCUMULATION, precipAccumulation);
- }
+ public WeatherData setPrecipAccumulation( Float precipAccumulation) {
+ setValue(KEY_PRECIP_ACCUMULATION, precipAccumulation);
+ return this;
+ }
/**
* @return precipAccumulation - cm
@@ -317,9 +334,10 @@ public class WeatherData extends RPCStruct {
/**
* @param precipIntensity - cm of water per hour
*/
- public void setPrecipIntensity(Float precipIntensity) {
- setValue(KEY_PRECIP_INTENSITY, precipIntensity);
- }
+ public WeatherData setPrecipIntensity( Float precipIntensity) {
+ setValue(KEY_PRECIP_INTENSITY, precipIntensity);
+ return this;
+ }
/**
* @return precipIntensity - cm of water per hour
@@ -332,9 +350,10 @@ public class WeatherData extends RPCStruct {
* minValue: 0, maxValue: 1
* @param precipProbability - percentage chance
*/
- public void setPrecipProbability(Float precipProbability) {
- setValue(KEY_PRECIP_PROBABILITY, precipProbability);
- }
+ public WeatherData setPrecipProbability( Float precipProbability) {
+ setValue(KEY_PRECIP_PROBABILITY, precipProbability);
+ return this;
+ }
/**
* minValue: 0, maxValue: 1
@@ -347,9 +366,10 @@ public class WeatherData extends RPCStruct {
/**
* @param precipType - e.g. "rain", "snow", "sleet", "hail"
*/
- public void setPrecipType(String precipType) {
- setValue(KEY_PRECIP_TYPE, precipType);
- }
+ public WeatherData setPrecipType( String precipType) {
+ setValue(KEY_PRECIP_TYPE, precipType);
+ return this;
+ }
/**
* @return precipType - e.g. "rain", "snow", "sleet", "hail"
@@ -361,9 +381,10 @@ public class WeatherData extends RPCStruct {
/**
* @param weatherIcon -
*/
- public void setWeatherIcon(Image weatherIcon) {
- setValue(KEY_WEATHER_ICON, weatherIcon);
- }
+ public WeatherData setWeatherIcon( Image weatherIcon) {
+ setValue(KEY_WEATHER_ICON, weatherIcon);
+ return this;
+ }
/**
* @return weatherIcon
@@ -375,9 +396,10 @@ public class WeatherData extends RPCStruct {
/**
* @param visibility - In km
*/
- public void setVisibility(Float visibility) {
- setValue(KEY_VISIBILITY, visibility);
- }
+ public WeatherData setVisibility( Float visibility) {
+ setValue(KEY_VISIBILITY, visibility);
+ return this;
+ }
/**
* @return visibility - In km
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java
index 9ae1d4e0d..0d7a26648 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceData.java
@@ -68,9 +68,10 @@ public class WeatherServiceData extends RPCStruct {
/**
* @param location -
*/
- public void setLocation(@NonNull LocationDetails location) {
- setValue(KEY_LOCATION, location);
- }
+ public WeatherServiceData setLocation(@NonNull LocationDetails location) {
+ setValue(KEY_LOCATION, location);
+ return this;
+ }
/**
* @return location
@@ -82,9 +83,10 @@ public class WeatherServiceData extends RPCStruct {
/**
* @param currentForecast -
*/
- public void setCurrentForecast(WeatherData currentForecast) {
- setValue(KEY_CURRENT_FORECAST, currentForecast);
- }
+ public WeatherServiceData setCurrentForecast( WeatherData currentForecast) {
+ setValue(KEY_CURRENT_FORECAST, currentForecast);
+ return this;
+ }
/**
* @return currentForecast
@@ -97,9 +99,10 @@ public class WeatherServiceData extends RPCStruct {
* minsize: 15, maxsize: 60
* @param minuteForecast -
*/
- public void setMinuteForecast(List<WeatherData> minuteForecast){
- setValue(KEY_MINUTE_FORECAST, minuteForecast);
- }
+ public WeatherServiceData setMinuteForecast( List<WeatherData> minuteForecast) {
+ setValue(KEY_MINUTE_FORECAST, minuteForecast);
+ return this;
+ }
/**
* minsize: 15, maxsize: 60
@@ -114,9 +117,10 @@ public class WeatherServiceData extends RPCStruct {
* minsize: 1, maxsize: 96
* @param hourlyForecast -
*/
- public void setHourlyForecast(List<WeatherData> hourlyForecast){
- setValue(KEY_HOURLY_FORECAST, hourlyForecast);
- }
+ public WeatherServiceData setHourlyForecast( List<WeatherData> hourlyForecast) {
+ setValue(KEY_HOURLY_FORECAST, hourlyForecast);
+ return this;
+ }
/**
* minsize: 1, maxsize: 96
@@ -131,9 +135,10 @@ public class WeatherServiceData extends RPCStruct {
* minsize: 1, maxsize: 30
* @param multidayForecast -
*/
- public void setMultidayForecast(List<WeatherData> multidayForecast){
- setValue(KEY_MULTIDAY_FORECAST, multidayForecast);
- }
+ public WeatherServiceData setMultidayForecast( List<WeatherData> multidayForecast) {
+ setValue(KEY_MULTIDAY_FORECAST, multidayForecast);
+ return this;
+ }
/**
* minsize: 1, maxsize: 30
@@ -148,9 +153,10 @@ public class WeatherServiceData extends RPCStruct {
* minsize: 1, maxsize: 10
* @param alerts -
*/
- public void setAlerts(List<WeatherAlert> alerts){
- setValue(KEY_ALERTS, alerts);
- }
+ public WeatherServiceData setAlerts( List<WeatherAlert> alerts) {
+ setValue(KEY_ALERTS, alerts);
+ return this;
+ }
/**
* minsize: 1, maxsize: 10
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceManifest.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceManifest.java
index 2f6a9f8d3..79a4e5528 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceManifest.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WeatherServiceManifest.java
@@ -56,9 +56,10 @@ public class WeatherServiceManifest extends RPCStruct {
* Set whether the current forecast is supported
* @param currentForecastSupported -
*/
- public void setCurrentForecastSupported(Boolean currentForecastSupported){
- setValue(KEY_CURRENT_FORECAST_SUPPORTED, currentForecastSupported);
- }
+ public WeatherServiceManifest setCurrentForecastSupported( Boolean currentForecastSupported) {
+ setValue(KEY_CURRENT_FORECAST_SUPPORTED, currentForecastSupported);
+ return this;
+ }
/**
* Get whether the current forecast is supported
@@ -72,9 +73,10 @@ public class WeatherServiceManifest extends RPCStruct {
* Set the max multi day forecast amount
* @param maxMultidayForecastAmount -
*/
- public void setMaxMultidayForecastAmount(Integer maxMultidayForecastAmount){
- setValue(KEY_MAX_MULTIDAY_FORECAST_AMOUNT, maxMultidayForecastAmount);
- }
+ public WeatherServiceManifest setMaxMultidayForecastAmount( Integer maxMultidayForecastAmount) {
+ setValue(KEY_MAX_MULTIDAY_FORECAST_AMOUNT, maxMultidayForecastAmount);
+ return this;
+ }
/**
* Get the max multi day forecast amount
@@ -88,9 +90,10 @@ public class WeatherServiceManifest extends RPCStruct {
* Set the max hourly forecast amount
* @param maxHourlyForecastAmount -
*/
- public void setMaxHourlyForecastAmount(Integer maxHourlyForecastAmount){
- setValue(KEY_MAX_HOURLY_FORECAST_AMOUNT, maxHourlyForecastAmount);
- }
+ public WeatherServiceManifest setMaxHourlyForecastAmount( Integer maxHourlyForecastAmount) {
+ setValue(KEY_MAX_HOURLY_FORECAST_AMOUNT, maxHourlyForecastAmount);
+ return this;
+ }
/**
* Get the max hourly forecast amount
@@ -104,9 +107,10 @@ public class WeatherServiceManifest extends RPCStruct {
* Set the max minutely forecast amount
* @param maxMinutelyForecastAmount -
*/
- public void setMaxMinutelyForecastAmount(Integer maxMinutelyForecastAmount){
- setValue(KEY_MAX_MINUTELY_FORECAST_AMOUNT, maxMinutelyForecastAmount);
- }
+ public WeatherServiceManifest setMaxMinutelyForecastAmount( Integer maxMinutelyForecastAmount) {
+ setValue(KEY_MAX_MINUTELY_FORECAST_AMOUNT, maxMinutelyForecastAmount);
+ return this;
+ }
/**
* Get the max minutely forecast amount
@@ -120,9 +124,10 @@ public class WeatherServiceManifest extends RPCStruct {
* Set whether the weather is supported for the current location
* @param weatherForLocationSupported -
*/
- public void setWeatherForLocationSupported(Boolean weatherForLocationSupported){
- setValue(KEY_WEATHER_FOR_LOCATION_SUPPORTED, weatherForLocationSupported);
- }
+ public WeatherServiceManifest setWeatherForLocationSupported( Boolean weatherForLocationSupported) {
+ setValue(KEY_WEATHER_FOR_LOCATION_SUPPORTED, weatherForLocationSupported);
+ return this;
+ }
/**
* Get whether the weather is supported for the current location
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java
index c93cb50ca..dcf05b4c3 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java
@@ -34,8 +34,9 @@ public class WindowCapability extends RPCStruct {
*
* @param windowID A unique ID to identify the window. The value of '0' will always be the default main window on the main display and should not be used in this context as it will already be created for the app. See PredefinedWindows enum. Creating a window with an ID that is already in use will be rejected with `INVALID_ID`.
*/
- public void setWindowID(Integer windowID) {
+ public WindowCapability setWindowID( Integer windowID) {
setValue(KEY_WINDOW_ID, windowID);
+ return this;
}
/**
@@ -63,8 +64,9 @@ public class WindowCapability extends RPCStruct {
*
* @param textFields the List of textFields
*/
- public void setTextFields(List<TextField> textFields) {
+ public WindowCapability setTextFields( List<TextField> textFields) {
setValue(KEY_TEXT_FIELDS, textFields);
+ return this;
}
/**
@@ -83,8 +85,9 @@ public class WindowCapability extends RPCStruct {
*
* @param imageFields the List of imageFields
*/
- public void setImageFields(List<ImageField> imageFields) {
+ public WindowCapability setImageFields( List<ImageField> imageFields) {
setValue(KEY_IMAGE_FIELDS, imageFields);
+ return this;
}
/**
@@ -103,8 +106,9 @@ public class WindowCapability extends RPCStruct {
*
* @param imageTypeSupported the List of ImageType
*/
- public void setImageTypeSupported(List<ImageType> imageTypeSupported) {
+ public WindowCapability setImageTypeSupported( List<ImageType> imageTypeSupported) {
setValue(KEY_IMAGE_TYPE_SUPPORTED, imageTypeSupported);
+ return this;
}
/**
@@ -123,8 +127,9 @@ public class WindowCapability extends RPCStruct {
*
* @param templatesAvailable the List of String
*/
- public void setTemplatesAvailable(List<String> templatesAvailable) {
+ public WindowCapability setTemplatesAvailable( List<String> templatesAvailable) {
setValue(KEY_TEMPLATES_AVAILABLE, templatesAvailable);
+ return this;
}
/**
@@ -142,8 +147,9 @@ public class WindowCapability extends RPCStruct {
*
* @param numCustomPresetsAvailable
*/
- public void setNumCustomPresetsAvailable(Integer numCustomPresetsAvailable) {
+ public WindowCapability setNumCustomPresetsAvailable( Integer numCustomPresetsAvailable) {
setValue(KEY_NUM_CUSTOM_PRESETS_AVAILABLE, numCustomPresetsAvailable);
+ return this;
}
/**
@@ -152,8 +158,9 @@ public class WindowCapability extends RPCStruct {
*
* @param buttonCapabilities It refers to number of buttons and the capabilities of each on-window button.
*/
- public void setButtonCapabilities(List<ButtonCapabilities> buttonCapabilities) {
+ public WindowCapability setButtonCapabilities( List<ButtonCapabilities> buttonCapabilities) {
setValue(KEY_BUTTON_CAPABILITIES, buttonCapabilities);
+ return this;
}
/**
@@ -173,8 +180,9 @@ public class WindowCapability extends RPCStruct {
*
* @param softButtonCapabilities It refers to number of soft buttons available on-window and the capabilities for each button.
*/
- public void setSoftButtonCapabilities(List<SoftButtonCapabilities> softButtonCapabilities) {
+ public WindowCapability setSoftButtonCapabilities( List<SoftButtonCapabilities> softButtonCapabilities) {
setValue(KEY_SOFT_BUTTON_CAPABILITIES, softButtonCapabilities);
+ return this;
}
/**
@@ -193,8 +201,9 @@ public class WindowCapability extends RPCStruct {
* is assumed to be available
* @param menuLayout - An array of MenuLayouts
*/
- public void setMenuLayoutsAvailable(List<MenuLayout> menuLayout) {
+ public WindowCapability setMenuLayoutsAvailable( List<MenuLayout> menuLayout) {
setValue(KEY_MENU_LAYOUTS_AVAILABLE, menuLayout);
+ return this;
}
/**
@@ -214,8 +223,9 @@ public class WindowCapability extends RPCStruct {
* module will send dynamic update RPCs.
* @since SmartDeviceLink 7.0.0
*/
- public void setDynamicUpdateCapabilities(DynamicUpdateCapabilities dynamicUpdateCapabilities) {
+ public WindowCapability setDynamicUpdateCapabilities( DynamicUpdateCapabilities dynamicUpdateCapabilities) {
setValue(KEY_DYNAMIC_UPDATE_CAPABILITIES, dynamicUpdateCapabilities);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowState.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowState.java
index e17d9b7d9..4c61c69a5 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowState.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowState.java
@@ -52,7 +52,7 @@ import java.util.Hashtable;
* <tr>
* <td>approximatePosition</td>
* <td>Integer</td>
- * <td>The approximate percentage that the window is open - 0 being fully closed, 100 being fullyopen</td>
+ * <td>The approximate percentage that the window is open - 0 being fully closed, 100 being fully open</td>
* <td>Y</td>
* <td></td>
* </tr>
@@ -104,8 +104,9 @@ public class WindowState extends RPCStruct {
* @param approximatePosition The approximate percentage that the window is open - 0 being fully closed, 100 being fully
* open
*/
- public void setApproximatePosition(@NonNull Integer approximatePosition) {
+ public WindowState setApproximatePosition(@NonNull Integer approximatePosition) {
setValue(KEY_APPROXIMATE_POSITION, approximatePosition);
+ return this;
}
/**
@@ -124,8 +125,9 @@ public class WindowState extends RPCStruct {
* @param deviation The percentage deviation of the approximatePosition. e.g. If the approximatePosition is 50
* and the deviation is 10, then the window's location is somewhere between 40 and 60.
*/
- public void setDeviation(@NonNull Integer deviation) {
+ public WindowState setDeviation(@NonNull Integer deviation) {
setValue(KEY_DEVIATION, deviation);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowStatus.java
index 075d5f142..ebae89ea8 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowStatus.java
@@ -103,8 +103,9 @@ public class WindowStatus extends RPCStruct {
*
* @param location
*/
- public void setLocation(@NonNull Grid location) {
+ public WindowStatus setLocation(@NonNull Grid location) {
setValue(KEY_LOCATION, location);
+ return this;
}
/**
@@ -121,8 +122,9 @@ public class WindowStatus extends RPCStruct {
*
* @param state
*/
- public void setState(@NonNull WindowState state) {
+ public WindowStatus setState(@NonNull WindowState state) {
setValue(KEY_STATE, state);
+ return this;
}
/**
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowTypeCapabilities.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowTypeCapabilities.java
index 4853a29a2..c145dc455 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowTypeCapabilities.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowTypeCapabilities.java
@@ -47,8 +47,9 @@ public class WindowTypeCapabilities extends RPCStruct {
*
* @param type Type of windows available, to create.
*/
- public void setType(@NonNull WindowType type) {
+ public WindowTypeCapabilities setType(@NonNull WindowType type) {
setValue(KEY_TYPE, type);
+ return this;
}
/**
@@ -65,8 +66,9 @@ public class WindowTypeCapabilities extends RPCStruct {
*
* @param maximumNumberOfWindows Number of windows available, to create.
*/
- public void setMaximumNumberOfWindows(@NonNull Integer maximumNumberOfWindows) {
+ public WindowTypeCapabilities setMaximumNumberOfWindows(@NonNull Integer maximumNumberOfWindows) {
setValue(KEY_MAXIMUM_NUMBER_OF_WINDOWS, maximumNumberOfWindows);
+ return this;
}
/**
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
index d58a048a5..79b1174dd 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonName.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/ButtonName.java
@@ -54,12 +54,12 @@ package com.smartdevicelink.proxy.rpc.enums;
*/
public enum ButtonName{
/**
- * <br><b>THIS ENUM VALUE WILL CHANGE IN FUNCITONALITY DURING THE NEXT MAJOR RELEASE!</b>
+ * <br><b>THIS ENUM VALUE WILL CHANGE IN FUNCTIONALITY 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,
+ * mitigate a potential break in functionality. 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>
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CapacityUnit.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CapacityUnit.java
new file mode 100644
index 000000000..a8b3c4817
--- /dev/null
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CapacityUnit.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2017 - 2020, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium Inc. nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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;
+
+/**
+ * @since SmartDeviceLink 7.0.0
+ */
+public enum CapacityUnit {
+ LITERS,
+
+ KILOWATTHOURS,
+
+ KILOGRAMS;
+
+ /**
+ * Convert String to CapacityUnit
+ *
+ * @param value String
+ * @return CapacityUnit
+ */
+ public static CapacityUnit 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
index 22bfe6c9e..e4a5cdff1 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CarModeStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/CarModeStatus.java
@@ -1,53 +1,53 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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.
+ /** Provides car mode NORMAL to each module.
*/
NORMAL,
- /** Provides carmode FACTORY to each module.
+ /** Provides car mode FACTORY to each module.
*/
FACTORY,
- /** Provides carmode TRANSPORT to each module.
+ /** Provides car mode TRANSPORT to each module.
*/
TRANSPORT,
- /** Provides carmode CRASH to each module.
+ /** Provides car mode CRASH to each module.
*/
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
index 0c7c4f7e3..44b654a78 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayType.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/DisplayType.java
@@ -1,39 +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.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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
+ * @since SmartDeviceLink 1.0
*
*/
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
index d8a720914..5f5eca430 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HMILevel.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/HMILevel.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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;
@@ -67,7 +67,7 @@ public enum HMILevel {
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>
+ * 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");
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
index 432b8f150..1b40ca8e5 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeypressMode.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/KeypressMode.java
@@ -29,31 +29,31 @@
* ARISING 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;
- }
- }
+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 key presses are queued and a string is eventually sent once the user chooses to submit their entry.
+ */
+ QUEUE_KEYPRESSES,
+ /**
+ * The key presses 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/MediaClockFormat.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaClockFormat.java
index d4a512088..55d9c6791 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaClockFormat.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/MediaClockFormat.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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;
/**
@@ -88,7 +88,7 @@ public enum MediaClockFormat {
* <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>
+ * <li>used for Type II head unit</li>
* </ul>
*
* @since SmartDeviceLink 1.0
@@ -104,7 +104,7 @@ public enum MediaClockFormat {
* <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>
+ * <li>used for CID head unit</li>
* </ul>
* difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character
* set
@@ -122,7 +122,7 @@ public enum MediaClockFormat {
* <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>
+ * <li>used for Type V head unit</li>
* </ul>
* difference between CLOCKTEXT1 and CLOCKTEXT2 is the supported character
* set
@@ -139,7 +139,7 @@ public enum MediaClockFormat {
* <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>
+ * <li>used for MFD3/4/5 head units</li>
* </ul>
*
*
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
index a16399201..2f708b63f 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PowerModeStatus.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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.
*
@@ -47,7 +47,7 @@ public enum PowerModeStatus {
KEY_APPROVED_0,
POST_ACCESORY_0,
- /** Key is in accessory positon
+ /** Key is in accessory position
*
*/
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
index ca130d38c..dcec89019 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/PredefinedLayout.java
@@ -84,7 +84,7 @@ public enum PredefinedLayout {
TEXT_WITH_GRAPHIC("TEXT_WITH_GRAPHIC"),
/**
- A layout with only softbuttons placed in a tile layout
+ A layout with only soft buttons placed in a tile layout
*/
TILES_ONLY("TILES_ONLY"),
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
index 40fbc59a9..18c342f64 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlInterfaceAvailability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SdlInterfaceAvailability.java
@@ -29,9 +29,9 @@
* ARISING 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;
-}
+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/SystemCapabilityType.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemCapabilityType.java
index 775781000..8b6c9a591 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemCapabilityType.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/SystemCapabilityType.java
@@ -579,9 +579,9 @@ public enum SystemCapabilityType {
*/
DRIVER_DISTRACTION(true);
- ;
- boolean IS_QUERYABLE;
+
+ final boolean IS_QUERYABLE;
SystemCapabilityType(boolean isQueryable) {
this.IS_QUERYABLE = isQueryable;
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
index cf33b73e0..22e367871 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/TextFieldName.java
@@ -204,7 +204,7 @@ public enum TextFieldName {
* @since SmartDeviceLink 7.0.0
*/
subtleAlertSoftButtonText;
- ;
+
/**
* Convert String to TextFieldName
* @param value String
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
index 7682e16f8..294d50f1e 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/VehicleDataType.java
@@ -50,10 +50,12 @@ public enum VehicleDataType {
VEHICLEDATA_RPM,
/**
* Notifies FUELLEVELData may be subscribed
+ * until Smart Device Link 7.0
*/
VEHICLEDATA_FUELLEVEL,
/**
* Notifies FUELLEVEL_STATEData may be subscribed
+ * until Smart Device Link 7.0
*/
VEHICLEDATA_FUELLEVEL_STATE,
/**
@@ -172,6 +174,11 @@ public enum VehicleDataType {
* @since SmartDeviceLink 7.0.0
*/
VEHICLEDATA_HANDSOFFSTEERING,
+
+ /**
+ * @since SmartDeviceLink 7.0.0
+ */
+ VEHICLEDATA_STABILITYCONTROLSSTATUS,
/**
* @since SmartDeviceLink 7.0.0
*/
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
index 1c5296510..2139c74bd 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WarningLightStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/enums/WarningLightStatus.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING 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;
/**
@@ -37,15 +37,15 @@ package com.smartdevicelink.proxy.rpc.enums;
*/
public enum WarningLightStatus {
/**
- * Warninglight Off
+ * Warning light Off
*/
OFF,
/**
- * Warninglight On
+ * Warning light On
*/
ON,
/**
- * Warninglight is flashing
+ * Warning light is flashing
*/
FLASH,
NOT_USED;
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
index 462a73283..8f07d4320 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnMultipleRequestListener.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnMultipleRequestListener.java
@@ -32,7 +32,6 @@
package com.smartdevicelink.proxy.rpc.listeners;
import com.smartdevicelink.proxy.RPCResponse;
-import com.smartdevicelink.proxy.rpc.enums.Result;
import java.util.Vector;
@@ -42,8 +41,7 @@ import java.util.Vector;
public abstract class OnMultipleRequestListener extends OnRPCResponseListener {
final Vector<Integer> correlationIds;
- OnRPCResponseListener rpcResponseListener;
- private static String TAG = "OnMultipleRequestListener";
+ final OnRPCResponseListener rpcResponseListener;
public OnMultipleRequestListener(){
setListenerType(UPDATE_LISTENER_TYPE_MULTIPLE_REQUESTS);
@@ -53,17 +51,6 @@ public abstract class OnMultipleRequestListener extends 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));
onUpdate(correlationIds.size());
if(correlationIds.size() == 0){
@@ -73,8 +60,8 @@ public abstract class OnMultipleRequestListener extends OnRPCResponseListener {
};
}
- public void addCorrelationId(int correlationid){
- correlationIds.add(correlationid);
+ public void addCorrelationId(int correlationId){
+ correlationIds.add(correlationId);
}
/**
* onUpdate is called during multiple stream request
@@ -82,7 +69,6 @@ public abstract class OnMultipleRequestListener extends OnRPCResponseListener {
*/
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
deleted file mode 100644
index cac4ec523..000000000
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnPutFileUpdateListener.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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;
-
-@Deprecated
-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
index 85a32c02e..237c5efe6 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCListener.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCListener.java
@@ -36,7 +36,7 @@ import com.smartdevicelink.proxy.RPCMessage;
public abstract class OnRPCListener {
/**
- * Generic listener for all RPCs including Requests, response, and notificaiton
+ * Generic listener for all RPCs including Requests, response, and notification
*/
public final static int UPDATE_LISTENER_TYPE_ALL_RPCS = -1;
@@ -44,10 +44,7 @@ public abstract class OnRPCListener {
* 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
*/
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
index 89b082326..d32a70f7e 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/listeners/OnRPCResponseListener.java
@@ -33,7 +33,6 @@ 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 {
@@ -58,7 +57,7 @@ public abstract class OnRPCResponseListener extends OnRPCListener {
*/
public void onStart(int correlationId){
- };
+ }
/**
* This is the only method that must be extended. Other methods that are able to be extended are
@@ -68,22 +67,4 @@ public abstract class OnRPCResponseListener extends OnRPCListener {
* for a PutFile request, the message parameter should be cast to a PutFileResponse class.
*/
public abstract void onResponse(int correlationId, final RPCResponse response);
-
- /**
- * @deprecated This method has been deprecated in favor of just using the onResponse callback. In the next
- * version this method will be removed and all responses successful or not will be returned
- * through the onResponse method callback.
- *
- * Called when there was some sort of error during the original request.
- * @param correlationId
- * @param resultCode
- * @param info
- */
- @Deprecated
- 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
index 55e0fae2f..03f720096 100644
--- a/base/src/main/java/com/smartdevicelink/security/AbstractSdlSecurityBase.java
+++ b/base/src/main/java/com/smartdevicelink/security/AbstractSdlSecurityBase.java
@@ -31,7 +31,7 @@
*/
package com.smartdevicelink.security;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.protocol.enums.SessionType;
import java.util.ArrayList;
@@ -44,7 +44,7 @@ abstract class AbstractSdlSecurityBase {
protected List<String> makeList = null;
protected boolean isInitSuccess = false;
protected byte sessionId = 0;
- protected List<SessionType> startServiceList = new ArrayList<SessionType>();
+ protected List<SessionType> startServiceList = new ArrayList<>();
public AbstractSdlSecurityBase() {
}
diff --git a/base/src/main/java/com/smartdevicelink/security/ISecurityInitializedListener.java b/base/src/main/java/com/smartdevicelink/security/ISecurityInitializedListener.java
index 6ad0c2a54..8969be76a 100644
--- a/base/src/main/java/com/smartdevicelink/security/ISecurityInitializedListener.java
+++ b/base/src/main/java/com/smartdevicelink/security/ISecurityInitializedListener.java
@@ -32,5 +32,5 @@
package com.smartdevicelink.security;
public interface ISecurityInitializedListener {
- public void onSecurityInitialized();
+ void onSecurityInitialized();
}
diff --git a/base/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java b/base/src/main/java/com/smartdevicelink/session/BaseSdlSession.java
index c3e6158dd..2a7ab284e 100644
--- a/base/src/main/java/com/smartdevicelink/SdlConnection/BaseSdlSession.java
+++ b/base/src/main/java/com/smartdevicelink/session/BaseSdlSession.java
@@ -30,17 +30,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-package com.smartdevicelink.SdlConnection;
+package com.smartdevicelink.session;
+
+import androidx.annotation.RestrictTo;
import com.smartdevicelink.exception.SdlException;
import com.smartdevicelink.managers.lifecycle.RpcConverter;
import com.smartdevicelink.protocol.ISdlProtocol;
+import com.smartdevicelink.protocol.ISdlServiceListener;
import com.smartdevicelink.protocol.ProtocolMessage;
import com.smartdevicelink.protocol.SdlPacket;
import com.smartdevicelink.protocol.SdlProtocolBase;
import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.proxy.RPCMessage;
-import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
import com.smartdevicelink.proxy.rpc.enums.VideoStreamingProtocol;
import com.smartdevicelink.security.ISecurityInitializedListener;
@@ -56,13 +58,14 @@ import java.util.List;
import java.util.ListIterator;
import java.util.concurrent.CopyOnWriteArrayList;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public abstract class BaseSdlSession implements ISdlProtocol, ISecurityInitializedListener {
private static final String TAG = "SdlSession";
final protected SdlProtocolBase sdlProtocol;
- protected BaseTransportConfig transportConfig;
+ protected final BaseTransportConfig transportConfig;
protected ISdlSessionListener sessionListener;
protected SdlSecurityBase sdlSecurity = null;
protected VideoStreamingParameters desiredVideoParams = null;
@@ -70,7 +73,7 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISecurityInitializ
protected int sessionId = -1;
protected HashMap<SessionType, CopyOnWriteArrayList<ISdlServiceListener>> serviceListeners;
- protected CopyOnWriteArrayList<SessionType> encryptedServices = new CopyOnWriteArrayList<SessionType>();
+ protected final CopyOnWriteArrayList<SessionType> encryptedServices = new CopyOnWriteArrayList<>();
boolean sdlSecurityInitializing = false;
@@ -181,9 +184,9 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISecurityInitializ
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);
+ int iLen = msg.getData().length - 12;
+ byte[] data = new byte[iLen];
+ System.arraycopy(msg.getData(), 12, data, 0, iLen);
byte[] dataToRead = new byte[4096];
@@ -375,12 +378,4 @@ public abstract class BaseSdlSession implements ISdlProtocol, ISecurityInitializ
public boolean isTransportForServiceAvailable(SessionType sessionType){
return sdlProtocol!=null && sdlProtocol.isTransportForServiceAvailable(sessionType);
}
-
-
- @Deprecated
- public void clearConnection(){/* Not supported */}
-
-
-
-
}
diff --git a/base/src/main/java/com/smartdevicelink/SdlConnection/ISdlSessionListener.java b/base/src/main/java/com/smartdevicelink/session/ISdlSessionListener.java
index 3cd6c23c9..e43d08f10 100644
--- a/base/src/main/java/com/smartdevicelink/SdlConnection/ISdlSessionListener.java
+++ b/base/src/main/java/com/smartdevicelink/session/ISdlSessionListener.java
@@ -29,11 +29,10 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-package com.smartdevicelink.SdlConnection;
+package com.smartdevicelink.session;
import androidx.annotation.RestrictTo;
-import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.proxy.RPCMessage;
import com.smartdevicelink.transport.BaseTransportConfig;
import com.smartdevicelink.util.Version;
diff --git a/base/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java b/base/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
index 0cfdb4c76..d7047ee76 100644
--- a/base/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
+++ b/base/src/main/java/com/smartdevicelink/streaming/AbstractPacketizer.java
@@ -1,37 +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.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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.session.SdlSession;
import com.smartdevicelink.protocol.enums.SessionType;
import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.util.Version;
@@ -41,21 +41,17 @@ import java.io.InputStream;
abstract public class AbstractPacketizer {
- protected IStreamListener _streamListener = null;
+ protected IStreamListener _streamListener;
protected byte _rpcSessionID = 0;
- protected SessionType _serviceType = null;
- protected SdlSession _session = null;
- protected InputStream is = null;
+ protected SessionType _serviceType;
+ protected SdlSession _session;
+ protected InputStream is;
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;
@@ -70,23 +66,6 @@ abstract public class AbstractPacketizer {
}
}
- @Deprecated
- public AbstractPacketizer(IStreamListener streamListener, InputStream is, RPCRequest request, SessionType sType, byte rpcSessionID, byte wiproVersion, SdlSession session) throws IOException, IllegalArgumentException {
- this._streamListener = streamListener;
- this.is = is;
- _rpcSessionID = rpcSessionID;
- _serviceType = sType;
- _request = request;
- _wiproVersion = 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;
diff --git a/base/src/main/java/com/smartdevicelink/streaming/IStreamListener.java b/base/src/main/java/com/smartdevicelink/streaming/IStreamListener.java
index e759268ec..998888bc5 100644
--- a/base/src/main/java/com/smartdevicelink/streaming/IStreamListener.java
+++ b/base/src/main/java/com/smartdevicelink/streaming/IStreamListener.java
@@ -29,10 +29,13 @@
* 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);
+package com.smartdevicelink.streaming;
+
+import androidx.annotation.RestrictTo;
+
+import com.smartdevicelink.protocol.ProtocolMessage;
+
+@RestrictTo(RestrictTo.Scope.LIBRARY)
+public interface IStreamListener {
+ void sendStreamPacket(ProtocolMessage pm);
} \ No newline at end of file
diff --git a/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingLPCMParams.java b/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingLPCMParams.java
index bde6abc4c..9845301a3 100644
--- a/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingLPCMParams.java
+++ b/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingLPCMParams.java
@@ -33,13 +33,14 @@ package com.smartdevicelink.streaming.audio;
/**
* A struct to hold LPCM specific audio format information.
*/
+@Deprecated
public class AudioStreamingLPCMParams extends AudioStreamingParams {
/**
* Sample format of linear PCM data.
*/
public enum SampleFormat {
/**
- * LPCM data is represented by 8-bit unsigned integers. Centerpoint is 128.
+ * LPCM data is represented by 8-bit unsigned integers. Center point is 128.
*/
LPCM_8BIT_UNSIGNED,
@@ -55,7 +56,7 @@ public class AudioStreamingLPCMParams extends AudioStreamingParams {
* <p>
* This is reserved for future and not used right now.
*/
- public SampleFormat sampleFormat;
+ public final SampleFormat sampleFormat;
public AudioStreamingLPCMParams(SampleFormat sampleFormat, int samplingRate, int channels) {
super(samplingRate, channels);
diff --git a/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingParams.java b/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingParams.java
index fe0f7a981..f9181e7fe 100644
--- a/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingParams.java
+++ b/base/src/main/java/com/smartdevicelink/streaming/audio/AudioStreamingParams.java
@@ -30,23 +30,27 @@
package com.smartdevicelink.streaming.audio;
+import androidx.annotation.RestrictTo;
+
/**
* A struct to hold audio format information that are common to codecs.
*/
+
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class AudioStreamingParams {
/**
* Sampling rate in Hz, e.g. 44100
* <p>
* This is reserved for future and not used right now.
*/
- public int samplingRate;
+ public final int samplingRate;
/**
* Number of channels in the audio stream
* <p>
* This is reserved for future and not used right now.
*/
- public int channels;
+ public final int channels;
public AudioStreamingParams(int samplingRate, int channels) {
this.samplingRate = samplingRate;
diff --git a/base/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java b/base/src/main/java/com/smartdevicelink/streaming/audio/IAudioStreamListener.java
index 616f07f42..20f758969 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/interfaces/IAudioStreamListener.java
+++ b/base/src/main/java/com/smartdevicelink/streaming/audio/IAudioStreamListener.java
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-package com.smartdevicelink.proxy.interfaces;
+package com.smartdevicelink.streaming.audio;
import com.smartdevicelink.managers.CompletionListener;
@@ -68,20 +68,6 @@ public interface IAudioStreamListener {
* last audio sample data included in this chunk, in microseconds.
* It must be greater than the previous timestamp.
* Specify -1 if unknown.
- */
- @Deprecated
- void sendAudio(ByteBuffer data, long presentationTimeUs);
-
- /**
- * Sends a chunk of audio data to SDL Core.
- * <p>
- * Note: this method must not be called after SdlProxyBase.endAudioStream() is called.
- *
- * @param data Data chunk to send. Its position will be updated upon return.
- * @param presentationTimeUs (Reserved for future use) Presentation timestamp (PTS) of the
- * last audio sample data included in this chunk, in microseconds.
- * It must be greater than the previous timestamp.
- * Specify -1 if unknown.
* @param completionListener A completion listener that informs when the audio file is played
*/
void sendAudio(ByteBuffer data, long presentationTimeUs, CompletionListener completionListener);
diff --git a/base/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java b/base/src/main/java/com/smartdevicelink/streaming/video/IVideoStreamListener.java
index f645b0d55..755ad7948 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/interfaces/IVideoStreamListener.java
+++ b/base/src/main/java/com/smartdevicelink/streaming/video/IVideoStreamListener.java
@@ -28,7 +28,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-package com.smartdevicelink.proxy.interfaces;
+package com.smartdevicelink.streaming.video;
import java.nio.ByteBuffer;
diff --git a/base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java b/base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java
index 9236be7a9..6a98c879e 100644
--- a/base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java
+++ b/base/src/main/java/com/smartdevicelink/streaming/video/RTPH264Packetizer.java
@@ -30,10 +30,11 @@
package com.smartdevicelink.streaming.video;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import androidx.annotation.RestrictTo;
+
+import com.smartdevicelink.session.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;
@@ -60,6 +61,7 @@ import java.util.concurrent.LinkedBlockingQueue;
*
* @author Sho Amano
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class RTPH264Packetizer extends AbstractPacketizer implements IVideoStreamListener, Runnable {
// Approximate size of data that mOutputQueue can hold in bytes.
@@ -119,7 +121,7 @@ public class RTPH264Packetizer extends AbstractPacketizer implements IVideoStrea
bufferSize = MAX_DATA_SIZE_FOR_ENCRYPTED_SERVICE;
}
- mOutputQueue = new LinkedBlockingQueue<ByteBuffer>(MAX_QUEUE_SIZE / bufferSize);
+ mOutputQueue = new LinkedBlockingQueue<>(MAX_QUEUE_SIZE / bufferSize);
mNALUnitReader = new NALUnitReader();
mPayloadType = DEFAULT_RTP_PAYLOAD_TYPE;
@@ -227,7 +229,7 @@ public class RTPH264Packetizer extends AbstractPacketizer implements IVideoStrea
}
while (frame.hasRemaining()) {
- int len = frame.remaining() > bufferSize ? bufferSize : frame.remaining();
+ int len = Math.min(frame.remaining(), bufferSize);
ProtocolMessage pm = new ProtocolMessage();
pm.setSessionID(_rpcSessionID);
@@ -388,7 +390,7 @@ public class RTPH264Packetizer extends AbstractPacketizer implements IVideoStrea
}
- private static int SKIP_TABLE[] = new int[256];
+ 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).
diff --git a/base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java b/base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
index 6727e0ead..ebc9151ca 100644
--- a/base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
+++ b/base/src/main/java/com/smartdevicelink/streaming/video/VideoStreamingParameters.java
@@ -32,6 +32,8 @@
package com.smartdevicelink.streaming.video;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.proxy.rpc.ImageResolution;
import com.smartdevicelink.proxy.rpc.VideoStreamingCapability;
import com.smartdevicelink.proxy.rpc.VideoStreamingFormat;
@@ -42,11 +44,12 @@ import com.smartdevicelink.util.DebugTool;
import java.util.List;
@SuppressWarnings("FieldCanBeLocal")
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class VideoStreamingParameters {
private static final String TAG = "VideoStreamingParameters";
private final VideoStreamingProtocol DEFAULT_PROTOCOL = VideoStreamingProtocol.RAW;
private final VideoStreamingCodec DEFAULT_CODEC = VideoStreamingCodec.H264;
- private final VideoStreamingFormat[] CURRENTLY_SUPPORTED_FORMATS = { new VideoStreamingFormat(VideoStreamingProtocol.RTP, VideoStreamingCodec.H264),
+ private final VideoStreamingFormat[] currentlySupportedFormats = { new VideoStreamingFormat(VideoStreamingProtocol.RTP, VideoStreamingCodec.H264),
new VideoStreamingFormat(VideoStreamingProtocol.RAW, VideoStreamingCodec.H264) };
private final int DEFAULT_WIDTH = 1024;
private final int DEFAULT_HEIGHT = 576;
@@ -116,7 +119,6 @@ public class VideoStreamingParameters {
* 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);
}
@@ -159,7 +161,7 @@ public class VideoStreamingParameters {
* This update will use the most preferred streaming format from the module.
* @param capability the video streaming capability returned from the SystemCapabilityManager
* @param vehicleMake the vehicle make from the RegisterAppInterfaceResponse
- * @see com.smartdevicelink.proxy.SystemCapabilityManager
+ * @see com.smartdevicelink.managers.lifecycle.SystemCapabilityManager
* @see VideoStreamingCapability
*/
public void update(VideoStreamingCapability capability, String vehicleMake){
@@ -186,49 +188,8 @@ public class VideoStreamingParameters {
final List<VideoStreamingFormat> formats = capability.getSupportedFormats();
if(formats != null && formats.size()>0){
for(VideoStreamingFormat format : formats){
- for(int i = 0; i < CURRENTLY_SUPPORTED_FORMATS.length; i ++){
- if(CURRENTLY_SUPPORTED_FORMATS[i].equals(format) ){
- this.format = format;
- return;
- }
- }
- }
- DebugTool.logWarning(TAG, "The VideoStreamingFormat has not been updated because none of the provided formats are supported.");
-
- //TODO In the future we should set format to null, but might be a breaking change
- // For now, format will remain whatever was set prior to this update
- }
-
- }
-
- /**
- * 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
- */
- @Deprecated
- public void update(VideoStreamingCapability capability){
- if(capability.getMaxBitrate()!=null){ this.bitrate = capability.getMaxBitrate() * 1000; } // NOTE: the unit of maxBitrate in getSystemCapability is kbps.
- double scale = DEFAULT_SCALE;
- if(capability.getScale() != null) { scale = capability.getScale(); }
- ImageResolution resolution = capability.getPreferredResolution();
- if(resolution!=null){
-
- if(resolution.getResolutionHeight()!=null && resolution.getResolutionHeight() > 0){ this.resolution.setResolutionHeight((int)(resolution.getResolutionHeight() / scale)); }
- if(resolution.getResolutionWidth()!=null && resolution.getResolutionWidth() > 0){ this.resolution.setResolutionWidth((int)(resolution.getResolutionWidth() / scale)); }
- }
- if (capability.getPreferredFPS() != null) {
- this.frameRate = capability.getPreferredFPS();
- }
-
- // This should be the last call as it will return out once a suitable format is found
- final List<VideoStreamingFormat> formats = capability.getSupportedFormats();
- if(formats != null && formats.size()>0){
- for(VideoStreamingFormat format : formats){
- for(int i = 0; i < CURRENTLY_SUPPORTED_FORMATS.length; i ++){
- if(CURRENTLY_SUPPORTED_FORMATS[i].equals(format) ){
+ for (VideoStreamingFormat currentlySupportedFormat : currentlySupportedFormats) {
+ if (currentlySupportedFormat.equals(format)) {
this.format = format;
return;
}
@@ -242,7 +203,6 @@ public class VideoStreamingParameters {
}
- @SuppressWarnings("unused")
public void setDisplayDensity(int displayDensity) {
this.displayDensity = displayDensity;
}
diff --git a/base/src/main/java/com/smartdevicelink/trace/DiagLevel.java b/base/src/main/java/com/smartdevicelink/trace/DiagLevel.java
index 8203d0247..6c9e60738 100644
--- a/base/src/main/java/com/smartdevicelink/trace/DiagLevel.java
+++ b/base/src/main/java/com/smartdevicelink/trace/DiagLevel.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
@@ -37,7 +37,7 @@ import com.smartdevicelink.trace.enums.Mod;
public class DiagLevel {
- static private DetailLevel[] levels;
+ static private final DetailLevel[] levels;
static { // this is a static c-tor!!
levels = new DetailLevel[Mod.values().length];
diff --git a/base/src/main/java/com/smartdevicelink/trace/Mime.java b/base/src/main/java/com/smartdevicelink/trace/Mime.java
index 814dc1ec6..54c99e582 100644
--- a/base/src/main/java/com/smartdevicelink/trace/Mime.java
+++ b/base/src/main/java/com/smartdevicelink/trace/Mime.java
@@ -1,38 +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.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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
+import java.nio.charset.StandardCharsets;
+
public class Mime {
private static final String BASE_64_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -48,7 +50,7 @@ public class Mime {
String b64String = "";
try {
- byte[] strBytes = str.getBytes("US-ASCII");
+ byte[] strBytes = str.getBytes(StandardCharsets.US_ASCII);
b64String = base64Encode(strBytes);
} catch (Exception ex) {
// Don't care?
@@ -60,7 +62,7 @@ public class Mime {
* @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[]) {
+ public static String base64Encode(byte[] bytesToEncode) {
if(bytesToEncode != null){
return base64Encode(bytesToEncode, 0, bytesToEncode.length);
}
@@ -73,7 +75,7 @@ public class Mime {
* @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) {
+ public static String base64Encode(byte[] bytesToEncode, int offset, int length) {
if (bytesToEncode == null || bytesToEncode.length < length || bytesToEncode.length < offset + length) {
return null;
}
diff --git a/base/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java b/base/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java
index 9b3831dab..b521d76ca 100644
--- a/base/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java
+++ b/base/src/main/java/com/smartdevicelink/trace/OpenRPCMessage.java
@@ -65,12 +65,11 @@ class OpenRPCMessage extends RPCMessage {
pd.append("]");
- return;
} // end-method
private void dumpParams(Hashtable<String, Object> ht, StringBuilder pd) {
Iterator<String> keySet = ht.keySet().iterator();
- Object obj = null;
+ Object obj;
String key = "";
boolean isFirstParam = true;
diff --git a/base/src/main/java/com/smartdevicelink/trace/SdlTraceBase.java b/base/src/main/java/com/smartdevicelink/trace/SdlTraceBase.java
index bbddd6453..d271bf895 100644
--- a/base/src/main/java/com/smartdevicelink/trace/SdlTraceBase.java
+++ b/base/src/main/java/com/smartdevicelink/trace/SdlTraceBase.java
@@ -59,7 +59,7 @@ class SdlTraceBase {
public static final String SYSTEM_LOG_TAG = "SdlTrace";
- private static long baseTics = java.lang.System.currentTimeMillis();
+ private static final long baseTics = java.lang.System.currentTimeMillis();
private static boolean acceptAPITraceAdjustments = true;
protected static ISTListener m_appTraceListener = null;
@@ -214,8 +214,8 @@ class SdlTraceBase {
//rpcAsXml.append(newline);
if (dl == DetailLevel.VERBOSE) {
- OpenRPCMessage orpcmsg = new OpenRPCMessage(rpcMsg);
- String rpcParamList = orpcmsg.msgDump();
+ OpenRPCMessage openRPCMessage = new OpenRPCMessage(rpcMsg);
+ String rpcParamList = openRPCMessage.msgDump();
String msg = SdlTrace.B64EncodeForXML(rpcParamList);
rpcAsXml.append("<d>");
rpcAsXml.append(msg);
@@ -342,7 +342,7 @@ class SdlTraceBase {
return sb.toString();
} // end-method
- public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int byteLength, String token) {
+ 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);
}
@@ -352,7 +352,7 @@ class SdlTraceBase {
} // end-if
} // end-method
- public static boolean logTransportEvent(String preamble, String transportSpecificInfoXml, InterfaceActivityDirection msgDirection, byte buf[], int offset, int byteLength, String token) {
+ 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;
}
@@ -402,7 +402,7 @@ class SdlTraceBase {
private static boolean writeXmlTraceMessage(String msg) {
try {
// Attempt to write formatted message to the Siphon
- if (false == writeMessageToSiphonServer(msg)) {
+ if (!writeMessageToSiphonServer(msg)) {
// If writing to the Siphon fails, write to the native log
NativeLogTool.logInfo(SdlTrace.SYSTEM_LOG_TAG, msg);
return false;
diff --git a/base/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java b/base/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java
index 57237d0bc..b037e2b1b 100644
--- a/base/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java
+++ b/base/src/main/java/com/smartdevicelink/transport/BaseTransportConfig.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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;
@@ -37,26 +37,13 @@ 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 abstract TransportType getTransportType();
public int getHeartBeatTimeout() {
return iHeartBeatTimeout;
diff --git a/base/src/main/java/com/smartdevicelink/transport/ITransportListener.java b/base/src/main/java/com/smartdevicelink/transport/ITransportListener.java
deleted file mode 100644
index 46baf5296..000000000
--- a/base/src/main/java/com/smartdevicelink/transport/ITransportListener.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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
index 52d2512ee..b6eac12e0 100644
--- a/base/src/main/java/com/smartdevicelink/transport/SdlPsm.java
+++ b/base/src/main/java/com/smartdevicelink/transport/SdlPsm.java
@@ -39,7 +39,7 @@ 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
+ //Each state represents the byte that should be incoming
public static final int START_STATE = 0x0;
public static final int SERVICE_TYPE_STATE = 0x02;
@@ -84,13 +84,10 @@ public class SdlPsm{
}
public boolean handleByte(byte data) {
- //Log.trace(TAG, data + " = incomming");
+ //Log.trace(TAG, data + " = incoming");
state = transitionOnInput(data,state);
-
- if(state==ERROR_STATE){
- return false;
- }
- return true;
+
+ return state != ERROR_STATE;
}
private int transitionOnInput(byte rawByte, int state){
diff --git a/base/src/main/java/com/smartdevicelink/transport/SiphonServer.java b/base/src/main/java/com/smartdevicelink/transport/SiphonServer.java
index d9dbb54e9..3648bd8fc 100644
--- a/base/src/main/java/com/smartdevicelink/transport/SiphonServer.java
+++ b/base/src/main/java/com/smartdevicelink/transport/SiphonServer.java
@@ -62,7 +62,7 @@ public class SiphonServer {
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 final Object m_siphonLock = new Object();
private static ServerSocket m_listeningSocket = null;
private static short m_listenPort = -1;
private static OutputStream m_siphonSocketOutputStream = null;
@@ -72,7 +72,7 @@ public class SiphonServer {
private static long m_startTimeStamp = 0;
// SDL Trace Message Version
- private static byte m_sdlTraceMsgVersionNumber = 1;
+ private static final byte m_sdlTraceMsgVersionNumber = 1;
// Max number of ports to attempt a connection on
private final static Integer MAX_NUMBER_OF_PORT_ATTEMPTS = 20;
@@ -192,7 +192,7 @@ public class SiphonServer {
return false;
}
- byte messageBytes[] = null;
+ byte[] messageBytes;
int messageLength = 0;
try {
@@ -212,7 +212,7 @@ public class SiphonServer {
return false;
}
- byte messageBytes[] = null;
+ byte[] messageBytes;
int messageLength = 0;
try {
@@ -234,7 +234,7 @@ public class SiphonServer {
byte siphonDataTypeIndicator = 0x00;
long currentDateTime = System.currentTimeMillis();
- Integer deltaTimeMills = null;
+ Integer deltaTimeMills;
deltaTimeMills = (int)(currentDateTime - m_startTimeStamp);
@@ -278,7 +278,7 @@ public class SiphonServer {
return false;
}
- OutputStream siphonOutputStream = null;
+ OutputStream siphonOutputStream;
synchronized (m_siphonLock) {
siphonOutputStream = m_siphonSocketOutputStream;
@@ -315,7 +315,7 @@ public class SiphonServer {
}
private boolean findOpenSocket(short port) {
- // Accept incoming sihpon connection from trace utility.
+ // Accept incoming siphon connection from trace utility.
Boolean foundOpenPort = false;
listenPort = port;
@@ -339,7 +339,7 @@ public class SiphonServer {
}
private void startServerOnPort() throws IOException {
- Socket newSocket = null;
+ Socket newSocket;
// Wait for a connection
newSocket = m_listeningSocket.accept();
@@ -407,7 +407,7 @@ public class SiphonServer {
}
}
- private static final byte[] intToByteArray(int value) {
+ private static byte[] intToByteArray(int value) {
return new byte[] {
(byte)(value >>> 24),
(byte)(value >>> 16),
diff --git a/base/src/main/java/com/smartdevicelink/transport/TransportConstants.java b/base/src/main/java/com/smartdevicelink/transport/TransportConstants.java
index 9b2eba9ed..7fbcde80d 100644
--- a/base/src/main/java/com/smartdevicelink/transport/TransportConstants.java
+++ b/base/src/main/java/com/smartdevicelink/transport/TransportConstants.java
@@ -65,8 +65,6 @@ public class TransportConstants {
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
@@ -78,7 +76,7 @@ public class TransportConstants {
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 HARDWARE_DISCONNECTED = "hardware.disconect"; //This is legacy, do not refactor this.
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";
@@ -294,4 +292,14 @@ public class TransportConstants {
public static final String AOA_USB = "AOA_USB";
public static final String TCP_WIFI = "TCP_WIFI";
+
+ /**
+ * 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";
+
+
}
diff --git a/base/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java b/base/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java
index bcab4ff58..bc6de3d61 100644
--- a/base/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java
+++ b/base/src/main/java/com/smartdevicelink/transport/TransportManagerBase.java
@@ -59,9 +59,6 @@ public abstract class TransportManagerBase {
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
@@ -111,7 +108,7 @@ public abstract class TransportManagerBase {
public abstract void sendPacket(SdlPacket packet);
/**
- * Base implementation does nothing and assumes it is not necssary. This method should be
+ * Base implementation does nothing and assumes it is not necessary. 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
diff --git a/base/src/main/java/com/smartdevicelink/util/ByteEnumer.java b/base/src/main/java/com/smartdevicelink/util/ByteEnumer.java
index fe699f7a6..ae949a25a 100644
--- a/base/src/main/java/com/smartdevicelink/util/ByteEnumer.java
+++ b/base/src/main/java/com/smartdevicelink/util/ByteEnumer.java
@@ -1,37 +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.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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.Objects;
import java.util.Vector;
public abstract class ByteEnumer {
@@ -41,14 +42,14 @@ public abstract class ByteEnumer {
this.name = name;
}
- private byte value;
- private String name;
+ private final byte value;
+ private final String name;
public byte getValue() { return value; }
public String getName() { return name; }
public boolean equals(ByteEnumer other) {
- return name == other.getName();
+ return Objects.equals(name, other.getName());
}
public boolean eq(ByteEnumer other) {
diff --git a/base/src/main/java/com/smartdevicelink/util/DebugTool.java b/base/src/main/java/com/smartdevicelink/util/DebugTool.java
index d073fc654..58af5a09a 100644
--- a/base/src/main/java/com/smartdevicelink/util/DebugTool.java
+++ b/base/src/main/java/com/smartdevicelink/util/DebugTool.java
@@ -70,9 +70,7 @@ public class DebugTool {
public static boolean isDebugEnabled()
{
- if (isWarningEnabled && isInfoEnabled) return true;
-
- return false;
+ return isWarningEnabled && isInfoEnabled;
}
@SuppressWarnings("ConstantConditions")
@@ -97,11 +95,6 @@ public class DebugTool {
}
}
- @Deprecated
- public static void logError(String msg) {
- logError(TAG, msg);
- }
-
public static void logError(String tag, String msg, Throwable ex) {
Boolean wasWritten = false;
@@ -119,11 +112,6 @@ public class DebugTool {
}
}
- @Deprecated
- public static void logError(String msg, Throwable ex) {
- logError(TAG, msg, ex);
- }
-
public static void logWarning(String tag, String msg) {
Boolean wasWritten = false;
@@ -137,11 +125,6 @@ public class DebugTool {
}
}
- @Deprecated
- public static void logWarning(String msg) {
- logWarning(TAG, msg);
- }
-
public static void logInfo(String tag, String msg) {
Boolean wasWritten = false;
@@ -155,11 +138,6 @@ public class DebugTool {
}
}
- @Deprecated
- public static void logInfo(String msg) {
- logInfo(TAG, msg);
- }
-
public static void logInfo(String tag, String msg, Boolean bPrependVersion) {
Boolean wasWritten = false;
@@ -173,11 +151,6 @@ public class DebugTool {
}
}
- @Deprecated
- public static void logInfo(String msg, boolean bPrependVersion) {
- logInfo(TAG, msg, bPrependVersion);
- }
-
protected static Boolean logToSiphon(String msg) {
if (SiphonServer.getSiphonEnabledStatus()) {
// Initialize the SiphonServer, will be ignored if already initialized
@@ -209,7 +182,7 @@ public class DebugTool {
}
- protected static Vector<IConsole> consoleListenerList = new Vector<IConsole>();
+ protected static final Vector<IConsole> consoleListenerList = new Vector<>();
protected final static boolean isTransportEnabled = false;
protected final static boolean isRPCEnabled = false;
@@ -381,14 +354,14 @@ public class DebugTool {
} else {
message.setData(packet.getPayload());
}
- Hashtable<String, Object> hash = new Hashtable<String, Object>();
+ Hashtable<String, Object> hash = new Hashtable<>();
if (packet.getVersion() > 1) {
- Hashtable<String, Object> hashTemp = new Hashtable<String, Object>();
+ 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());
- hashTemp.put(RPCMessage.KEY_PARAMETERS, mhash);
+ final Hashtable<String, Object> mHash = JsonRPCMarshaller.unmarshall(message.getData());
+ hashTemp.put(RPCMessage.KEY_PARAMETERS, mHash);
}
String functionName = FunctionID.getFunctionName(message.getFunctionID());
diff --git a/base/src/main/java/com/smartdevicelink/util/NativeLogTool.java b/base/src/main/java/com/smartdevicelink/util/NativeLogTool.java
index b0e3217cb..7fe37ff3b 100644
--- a/base/src/main/java/com/smartdevicelink/util/NativeLogTool.java
+++ b/base/src/main/java/com/smartdevicelink/util/NativeLogTool.java
@@ -32,7 +32,7 @@
package com.smartdevicelink.util;
public class NativeLogTool {
- private static String TAG = "NativeLogTool";
+ private static final String TAG = "NativeLogTool";
static private boolean logToSystemEnabled = true;
private static final int ChunkSize = 4000;
@@ -103,19 +103,19 @@ public class NativeLogTool {
return logToSystemEnabled;
}
- private static boolean log(LogTarget ltarg, String source, String logMsg) {
+ private static boolean log(LogTarget logTarget, String source, String logMsg) {
// Don't log empty messages
if (logMsg == null || logMsg.length() == 0) {
return false;
}
- int substrSize = 0;
- String chunk = null;
+ int subStrSize = 0;
+ String chunk;
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) {
+ for (int idx=0;idx < logMsg.length();idx += subStrSize) {
+ subStrSize = Math.min(ChunkSize, logMsg.length() - idx);
+ chunk = logMsg.substring(idx, idx + subStrSize);
+ switch (logTarget) {
case Info:
Log.i(source, chunk);
break;
@@ -128,7 +128,7 @@ public class NativeLogTool {
}
}
} catch (Exception ex) {
- Log.e(TAG, "Failure writing " + ltarg.name() + " fragments to android log:" + ex.toString(), null);
+ Log.e(TAG, "Failure writing " + logTarget.name() + " fragments to android log:" + ex.toString(), null);
return false;
}
return true;
diff --git a/base/src/main/java/com/smartdevicelink/util/Version.java b/base/src/main/java/com/smartdevicelink/util/Version.java
index d25bcd6fe..6b409af9b 100644
--- a/base/src/main/java/com/smartdevicelink/util/Version.java
+++ b/base/src/main/java/com/smartdevicelink/util/Version.java
@@ -63,9 +63,9 @@ public class Version {
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]);
+ major = Integer.parseInt(versions[0]);
+ minor = Integer.parseInt(versions[1]);
+ patch = Integer.parseInt(versions[2]);
}
diff --git a/hello_sdl_java/gradle/wrapper/gradle-wrapper.jar b/hello_sdl_java/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 28861d273..000000000
--- a/hello_sdl_java/gradle/wrapper/gradle-wrapper.jar
+++ /dev/null
Binary files differ
diff --git a/hello_sdl_java/gradle/wrapper/gradle-wrapper.properties b/hello_sdl_java/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index fd6d42bd6..000000000
--- a/hello_sdl_java/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100755
index cccdd3d51..000000000
--- a/hello_sdl_java/gradlew
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/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
deleted file mode 100644
index f9553162f..000000000
--- a/hello_sdl_java/gradlew.bat
+++ /dev/null
@@ -1,84 +0,0 @@
-@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
deleted file mode 100644
index fd254fa69..000000000
--- a/hello_sdl_java/settings.gradle
+++ /dev/null
@@ -1,4 +0,0 @@
-rootProject.name = 'hello_sdl_java'
-include ":sdl_java_se"
-project (":sdl_java_se").projectDir = new File("../javaSE/")
-
diff --git a/hello_sdl_java_ee/assets b/hello_sdl_java_ee/assets
deleted file mode 120000
index 386a9bd31..000000000
--- a/hello_sdl_java_ee/assets
+++ /dev/null
@@ -1 +0,0 @@
-../hello_sdl_java/assets \ No newline at end of file
diff --git a/hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.jar b/hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 28861d273..000000000
--- a/hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.jar
+++ /dev/null
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
deleted file mode 100644
index 16f7ff6d1..000000000
--- a/hello_sdl_java_ee/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100755
index cccdd3d51..000000000
--- a/hello_sdl_java_ee/gradlew
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/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
deleted file mode 100644
index f9553162f..000000000
--- a/hello_sdl_java_ee/gradlew.bat
+++ /dev/null
@@ -1,84 +0,0 @@
-@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
deleted file mode 100644
index 8a8a05513..000000000
--- a/hello_sdl_java_ee/settings.gradle
+++ /dev/null
@@ -1,3 +0,0 @@
-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/javaEE/build.gradle b/javaEE/build.gradle
index a07678dd5..459ba7a53 100644
--- a/javaEE/build.gradle
+++ b/javaEE/build.gradle
@@ -1,80 +1,14 @@
-apply plugin: 'java-library'
+plugins {
+ id 'java'
+}
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
+ mavenCentral()
}
dependencies {
- extraLibs fileTree(dir: 'libs', include: ['*.jar'])
- extraLibs 'org.mongodb:bson:3.10.1'
- extraLibs 'androidx.annotation:annotation:1.0.0'
- extraLibs 'org.java-websocket:Java-WebSocket:1.3.9'
- extraLibs 'com.livio.taskmaster:taskmaster:0.3.0'
- 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/gradlew.bat b/javaEE/gradlew.bat
index 0f8d5937c..6d57edc70 100644
--- a/javaEE/gradlew.bat
+++ b/javaEE/gradlew.bat
@@ -1,84 +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
+@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/hello_sdl_java_ee/assets b/javaEE/hello_sdl_java_ee/assets
new file mode 120000
index 000000000..5792e5ad9
--- /dev/null
+++ b/javaEE/hello_sdl_java_ee/assets
@@ -0,0 +1 @@
+../../javaSE/hello_sdl_java/assets/ \ No newline at end of file
diff --git a/hello_sdl_java_ee/build.gradle b/javaEE/hello_sdl_java_ee/build.gradle
index 5c1b1eb70..105285adf 100644
--- a/hello_sdl_java_ee/build.gradle
+++ b/javaEE/hello_sdl_java_ee/build.gradle
@@ -20,7 +20,7 @@ configurations {
dependencies {
extraLibs fileTree(dir: 'libs', include: ['*.jar'])
//testCompile group: 'junit', name: 'junit', version: '4.12'
- extraLibs project(path: ':sdl_java_ee')
+ extraLibs project(path: ':javaEE')
configurations.implementation.extendsFrom(configurations.extraLibs)
}
diff --git a/hello_sdl_java_ee/src/main/java/com/smartdevicelink/Main.java b/javaEE/hello_sdl_java_ee/src/main/java/com/smartdevicelink/Main.java
index 8f685e984..8f685e984 100644
--- a/hello_sdl_java_ee/src/main/java/com/smartdevicelink/Main.java
+++ b/javaEE/hello_sdl_java_ee/src/main/java/com/smartdevicelink/Main.java
diff --git a/hello_sdl_java_ee/src/main/java/com/smartdevicelink/SdlService.java b/javaEE/hello_sdl_java_ee/src/main/java/com/smartdevicelink/SdlService.java
index 779c357ee..779c357ee 100644
--- a/hello_sdl_java_ee/src/main/java/com/smartdevicelink/SdlService.java
+++ b/javaEE/hello_sdl_java_ee/src/main/java/com/smartdevicelink/SdlService.java
diff --git a/javaEE/README.md b/javaEE/javaEE/README.md
index 8e7c3699d..8e7c3699d 100644
--- a/javaEE/README.md
+++ b/javaEE/javaEE/README.md
diff --git a/javaEE/bintray.gradle b/javaEE/javaEE/bintray.gradle
index 4756d4d70..f54efe333 100644
--- a/javaEE/bintray.gradle
+++ b/javaEE/javaEE/bintray.gradle
@@ -5,7 +5,7 @@ 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
def libDescription = 'SmartDeviceLink mobile library'
-def libVersion = new File(projectDir.path, ('/../VERSION')).text.trim()
+def libVersion = new File(projectDir.path, ('/../../VERSION')).text.trim()
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
diff --git a/javaEE/bintray.properties b/javaEE/javaEE/bintray.properties
index aa1926ba5..aa1926ba5 100644
--- a/javaEE/bintray.properties
+++ b/javaEE/javaEE/bintray.properties
diff --git a/javaEE/javaEE/build.gradle b/javaEE/javaEE/build.gradle
new file mode 100644
index 000000000..d2c90a1b4
--- /dev/null
+++ b/javaEE/javaEE/build.gradle
@@ -0,0 +1,81 @@
+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 {
+ testCompile group: 'junit', name: 'junit', version: '4.12'
+ extraLibs fileTree(dir: 'libs', include: ['*.jar'])
+ extraLibs 'org.mongodb:bson:4.0.5'
+ extraLibs 'androidx.annotation:annotation:1.1.0'
+ extraLibs 'org.java-websocket:Java-WebSocket:1.3.9'
+ extraLibs 'com.livio.taskmaster:taskmaster:0.3.0'
+ configurations.api.extendsFrom(configurations.extraLibs)
+}
+
+sourceSets {
+ main.java.srcDirs += '../../base/src/main/java'
+ main.java.srcDirs += '../../javaSE/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/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/javaEE/src/test/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java b/javaEE/javaEE/src/test/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java
new file mode 100644
index 000000000..91001d252
--- /dev/null
+++ b/javaEE/javaEE/src/test/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java
@@ -0,0 +1,153 @@
+/*
+ * 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 com.smartdevicelink.test.TestValues;
+
+import org.junit.Test;
+
+import static junit.framework.TestCase.assertEquals;
+import static junit.framework.TestCase.assertFalse;
+
+public class SdlFileTests {
+
+ @Test
+ public void testConstructorWithNoParams() {
+ SdlFile sdlFile;
+
+ // Case 1 (Setting data)
+ sdlFile = new SdlFile();
+ sdlFile.setFileData(TestValues.GENERAL_BYTE_ARRAY);
+ assertEquals(sdlFile.getFileData(), TestValues.GENERAL_BYTE_ARRAY);
+ sdlFile.setName(null);
+ assertEquals(sdlFile.getName(), "e9800998ecf8427e");
+ sdlFile.setName(TestValues.GENERAL_STRING);
+ assertEquals(sdlFile.getName(), TestValues.GENERAL_STRING);
+ sdlFile.setType(TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile.getType(), TestValues.GENERAL_FILETYPE);
+ sdlFile.setPersistent(TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile.getOverwrite());
+
+ // Case 2 (Setting resourceId)
+ sdlFile = new SdlFile();
+ sdlFile.setFilePath(TestValues.GENERAL_STRING);
+ assertEquals(sdlFile.getFilePath(), TestValues.GENERAL_STRING);
+ sdlFile.setName(null);
+ assertEquals(sdlFile.getName(), "cade4e832627b4f6");
+ sdlFile.setName(TestValues.GENERAL_STRING);
+ assertEquals(sdlFile.getName(), TestValues.GENERAL_STRING);
+ sdlFile.setType(TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile.getType(), TestValues.GENERAL_FILETYPE);
+ sdlFile.setPersistent(TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile.getOverwrite());
+
+ // Case 3 (Setting URI)
+ sdlFile = new SdlFile();
+ sdlFile.setURI(TestValues.GENERAL_URI);
+ assertEquals(sdlFile.getURI(), TestValues.GENERAL_URI);
+ sdlFile.setName(null);
+ assertEquals(sdlFile.getName(), "d3467db131372140");
+ sdlFile.setName(TestValues.GENERAL_STRING);
+ assertEquals(sdlFile.getName(), TestValues.GENERAL_STRING);
+ sdlFile.setType(TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile.getType(), TestValues.GENERAL_FILETYPE);
+ sdlFile.setPersistent(TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile.getOverwrite());
+ }
+
+ @Test
+ public void testConstructorWithResourceId() {
+ // Case1 (Set the name manually)
+ SdlFile sdlFile1 = new SdlFile(TestValues.GENERAL_STRING, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_STRING, TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile1.getName(), TestValues.GENERAL_STRING);
+ assertEquals(sdlFile1.getType(), TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile1.getFilePath(), TestValues.GENERAL_STRING);
+ assertEquals(sdlFile1.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile1.getOverwrite());
+
+ // Case2 (Let the library generate a name)
+ SdlFile sdlFile2 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_STRING, TestValues.GENERAL_BOOLEAN);
+ SdlFile sdlFile3 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_STRING, TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile2.getName(), sdlFile3.getName());
+ assertEquals(sdlFile2.getName(), "cade4e832627b4f6");
+ assertEquals(sdlFile2.getType(), TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile2.getFilePath(), TestValues.GENERAL_STRING);
+ assertEquals(sdlFile2.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile2.getOverwrite());
+ }
+
+ @Test
+ public void testConstructorWithData() {
+ // Case1 (Set the name manually)
+ SdlFile sdlFile1 = new SdlFile(TestValues.GENERAL_STRING, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_BYTE_ARRAY, TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile1.getName(), TestValues.GENERAL_STRING);
+ assertEquals(sdlFile1.getType(), TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile1.getFileData(), TestValues.GENERAL_BYTE_ARRAY);
+ assertEquals(sdlFile1.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile1.getOverwrite());
+
+ // Case2 (Let the library generate a name)
+ SdlFile sdlFile2 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_BYTE_ARRAY, TestValues.GENERAL_BOOLEAN);
+ SdlFile sdlFile3 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_BYTE_ARRAY, TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile2.getName(), sdlFile3.getName());
+ assertEquals(sdlFile2.getName(), "e9800998ecf8427e");
+ assertEquals(sdlFile2.getType(), TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile2.getFileData(), TestValues.GENERAL_BYTE_ARRAY);
+ assertEquals(sdlFile2.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile2.getOverwrite());
+ }
+
+ @Test
+ public void testConstructorWithUri() {
+ // Case1 (Set the name manually)
+ SdlFile sdlFile1 = new SdlFile(TestValues.GENERAL_STRING, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_URI, TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile1.getName(), TestValues.GENERAL_STRING);
+ assertEquals(sdlFile1.getType(), TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile1.getURI(), TestValues.GENERAL_URI);
+ assertEquals(sdlFile1.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile1.getOverwrite());
+
+ // Case2 (Let the library generate a name)
+ SdlFile sdlFile2 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_URI, TestValues.GENERAL_BOOLEAN);
+ SdlFile sdlFile3 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_URI, TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile2.getName(), sdlFile3.getName());
+ assertEquals(sdlFile2.getName(), "d3467db131372140");
+ assertEquals(sdlFile2.getType(), TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile2.getURI(), TestValues.GENERAL_URI);
+ assertEquals(sdlFile2.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile2.getOverwrite());
+ }
+}
diff --git a/javaEE/javaEE/src/test/java/com/smartdevicelink/test/TestValues.java b/javaEE/javaEE/src/test/java/com/smartdevicelink/test/TestValues.java
new file mode 100644
index 000000000..d3efa2326
--- /dev/null
+++ b/javaEE/javaEE/src/test/java/com/smartdevicelink/test/TestValues.java
@@ -0,0 +1,13 @@
+package com.smartdevicelink.test;
+
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+
+import java.net.URI;
+
+public class TestValues {
+ public static final boolean GENERAL_BOOLEAN = true;
+ public static final byte[] GENERAL_BYTE_ARRAY = new byte[0];
+ public static final String GENERAL_STRING = "test";
+ public static final FileType GENERAL_FILETYPE = FileType.BINARY;
+ public static final URI GENERAL_URI = URI.create("http://www.google.com");
+}
diff --git a/javaEE/settings.gradle b/javaEE/settings.gradle
index 4da4ab327..82ab998de 100644
--- a/javaEE/settings.gradle
+++ b/javaEE/settings.gradle
@@ -1 +1 @@
-rootProject.name = 'javaEE'
+include ':javaEE', ':hello_sdl_java_ee' \ No newline at end of file
diff --git a/javaSE/build.gradle b/javaSE/build.gradle
index 9e9b5596a..b4b664aee 100644
--- a/javaSE/build.gradle
+++ b/javaSE/build.gradle
@@ -1,80 +1,14 @@
-apply plugin: 'java-library'
+plugins {
+ id 'java'
+}
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'
- }
-}
+sourceCompatibility = 1.8
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
+ mavenCentral()
}
dependencies {
- extraLibs fileTree(dir: 'libs', include: ['*.jar'])
- extraLibs 'org.mongodb:bson:3.10.1'
- extraLibs 'androidx.annotation:annotation:1.0.0'
- extraLibs 'org.java-websocket:Java-WebSocket:1.3.9'
- extraLibs 'com.livio.taskmaster:taskmaster:0.3.0'
- 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/gradlew.bat b/javaSE/gradlew.bat
index 0f8d5937c..6d57edc70 100644
--- a/javaSE/gradlew.bat
+++ b/javaSE/gradlew.bat
@@ -1,84 +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
+@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/hello_sdl_java/assets/images/sdl.png b/javaSE/hello_sdl_java/assets/images/sdl.png
index 5cfc0f84a..5cfc0f84a 100755
--- a/hello_sdl_java/assets/images/sdl.png
+++ b/javaSE/hello_sdl_java/assets/images/sdl.png
Binary files differ
diff --git a/hello_sdl_java/assets/images/sdl_s_green.png b/javaSE/hello_sdl_java/assets/images/sdl_s_green.png
index c43021775..c43021775 100755
--- a/hello_sdl_java/assets/images/sdl_s_green.png
+++ b/javaSE/hello_sdl_java/assets/images/sdl_s_green.png
Binary files differ
diff --git a/hello_sdl_java/build.gradle b/javaSE/hello_sdl_java/build.gradle
index b4f834b43..996affcd0 100644
--- a/hello_sdl_java/build.gradle
+++ b/javaSE/hello_sdl_java/build.gradle
@@ -19,10 +19,8 @@ configurations {
}
dependencies {
extraLibs fileTree(dir: 'libs', include: ['*.jar'])
- //testCompile group: 'junit', name: 'junit', version: '4.12'
- extraLibs project(path: ':sdl_java_se')
+ extraLibs project(path: ':javaSE')
configurations.implementation.extendsFrom(configurations.extraLibs)
-
}
jar {
from {
diff --git a/hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java b/javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java
index dc1ce2457..0f67efe0b 100644
--- a/hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java
+++ b/javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/Main.java
@@ -37,17 +37,17 @@ import com.smartdevicelink.util.DebugTool;
public class Main {
private static final String TAG = "Main";
- static Thread thread = null, mainThread;
- static Object LOCK;
+ private static Thread thread = null;
+ private static Thread mainThread;
+ private static final Object LOCK = new Object();
- static SdlService sdlService;
+ private static SdlService sdlService;
public static void main(String[] args) {
//Enable DebugTool
DebugTool.enableDebugTool();
mainThread = Thread.currentThread();
- LOCK = new Object();
startSdlService();
while(!mainThread.isInterrupted()) {
@@ -68,7 +68,7 @@ public class Main {
}
}
- static SdlService.SdlServiceCallback serviceCallback = new SdlService.SdlServiceCallback() {
+ private static final SdlService.SdlServiceCallback serviceCallback = new SdlService.SdlServiceCallback() {
@Override
public void onEnd() {
if (thread != null) {
diff --git a/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java b/javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java
index 0c1b87c6a..a9d81b766 100644
--- a/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java
+++ b/javaSE/hello_sdl_java/src/main/java/com/smartdevicelink/java/SdlService.java
@@ -33,11 +33,11 @@
package com.smartdevicelink.java;
import com.smartdevicelink.managers.CompletionListener;
-import com.smartdevicelink.managers.screen.OnButtonListener;
import com.smartdevicelink.managers.SdlManager;
import com.smartdevicelink.managers.SdlManagerListener;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
import com.smartdevicelink.managers.lifecycle.LifecycleConfigurationUpdate;
+import com.smartdevicelink.managers.screen.OnButtonListener;
import com.smartdevicelink.managers.screen.choiceset.ChoiceCell;
import com.smartdevicelink.managers.screen.choiceset.ChoiceSet;
import com.smartdevicelink.managers.screen.choiceset.ChoiceSetSelectionListener;
@@ -47,7 +47,6 @@ import com.smartdevicelink.managers.screen.menu.VoiceCommand;
import com.smartdevicelink.managers.screen.menu.VoiceCommandSelectionListener;
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.*;
import com.smartdevicelink.proxy.rpc.listeners.OnRPCNotificationListener;
@@ -74,13 +73,13 @@ public class SdlService {
private static final String TEST_COMMAND_NAME = "Test Command";
- private static final String IMAGE_DIR = "assets/images/";
+ private static final String IMAGE_DIR = "hello_sdl_java/assets/images/";
// variable to create and call functions of the SyncProxy
private SdlManager sdlManager = null;
private List<ChoiceCell> choiceCellList;
- private SdlServiceCallback callback;
+ private final SdlServiceCallback callback;
public SdlService(BaseTransportConfig config, SdlServiceCallback callback){
this.callback = callback;
@@ -136,11 +135,6 @@ public class SdlService {
}
@Override
- public LifecycleConfigurationUpdate managerShouldUpdateLifecycle(Language language) {
- return null;
- }
-
- @Override
public LifecycleConfigurationUpdate managerShouldUpdateLifecycle(Language language, Language hmiLanguage) {
boolean isNeedUpdate = false;
String appName = APP_NAME;
@@ -170,7 +164,8 @@ public class SdlService {
break;
}
if (isNeedUpdate) {
- return new LifecycleConfigurationUpdate(appName, null, TTSChunkFactory.createSimpleTTSChunks(ttsName), null);
+ Vector<TTSChunk> chunks = new Vector<>(Collections.singletonList(new TTSChunk(ttsName, SpeechCapabilities.TEXT)));
+ return new LifecycleConfigurationUpdate(appName, null, chunks, null);
} else {
return null;
}
@@ -178,7 +173,7 @@ public class SdlService {
};
- HashMap<FunctionID,OnRPCNotificationListener> notificationListenerHashMap = new HashMap<FunctionID,OnRPCNotificationListener>();
+ HashMap<FunctionID,OnRPCNotificationListener> notificationListenerHashMap = new HashMap<>();
notificationListenerHashMap.put(FunctionID.ON_HMI_STATUS, new OnRPCNotificationListener() {
@Override
public void onNotified(RPCNotification notification) {
@@ -302,7 +297,8 @@ public class SdlService {
* Will speak a sample welcome message
*/
private void performWelcomeSpeak(){
- sdlManager.sendRPC(new Speak(TTSChunkFactory.createSimpleTTSChunks(WELCOME_SPEAK)));
+ List<TTSChunk> chunks = Collections.singletonList(new TTSChunk(WELCOME_SPEAK, SpeechCapabilities.TEXT));
+ sdlManager.sendRPC(new Speak(chunks));
}
/**
@@ -365,7 +361,8 @@ public class SdlService {
sdlManager.getScreenManager().setTextField2("");
sdlManager.getScreenManager().commit(null);
- sdlManager.sendRPC(new Speak(TTSChunkFactory.createSimpleTTSChunks(TEST_COMMAND_NAME)));
+ List<TTSChunk> chunks = Collections.singletonList(new TTSChunk(TEST_COMMAND_NAME, SpeechCapabilities.TEXT));
+ sdlManager.sendRPC(new Speak(chunks));
}
private void showAlert(String text){
diff --git a/javaSE/README.md b/javaSE/javaSE/README.md
index e40e9ca4a..e40e9ca4a 100644
--- a/javaSE/README.md
+++ b/javaSE/javaSE/README.md
diff --git a/javaSE/bintray.gradle b/javaSE/javaSE/bintray.gradle
index 49ab4761a..d40cb0e28 100644
--- a/javaSE/bintray.gradle
+++ b/javaSE/javaSE/bintray.gradle
@@ -5,7 +5,7 @@ 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
def libDescription = 'SmartDeviceLink mobile library'
-def libVersion = new File(projectDir.path, ('/../VERSION')).text.trim()
+def libVersion = new File(projectDir.path, ('/../../VERSION')).text.trim()
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
diff --git a/javaSE/bintray.properties b/javaSE/javaSE/bintray.properties
index b491c7774..b491c7774 100644
--- a/javaSE/bintray.properties
+++ b/javaSE/javaSE/bintray.properties
diff --git a/javaSE/javaSE/build.gradle b/javaSE/javaSE/build.gradle
new file mode 100644
index 000000000..1390cd913
--- /dev/null
+++ b/javaSE/javaSE/build.gradle
@@ -0,0 +1,81 @@
+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 {
+ testCompile group: 'junit', name: 'junit', version: '4.12'
+ extraLibs fileTree(dir: 'libs', include: ['*.jar'])
+ extraLibs 'org.mongodb:bson:4.0.5'
+ extraLibs 'androidx.annotation:annotation:1.1.0'
+ extraLibs 'org.java-websocket:Java-WebSocket:1.3.9'
+ extraLibs 'com.livio.taskmaster:taskmaster:0.3.0'
+ 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/src/main/java/com/livio/BSON/BsonEncoder.java b/javaSE/javaSE/src/main/java/com/livio/BSON/BsonEncoder.java
index 22c47f6cb..30037bad6 100644
--- a/javaSE/src/main/java/com/livio/BSON/BsonEncoder.java
+++ b/javaSE/javaSE/src/main/java/com/livio/BSON/BsonEncoder.java
@@ -32,9 +32,16 @@
package com.livio.BSON;
import com.smartdevicelink.util.DebugTool;
-import org.bson.*;
-import java.util.*;
+import org.bson.BSONObject;
+import org.bson.BasicBSONDecoder;
+import org.bson.BasicBSONEncoder;
+import org.bson.BasicBSONObject;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
public class BsonEncoder {
private static final String TAG = "BsonEncoder";
@@ -68,7 +75,7 @@ public class BsonEncoder {
}
/**
- * Goes thorugh the map and ensures that all the values included are supported by SDL. If they are not of a supported
+ * Goes through 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
diff --git a/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java
index ecd7b1f9b..ecd7b1f9b 100644
--- a/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/BuildConfig.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java
index 4dae813f6..09a495355 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/SdlManager.java
@@ -33,12 +33,10 @@
package com.smartdevicelink.managers;
import androidx.annotation.NonNull;
-import com.smartdevicelink.util.Log;
import com.smartdevicelink.managers.file.FileManager;
import com.smartdevicelink.managers.permission.PermissionManager;
import com.smartdevicelink.managers.screen.ScreenManager;
-import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
import com.smartdevicelink.transport.enums.TransportType;
import com.smartdevicelink.util.DebugTool;
@@ -129,9 +127,9 @@ public class SdlManager extends BaseSdlManager {
private void notifyDevListener(String info) {
if (managerListener != null) {
if (getState() == BaseSubManager.ERROR) {
- managerListener.onError((SdlManager) this, info, null);
+ managerListener.onError(this, info, null);
} else {
- managerListener.onStart((SdlManager) this);
+ managerListener.onStart(this);
}
}
}
@@ -160,7 +158,7 @@ public class SdlManager extends BaseSdlManager {
}
if (managerListener != null) {
- managerListener.onDestroy((SdlManager) this);
+ managerListener.onDestroy(this);
managerListener = null;
}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
index 8118a9c93..43aad3161 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/SdlManagerListener.java
@@ -60,21 +60,6 @@ public interface SdlManagerListener extends BaseSdlManagerListener {
* of LifecycleConfigurationUpdate, otherwise it should return null to indicate that the language
* is not supported.
*
- * @param language The language of the connected head unit the manager is trying to update the configuration.
- * @return An object of LifecycleConfigurationUpdate if the head unit language is supported,
- * otherwise null to indicate that the language is not supported.
- * @deprecated use {@link #managerShouldUpdateLifecycle(Language language, Language hmiLanguage)} instead
- */
- @Deprecated
- LifecycleConfigurationUpdate managerShouldUpdateLifecycle(Language language);
-
- /**
- * Called when the SDL manager detected a language mismatch. In case of a language mismatch the
- * manager should change the apps registration by updating the lifecycle configuration to the
- * specified language. If the app can support the specified language it should return an Object
- * of LifecycleConfigurationUpdate, otherwise it should return null to indicate that the language
- * is not supported.
- *
* @param language The VR+TTS language of the connected head unit the manager is trying to update the configuration.
* @param hmiLanguage The HMI display language of the connected head unit the manager is trying to update the configuration.
* @return An object of LifecycleConfigurationUpdate if the head unit language is supported,
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java
index 959a9ced5..a84f0a7c7 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/FileManager.java
@@ -33,11 +33,18 @@ package com.smartdevicelink.managers.file;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.managers.file.filetypes.SdlFile;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.PutFile;
+import com.smartdevicelink.util.DebugTool;
import com.smartdevicelink.util.FileUtls;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+
/**
* <strong>FileManager</strong> <br>
*
@@ -55,18 +62,12 @@ import com.smartdevicelink.util.FileUtls;
*/
public class FileManager extends BaseFileManager {
- @Deprecated
- public FileManager(ISdl internalInterface) {
-
- // setup
- super(internalInterface);
- }
-
/**
* Constructor for FileManager
* @param internalInterface an instance of the ISdl interface that can be used for common SDL operations (sendRpc, addRpcListener, etc)
* @param fileManagerConfig an instance of the FileManagerConfig gives access to artworkRetryCount and fileRetryCount to let us if those file types can be re-upload if they fail
*/
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public FileManager(ISdl internalInterface, FileManagerConfig fileManagerConfig) {
// setup
super(internalInterface, fileManagerConfig);
@@ -94,6 +95,14 @@ public class FileManager extends BaseFileManager {
}else{
throw new IllegalArgumentException("File at path was empty");
}
+ }else if(file.getURI() != null){
+ // Use URI to upload file
+ byte[] data = contentsOfUri(file.getURI());
+ if(data != null){
+ putFile.setFileData(data);
+ }else{
+ throw new IllegalArgumentException("Uri was empty");
+ }
}else if(file.getFileData() != null){
// Use file data (raw bytes) to upload file
putFile.setFileData(file.getFileData());
@@ -110,4 +119,28 @@ public class FileManager extends BaseFileManager {
return putFile;
}
+
+ /**
+ * 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 = uri.toURL().openStream();
+ return contentsOfInputStream(is);
+ } catch (IOException e){
+ DebugTool.logError(TAG, "Can't read from URI", e);
+ return null;
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java
index 69bfb9238..eee60bd69 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlArtwork.java
@@ -32,12 +32,15 @@
package com.smartdevicelink.managers.file.filetypes;
import androidx.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;
import com.smartdevicelink.util.DebugTool;
+import java.net.URI;
+
/**
* A class that extends SdlFile, representing artwork (JPEG, PNG, or BMP) to be uploaded to core
*/
@@ -65,6 +68,17 @@ public class SdlArtwork extends SdlFile implements Cloneable{
* 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. You can pass null if you want the library to auto generate the name
* @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(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. You can pass null if you want the library to auto generate the name
+ * @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
*/
@@ -98,7 +112,7 @@ public class SdlArtwork extends SdlFile implements Cloneable{
@Override
- public void setType(FileType fileType) {
+ public void setType(@NonNull FileType fileType) {
if(fileType == null || fileType.equals(FileType.GRAPHIC_JPEG) || fileType.equals(FileType.GRAPHIC_PNG)
|| fileType.equals(FileType.GRAPHIC_BMP)){
super.setType(fileType);
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java
index 60b3f42e9..10e400f40 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/file/filetypes/SdlFile.java
@@ -36,8 +36,10 @@ import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.rpc.enums.FileType;
import com.smartdevicelink.proxy.rpc.enums.StaticIconName;
+import java.net.URI;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
+import java.util.Arrays;
/**
* A class representing data to be uploaded to core
@@ -45,13 +47,14 @@ import java.security.NoSuchAlgorithmException;
public class SdlFile{
private String fileName;
private String filePath;
+ private URI uri;
private byte[] fileData;
private FileType fileType;
private boolean persistentFile;
private boolean isStaticIcon;
private boolean shouldAutoGenerateName;
// Overwrite property by default is set to true in SdlFile constructors indicating that a file can be overwritten
- private boolean overwrite = true;
+ private boolean overwrite = false;
/**
* Creates a new instance of SdlFile
@@ -76,6 +79,20 @@ public class 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. You can pass null if you want the library to auto generate the name
* @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(String fileName, @NonNull FileType fileType, URI uri, boolean persistentFile){
+ setName(fileName);
+ setType(fileType);
+ setURI(uri);
+ setPersistent(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. You can pass null if you want the library to auto generate the name
+ * @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
*/
@@ -109,6 +126,8 @@ public class SdlFile{
this.shouldAutoGenerateName = true;
if (this.getFileData() != null) {
this.fileName = generateFileNameFromData(this.getFileData());
+ } else if (this.getURI() != null) {
+ this.fileName = generateFileNameFromUri(this.getURI());
} else if (this.getFilePath() != null) {
this.fileName = generateFileNameFromFilePath(this.getFilePath());
}
@@ -136,13 +155,32 @@ public class SdlFile{
/**
* Gets the location of the file
- * @return
+ * @return represents the path of the file
*/
public String getFilePath(){
return this.filePath;
}
/**
+ * 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;
+ if (shouldAutoGenerateName && uri != null) {
+ this.fileName = generateFileNameFromUri(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
*/
@@ -262,6 +300,15 @@ public class SdlFile{
}
/**
+ * Generates a file name from uri by hashing the uri string and returning the last 16 chars
+ * @param uri a URI value representing a file's location
+ * @return a String value representing the name that will be used to store the file in the head unit
+ */
+ private String generateFileNameFromUri(@NonNull URI uri) {
+ return generateFileNameFromData(uri.toString().getBytes());
+ }
+
+ /**
* Used to compile hashcode for SdlFile for use to compare in equals method
* @return Custom hashcode of SdlFile variables
*/
@@ -269,11 +316,12 @@ public class SdlFile{
public int hashCode() {
int result = 1;
result += ((getName() == null) ? 0 : Integer.rotateLeft(getName().hashCode(), 1));
- result += ((getFilePath() == null) ? 0 : Integer.rotateLeft(getFilePath().hashCode(), 2));
- result += ((getFileData() == null) ? 0 : Integer.rotateLeft(getFileData().hashCode(), 3));
- result += ((getType() == null) ? 0 : Integer.rotateLeft(getType().hashCode(), 4));
- result += Integer.rotateLeft(Boolean.valueOf(isStaticIcon()).hashCode(), 5);
- result += Integer.rotateLeft(Boolean.valueOf(isPersistent()).hashCode(), 6);
+ result += ((getURI() == null) ? 0 : Integer.rotateLeft(getURI().hashCode(), 2));
+ result += ((getFilePath() == null) ? 0 : Integer.rotateLeft(getFilePath().hashCode(), 3));
+ result += ((getFileData() == null) ? 0 : Integer.rotateLeft(Arrays.hashCode(getFileData()), 4));
+ result += ((getType() == null) ? 0 : Integer.rotateLeft(getType().hashCode(), 5));
+ result += Integer.rotateLeft(Boolean.valueOf(isStaticIcon()).hashCode(), 6);
+ result += Integer.rotateLeft(Boolean.valueOf(isPersistent()).hashCode(), 7);
return result;
}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java
index eda411dc5..d749811a1 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/EncryptionLifecycleManager.java
@@ -35,7 +35,7 @@ package com.smartdevicelink.managers.lifecycle;
import androidx.annotation.NonNull;
import com.smartdevicelink.managers.ServiceEncryptionListener;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
class EncryptionLifecycleManager extends BaseEncryptionLifecycleManager {
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java
index b7167b81c..89c9f3190 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java
@@ -34,7 +34,7 @@ package com.smartdevicelink.managers.lifecycle;
import androidx.annotation.RestrictTo;
-import com.smartdevicelink.SdlConnection.SdlSession;
+import com.smartdevicelink.session.SdlSession;
import com.smartdevicelink.exception.SdlException;
import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason;
import com.smartdevicelink.transport.BaseTransportConfig;
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java
index e4e635883..e10693770 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManager.java
@@ -31,7 +31,7 @@
*/
package com.smartdevicelink.managers.lifecycle;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
/**
* <strong>SystemCapabilityManager</strong> <br>
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
index 2918e0161..141e16151 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
@@ -32,7 +32,9 @@
package com.smartdevicelink.managers.permission;
import androidx.annotation.NonNull;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import androidx.annotation.RestrictTo;
+
+import com.smartdevicelink.managers.ISdl;
/**
PermissionManager gives the developer information about what permissions are permitted in specific HMI level
@@ -49,6 +51,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl;
*
* @param internalInterface an instance of the FileManager so that button graphics can be sent
*/
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
public PermissionManager(@NonNull ISdl internalInterface) {
super(internalInterface);
}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java
index 38e17d0dc..d1f6811ac 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java
@@ -32,8 +32,10 @@
package com.smartdevicelink.managers.screen;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
/**
* <strong>ScreenManager</strong> <br>
@@ -42,6 +44,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl;
*/
public class ScreenManager extends BaseScreenManager {
+ @RestrictTo(RestrictTo.Scope.LIBRARY)
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/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java
index 0b95d1aa5..7f67faa47 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java
@@ -32,14 +32,17 @@
package com.smartdevicelink.managers.screen;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.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>
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
class SoftButtonManager extends BaseSoftButtonManager {
/**
diff --git a/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java
new file mode 100644
index 000000000..b14ad987c
--- /dev/null
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java
@@ -0,0 +1,20 @@
+package com.smartdevicelink.managers.screen;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+
+import com.smartdevicelink.managers.ISdl;
+
+/**
+ * <strong>SubscribeButtonManager</strong> <br>
+ *
+ * Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
+ *
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY)
+public class SubscribeButtonManager extends BaseSubscribeButtonManager {
+
+ public SubscribeButtonManager(@NonNull ISdl internalInterface) {
+ super(internalInterface);
+ }
+}
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java
index 961e9e196..d5ff0f52f 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java
@@ -32,9 +32,11 @@
package com.smartdevicelink.managers.screen;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.managers.file.FileManager;
import com.smartdevicelink.managers.file.filetypes.SdlArtwork;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
import com.smartdevicelink.proxy.rpc.enums.FileType;
/**
@@ -43,12 +45,13 @@ import com.smartdevicelink.proxy.rpc.enums.FileType;
* Note: This class must be accessed through the SdlManager. Do not instantiate it by itself. <br>
*
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
class TextAndGraphicManager extends BaseTextAndGraphicManager {
- TextAndGraphicManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager, @NonNull SoftButtonManager softButtonManager) {
+ TextAndGraphicManager(@NonNull ISdl internalInterface, @NonNull FileManager fileManager, @NonNull SoftButtonManager softButtonManager) {
super(internalInterface, fileManager, softButtonManager);
}
-
+
@Override
SdlArtwork getBlankArtwork(){
if (blankArtwork == null){
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java
index 804054373..ebcfa9c10 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java
@@ -33,14 +33,17 @@
package com.smartdevicelink.managers.screen.choiceset;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
/**
* <strong>ChoiceSetManager</strong> <br>
* ChoiceSetManager gives the developer the ability to control how soft choice sets are displayed on the head unit.<br>
* Note: This class must be accessed through the SdlManager->ScreenManager. Do not instantiate it by itself.<br>
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class ChoiceSetManager extends BaseChoiceSetManager {
/**
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java
index 4a28a2792..6a51ddd65 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java
@@ -32,8 +32,10 @@
package com.smartdevicelink.managers.screen.menu;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.managers.file.FileManager;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import com.smartdevicelink.managers.ISdl;
/**
* <strong>MenuManager</strong> <br>
@@ -42,6 +44,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl;
*
* The MenuManager takes MenuCell objects and creates and sends all necessary RPCs to build out a menu
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class MenuManager extends BaseMenuManager {
public MenuManager(ISdl internalInterface, FileManager fileManager) {
diff --git a/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java
index a892d3a2c..641ab189e 100644
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java
@@ -32,7 +32,9 @@
package com.smartdevicelink.managers.screen.menu;
-import com.smartdevicelink.proxy.interfaces.ISdl;
+import androidx.annotation.RestrictTo;
+
+import com.smartdevicelink.managers.ISdl;
/**
* <strong>VoiceCommandManager</strong> <br>
@@ -41,6 +43,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl;
*
* The VoiceCommandManager takes a List of VoiceCommand objects and sets them on the Head unit for you.
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class VoiceCommandManager extends BaseVoiceCommandManager {
public VoiceCommandManager(ISdl internalInterface) {
diff --git a/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
index d9a14b6f7..0c9481c2d 100644
--- a/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlPacket.java
@@ -31,9 +31,9 @@
*/
package com.smartdevicelink.protocol;
-import android.os.Parcel;
-import android.os.Parcelable;
+import androidx.annotation.RestrictTo;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class SdlPacket extends BaseSdlPacket {
public SdlPacket(int version, boolean encryption, int frameType,
@@ -55,28 +55,4 @@ public class SdlPacket extends BaseSdlPacket {
protected SdlPacket(BaseSdlPacket packet) {
super(packet);
}
-
- @Deprecated
- public SdlPacket(Parcel p){}
-
- @Deprecated
- public int describeContents() {
- return 0;
- }
-
- @Deprecated
- public void writeToParcel(Parcel dest, int flags) {}
-
- @Deprecated
- 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];
- }
-
- };
}
diff --git a/javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
index 67ea25cc1..64cd728ca 100644
--- a/javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java
@@ -33,13 +33,15 @@
package com.smartdevicelink.protocol;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.transport.BaseTransportConfig;
import com.smartdevicelink.transport.TransportManager;
@SuppressWarnings("WeakerAccess")
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class SdlProtocol extends SdlProtocolBase {
- private static final String TAG ="SdlProtocol";
public SdlProtocol( ISdlProtocol iSdlProtocol, BaseTransportConfig config) {
super(iSdlProtocol, config);
diff --git a/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
index f65f98720..e8ed85b70 100644
--- a/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/security/SdlSecurityBase.java
@@ -29,8 +29,8 @@
* 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 {
-
-}
+package com.smartdevicelink.security;
+
+public abstract class SdlSecurityBase extends AbstractSdlSecurityBase {
+
+}
diff --git a/javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/session/SdlSession.java
index 542ff6b35..4aaef8985 100644
--- a/javaSE/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/session/SdlSession.java
@@ -30,20 +30,23 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-package com.smartdevicelink.SdlConnection;
+package com.smartdevicelink.session;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.protocol.SdlPacket;
import com.smartdevicelink.protocol.SdlProtocol;
import com.smartdevicelink.protocol.SdlProtocolBase;
import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.interfaces.ISdlServiceListener;
+import com.smartdevicelink.protocol.ISdlServiceListener;
import com.smartdevicelink.transport.BaseTransportConfig;
import com.smartdevicelink.util.DebugTool;
import com.smartdevicelink.util.Version;
import java.util.concurrent.CopyOnWriteArrayList;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class SdlSession extends BaseSdlSession {
private static final String TAG = "SdlSession";
diff --git a/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java
index 482b4a846..482b4a846 100644
--- a/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/trace/SdlTrace.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java
index ad02f96d2..ad02f96d2 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransport.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java
index af0613aa1..af0613aa1 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/CustomTransportConfig.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java
index 551ed9d29..551ed9d29 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportCallback.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java
index 989b2df33..989b2df33 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportInterface.java
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java
index c8a07a1cc..ee08f19de 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/TransportManager.java
@@ -41,7 +41,6 @@ import com.smartdevicelink.util.DebugTool;
import java.util.Collections;
import java.util.List;
-@SuppressWarnings("unused")
public class TransportManager extends TransportManagerBase{
private static final String TAG = "TransportManager";
@@ -85,12 +84,6 @@ public class TransportManager extends TransportManagerBase{
}
}
- @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
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java
index 8f5411ce0..65037f6b8 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServer.java
@@ -37,6 +37,7 @@ 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;
@@ -46,8 +47,8 @@ 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;
+ final TransportCallback callback;
+ final WebSocketServerConfig config;
WebSocket webSocket;
SdlPsm psm;
@@ -87,7 +88,7 @@ public class WebSocketServer extends org.java_websocket.server.WebSocketServer i
@Override
public void write(SdlPacket packet){
- //DebugTool.logInfo(TAG, "Atttempt to write packet " + packet);
+ //DebugTool.logInfo(TAG, "Attempt to write packet " + packet);
if(packet != null
&& this.webSocket != null
&& this.webSocket.isOpen()) {
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java
index 6add5ae71..316375bf3 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/WebSocketServerConfig.java
@@ -39,14 +39,13 @@ public class WebSocketServerConfig extends BaseTransportConfig{
final int port, connectionLostTimeout;
SSLConfig sslConfig;
/**
- * Default constructor for WebsocketConfig
+ * 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.
+ * 0 is used, then the web socket will wait indefinitely.
*/
public WebSocketServerConfig(int port, int connectionLostTimeout){
this.port = port;
- this.shareConnection = false;
this.connectionLostTimeout = connectionLostTimeout;
}
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java
index d46e8aac6..e2eb1c2b0 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLConfig.java
@@ -34,9 +34,9 @@ package com.smartdevicelink.transport.utl;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
+import java.io.File;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-import java.io.File;
public class SSLConfig {
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java
index 95d0ceac2..4bcb9ca8d 100644
--- a/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/SSLWebSocketFactoryGenerator.java
@@ -32,14 +32,10 @@
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;
@@ -54,6 +50,12 @@ import java.security.interfaces.RSAPrivateKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
+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;
+
public class SSLWebSocketFactoryGenerator {
private static final String TAG = "SSLWebSocketFactoryGenerator";
private static final String JAVA_KEY_STORE = "JKS";
@@ -61,7 +63,7 @@ public class SSLWebSocketFactoryGenerator {
private static final String SUNX509 = "SunX509";
public static WebSocketServerFactory generateWebSocketServer(SSLConfig config){
- SSLContext context = null;
+ SSLContext context;
switch (config.getSslCertificateType()){
case SSLConfig.JKS:
context = getSSLContextFromJKS(config);
@@ -95,7 +97,7 @@ public class SSLWebSocketFactoryGenerator {
TrustManagerFactory tmf = TrustManagerFactory.getInstance(SUNX509);
tmf.init(ks);
- SSLContext sslContext = null;
+ SSLContext sslContext;
sslContext = SSLContext.getInstance(TLS);
sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
return sslContext;
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
index ad43c40f5..d8155c2fd 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
@@ -14,7 +14,7 @@
* distribution.
*
* Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
+ * contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
@@ -29,20 +29,13 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-package com.smartdevicelink.util;
+package com.smartdevicelink.transport.utl;
-import android.graphics.Bitmap;
+import com.smartdevicelink.transport.enums.TransportType;
-import java.io.IOException;
+public class TransportRecord extends BaseTransportRecord {
-/**
- * @see AndroidTools
- */
-@Deprecated
-public class HttpUtils{
-
- public static Bitmap downloadImage(String urlStr) throws IOException{
- return AndroidTools.downloadImage(urlStr);
+ public TransportRecord(TransportType transportType, String address) {
+ super(transportType, address);
}
-
}
diff --git a/javaSE/src/main/java/com/smartdevicelink/util/Log.java b/javaSE/javaSE/src/main/java/com/smartdevicelink/util/Log.java
index 2de00692c..2de00692c 100644
--- a/javaSE/src/main/java/com/smartdevicelink/util/Log.java
+++ b/javaSE/javaSE/src/main/java/com/smartdevicelink/util/Log.java
diff --git a/javaSE/src/main/java/org/json/JSON.java b/javaSE/javaSE/src/main/java/org/json/JSON.java
index 1b32e698d..1b32e698d 100644
--- a/javaSE/src/main/java/org/json/JSON.java
+++ b/javaSE/javaSE/src/main/java/org/json/JSON.java
diff --git a/javaSE/src/main/java/org/json/JSONArray.java b/javaSE/javaSE/src/main/java/org/json/JSONArray.java
index 996f44909..996f44909 100644
--- a/javaSE/src/main/java/org/json/JSONArray.java
+++ b/javaSE/javaSE/src/main/java/org/json/JSONArray.java
diff --git a/javaSE/src/main/java/org/json/JSONException.java b/javaSE/javaSE/src/main/java/org/json/JSONException.java
index 05e1dddc9..05e1dddc9 100644
--- a/javaSE/src/main/java/org/json/JSONException.java
+++ b/javaSE/javaSE/src/main/java/org/json/JSONException.java
diff --git a/javaSE/src/main/java/org/json/JSONObject.java b/javaSE/javaSE/src/main/java/org/json/JSONObject.java
index 74ea973c2..74ea973c2 100644
--- a/javaSE/src/main/java/org/json/JSONObject.java
+++ b/javaSE/javaSE/src/main/java/org/json/JSONObject.java
diff --git a/javaSE/src/main/java/org/json/JSONStringer.java b/javaSE/javaSE/src/main/java/org/json/JSONStringer.java
index dd3b2a7d8..dd3b2a7d8 100644
--- a/javaSE/src/main/java/org/json/JSONStringer.java
+++ b/javaSE/javaSE/src/main/java/org/json/JSONStringer.java
diff --git a/javaSE/src/main/java/org/json/JSONTokener.java b/javaSE/javaSE/src/main/java/org/json/JSONTokener.java
index 4bdd9ad37..4bdd9ad37 100644
--- a/javaSE/src/main/java/org/json/JSONTokener.java
+++ b/javaSE/javaSE/src/main/java/org/json/JSONTokener.java
diff --git a/javaSE/javaSE/src/test/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java b/javaSE/javaSE/src/test/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java
new file mode 100644
index 000000000..91001d252
--- /dev/null
+++ b/javaSE/javaSE/src/test/java/com/smartdevicelink/managers/file/filetypes/SdlFileTests.java
@@ -0,0 +1,153 @@
+/*
+ * 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 com.smartdevicelink.test.TestValues;
+
+import org.junit.Test;
+
+import static junit.framework.TestCase.assertEquals;
+import static junit.framework.TestCase.assertFalse;
+
+public class SdlFileTests {
+
+ @Test
+ public void testConstructorWithNoParams() {
+ SdlFile sdlFile;
+
+ // Case 1 (Setting data)
+ sdlFile = new SdlFile();
+ sdlFile.setFileData(TestValues.GENERAL_BYTE_ARRAY);
+ assertEquals(sdlFile.getFileData(), TestValues.GENERAL_BYTE_ARRAY);
+ sdlFile.setName(null);
+ assertEquals(sdlFile.getName(), "e9800998ecf8427e");
+ sdlFile.setName(TestValues.GENERAL_STRING);
+ assertEquals(sdlFile.getName(), TestValues.GENERAL_STRING);
+ sdlFile.setType(TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile.getType(), TestValues.GENERAL_FILETYPE);
+ sdlFile.setPersistent(TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile.getOverwrite());
+
+ // Case 2 (Setting resourceId)
+ sdlFile = new SdlFile();
+ sdlFile.setFilePath(TestValues.GENERAL_STRING);
+ assertEquals(sdlFile.getFilePath(), TestValues.GENERAL_STRING);
+ sdlFile.setName(null);
+ assertEquals(sdlFile.getName(), "cade4e832627b4f6");
+ sdlFile.setName(TestValues.GENERAL_STRING);
+ assertEquals(sdlFile.getName(), TestValues.GENERAL_STRING);
+ sdlFile.setType(TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile.getType(), TestValues.GENERAL_FILETYPE);
+ sdlFile.setPersistent(TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile.getOverwrite());
+
+ // Case 3 (Setting URI)
+ sdlFile = new SdlFile();
+ sdlFile.setURI(TestValues.GENERAL_URI);
+ assertEquals(sdlFile.getURI(), TestValues.GENERAL_URI);
+ sdlFile.setName(null);
+ assertEquals(sdlFile.getName(), "d3467db131372140");
+ sdlFile.setName(TestValues.GENERAL_STRING);
+ assertEquals(sdlFile.getName(), TestValues.GENERAL_STRING);
+ sdlFile.setType(TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile.getType(), TestValues.GENERAL_FILETYPE);
+ sdlFile.setPersistent(TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile.getOverwrite());
+ }
+
+ @Test
+ public void testConstructorWithResourceId() {
+ // Case1 (Set the name manually)
+ SdlFile sdlFile1 = new SdlFile(TestValues.GENERAL_STRING, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_STRING, TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile1.getName(), TestValues.GENERAL_STRING);
+ assertEquals(sdlFile1.getType(), TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile1.getFilePath(), TestValues.GENERAL_STRING);
+ assertEquals(sdlFile1.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile1.getOverwrite());
+
+ // Case2 (Let the library generate a name)
+ SdlFile sdlFile2 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_STRING, TestValues.GENERAL_BOOLEAN);
+ SdlFile sdlFile3 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_STRING, TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile2.getName(), sdlFile3.getName());
+ assertEquals(sdlFile2.getName(), "cade4e832627b4f6");
+ assertEquals(sdlFile2.getType(), TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile2.getFilePath(), TestValues.GENERAL_STRING);
+ assertEquals(sdlFile2.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile2.getOverwrite());
+ }
+
+ @Test
+ public void testConstructorWithData() {
+ // Case1 (Set the name manually)
+ SdlFile sdlFile1 = new SdlFile(TestValues.GENERAL_STRING, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_BYTE_ARRAY, TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile1.getName(), TestValues.GENERAL_STRING);
+ assertEquals(sdlFile1.getType(), TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile1.getFileData(), TestValues.GENERAL_BYTE_ARRAY);
+ assertEquals(sdlFile1.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile1.getOverwrite());
+
+ // Case2 (Let the library generate a name)
+ SdlFile sdlFile2 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_BYTE_ARRAY, TestValues.GENERAL_BOOLEAN);
+ SdlFile sdlFile3 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_BYTE_ARRAY, TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile2.getName(), sdlFile3.getName());
+ assertEquals(sdlFile2.getName(), "e9800998ecf8427e");
+ assertEquals(sdlFile2.getType(), TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile2.getFileData(), TestValues.GENERAL_BYTE_ARRAY);
+ assertEquals(sdlFile2.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile2.getOverwrite());
+ }
+
+ @Test
+ public void testConstructorWithUri() {
+ // Case1 (Set the name manually)
+ SdlFile sdlFile1 = new SdlFile(TestValues.GENERAL_STRING, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_URI, TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile1.getName(), TestValues.GENERAL_STRING);
+ assertEquals(sdlFile1.getType(), TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile1.getURI(), TestValues.GENERAL_URI);
+ assertEquals(sdlFile1.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile1.getOverwrite());
+
+ // Case2 (Let the library generate a name)
+ SdlFile sdlFile2 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_URI, TestValues.GENERAL_BOOLEAN);
+ SdlFile sdlFile3 = new SdlFile(null, TestValues.GENERAL_FILETYPE, TestValues.GENERAL_URI, TestValues.GENERAL_BOOLEAN);
+ assertEquals(sdlFile2.getName(), sdlFile3.getName());
+ assertEquals(sdlFile2.getName(), "d3467db131372140");
+ assertEquals(sdlFile2.getType(), TestValues.GENERAL_FILETYPE);
+ assertEquals(sdlFile2.getURI(), TestValues.GENERAL_URI);
+ assertEquals(sdlFile2.isPersistent(), TestValues.GENERAL_BOOLEAN);
+ assertFalse(sdlFile2.getOverwrite());
+ }
+}
diff --git a/javaSE/javaSE/src/test/java/com/smartdevicelink/test/TestValues.java b/javaSE/javaSE/src/test/java/com/smartdevicelink/test/TestValues.java
new file mode 100644
index 000000000..d3efa2326
--- /dev/null
+++ b/javaSE/javaSE/src/test/java/com/smartdevicelink/test/TestValues.java
@@ -0,0 +1,13 @@
+package com.smartdevicelink.test;
+
+import com.smartdevicelink.proxy.rpc.enums.FileType;
+
+import java.net.URI;
+
+public class TestValues {
+ public static final boolean GENERAL_BOOLEAN = true;
+ public static final byte[] GENERAL_BYTE_ARRAY = new byte[0];
+ public static final String GENERAL_STRING = "test";
+ public static final FileType GENERAL_FILETYPE = FileType.BINARY;
+ public static final URI GENERAL_URI = URI.create("http://www.google.com");
+}
diff --git a/javaSE/settings.gradle b/javaSE/settings.gradle
index f7ac48020..99f64ccb0 100644
--- a/javaSE/settings.gradle
+++ b/javaSE/settings.gradle
@@ -1,2 +1 @@
-rootProject.name = 'javaSE'
-
+include ':javaSE', ':hello_sdl_java' \ No newline at end of file
diff --git a/javaSE/src/main/java/android/os/AsyncTask.java b/javaSE/src/main/java/android/os/AsyncTask.java
deleted file mode 100644
index db6b69a8e..000000000
--- a/javaSE/src/main/java/android/os/AsyncTask.java
+++ /dev/null
@@ -1,27 +0,0 @@
- /*
- * 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;
-
-@Deprecated
-public abstract class AsyncTask<Params, Progress, Result> {
-
-
- abstract protected Result doInBackground(Params...params);
-
-}
diff --git a/javaSE/src/main/java/android/os/Parcel.java b/javaSE/src/main/java/android/os/Parcel.java
deleted file mode 100644
index b99dbc671..000000000
--- a/javaSE/src/main/java/android/os/Parcel.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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;
-
-@Deprecated
-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/javaSE/src/main/java/android/os/Parcelable.java b/javaSE/src/main/java/android/os/Parcelable.java
deleted file mode 100644
index e09a1754c..000000000
--- a/javaSE/src/main/java/android/os/Parcelable.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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;
-
-@Deprecated
-public interface Parcelable {
-
- int describeContents();
- void writeToParcel(Parcel dest, int flags);
-
-
- abstract class Creator<T>{
- public abstract T[] newArray(int size);
- }
-
-}
diff --git a/javaSE/src/main/java/android/util/Log.java b/javaSE/src/main/java/android/util/Log.java
deleted file mode 100644
index 7374ff04c..000000000
--- a/javaSE/src/main/java/android/util/Log.java
+++ /dev/null
@@ -1,71 +0,0 @@
- /*
- * 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;
-
-@Deprecated
-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/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java b/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java
deleted file mode 100644
index 49d41d495..000000000
--- a/javaSE/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.smartdevicelink.managers.screen;
-
-import androidx.annotation.NonNull;
-import com.smartdevicelink.proxy.interfaces.ISdl;
-
-public class SubscribeButtonManager extends BaseSubscribeButtonManager {
-
- public SubscribeButtonManager(@NonNull ISdl internalInterface) {
- super(internalInterface);
- }
-}
diff --git a/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java b/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
deleted file mode 100644
index 7bc15e2ab..000000000
--- a/javaSE/src/main/java/com/smartdevicelink/transport/utl/TransportRecord.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 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.Parcel;
-import android.os.Parcelable;
-import com.smartdevicelink.transport.enums.TransportType;
-
-public class TransportRecord extends BaseTransportRecord {
-
- public TransportRecord(TransportType transportType, String address) {
- super(transportType, address);
- }
-
- @Deprecated
- public TransportRecord(Parcel p) {}
-
- @Deprecated
- public int describeContents() {
- return 0;
- };
-
- @Deprecated
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(type!=null? 1 : 0);
- if(type != null){
- dest.writeString(type.name());
- }
-
- dest.writeInt(address !=null? 1 : 0);
- if(address != null){
- dest.writeString(address);
- }
- }
-
- @Deprecated
- public static final Parcelable.Creator<TransportRecord> CREATOR = new Parcelable.Creator<TransportRecord>() {
- public TransportRecord createFromParcel(Parcel in) {
- return new TransportRecord(in);
- }
-
- @Override
- public TransportRecord[] newArray(int size) {
- return new TransportRecord[size];
- }
-
- };
-}
diff --git a/javaSE/src/main/java/com/smartdevicelink/util/HttpRequestTask.java b/javaSE/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
deleted file mode 100644
index 77c9f4f7a..000000000
--- a/javaSE/src/main/java/com/smartdevicelink/util/HttpRequestTask.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package com.smartdevicelink.util;
-
-import android.os.AsyncTask;
-
-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;
-
-
-@Deprecated
-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
- *
- */
- @Deprecated
- public HttpRequestTask( HttpRequestTaskCallback hcb){
- this.cb = hcb;
- }
-
- @Deprecated
- 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){
- DebugTool.logError(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).append("\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;
- }
- DebugTool.logError(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) {
- DebugTool.logError(TAG, "Error closing stream", e);
- }
- }
- if(cb!=null){
- cb.httpFailure(-1);
- }
- }
- return null;
- }
-
- /**
- * Callback interface for HTTP requests.
- * @author Joey Grover
- *
- */
- @Deprecated
- 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);
- }
-
-}