summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rwxr-xr-xandroid/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/SdlService.java17
-rw-r--r--android/sdl_android/build.gradle1
-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.java206
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/SdlManagerTests.java25
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/audio/AudioStreamManagerTest.java76
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/file/FileManagerTests.java26
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java111
-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/LockScreenManagerTests.java1
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java9
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/SoftButtonManagerTests.java10
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java605
-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/video/VideoStreamManagerTests.java32
-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/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/GetVehicleDataTests.java5
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java5
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java5
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java38
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java9
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java11
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java23
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java9
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/StreamPacketizerTests.java2
-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/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/transport/MultiplexTransportTest.java24
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/RSVTestCase.java65
-rw-r--r--android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java8
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java107
-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.java12
-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/AudioStreamManager.java81
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java10
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java61
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java24
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java5
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java2
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/ScreenManager.java2
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SoftButtonManager.java2
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/SubscribeButtonManager.java3
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/TextAndGraphicManager.java6
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/choiceset/ChoiceSetManager.java2
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/MenuManager.java3
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/screen/menu/VoiceCommandManager.java3
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/video/HapticInterfaceManager.java8
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/managers/video/VideoStreamManager.java162
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlPacket.java3
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/SdlProtocol.java2
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/HeartbeatMonitor.java64
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/protocol/heartbeat/IHeartbeatMonitor.java64
-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.java8494
-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/streaming/StreamPacketizer.java14
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java333
-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.java2
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/MultiplexBluetoothTransport.java336
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/RouterServiceValidator.java70
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/SdlBroadcastReceiver.java16
-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.java2
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportBroker.java5
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/transport/TransportManager.java28
-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/utl/ByteArrayMessageSpliter.java11
-rw-r--r--android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java48
104 files changed, 2959 insertions, 27249 deletions
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..2d20be1a3 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
@@ -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/sdl_android/build.gradle b/android/sdl_android/build.gradle
index d35b06c49..e92009c2a 100644
--- a/android/sdl_android/build.gradle
+++ b/android/sdl_android/build.gradle
@@ -35,6 +35,7 @@ android {
sourceSets {
main.java.srcDirs += '../../base/src/main/java'
+ androidTest.assets.srcDirs += '../../generator/rpc_spec/'
}
}
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..fe7d402b9
--- /dev/null
+++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/ManagerUtilityTests.java
@@ -0,0 +1,206 @@
+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.assertNotNull;
+import static junit.framework.TestCase.assertTrue;
+import static junit.framework.TestCase.assertFalse;
+
+/**
+ * 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 7c4fb11ff..97361adc9 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
@@ -112,11 +112,6 @@ public class SdlManagerTests {
}
@Override
- public LifecycleConfigurationUpdate managerShouldUpdateLifecycle(Language language) {
- return null;
- }
-
- @Override
public LifecycleConfigurationUpdate managerShouldUpdateLifecycle(Language language, Language hmiLanguage) {
return null;
}
@@ -222,7 +217,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 +227,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 +237,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 +247,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 +257,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 +267,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 +277,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 +287,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 +297,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 +307,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());
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..1d5d12059 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,12 +5,15 @@ 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 androidx.test.platform.app.InstrumentationRegistry;
+
import com.smartdevicelink.SdlConnection.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;
@@ -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 8908346d2..34cc6bf2a 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
@@ -248,7 +248,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");
@@ -280,7 +280,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");
@@ -403,7 +403,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");
@@ -434,7 +434,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));
}
/**
@@ -552,7 +552,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);
@@ -573,7 +573,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));
}
/**
@@ -584,7 +584,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);
@@ -606,7 +606,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));
}
/**
@@ -702,7 +702,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();
@@ -739,7 +739,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");
@@ -788,7 +788,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);
@@ -908,7 +908,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");
@@ -944,7 +944,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/lifecycle/SystemCapabilityManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lifecycle/SystemCapabilityManagerTests.java
index 4c1981099..a14e98383 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
@@ -183,25 +183,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)));
}
@@ -256,7 +256,7 @@ public class SystemCapabilityManagerTests {
public void onError(String info) {
assertTrue(false);
}
- });
+ }, false);
}
private Answer<Void> createOnHMIStatusAnswer(final HMILevel hmiLevel){
@@ -687,7 +687,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);
@@ -707,7 +707,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);
@@ -723,7 +723,7 @@ public class SystemCapabilityManagerTests {
scmRpcListener.onReceived(onSystemCapabilityUpdated);
- assertNotNull(systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES));
+ assertNotNull(systemCapabilityManager.getCapability(SystemCapabilityType.APP_SERVICES, null, false));
}
@Test
@@ -733,8 +733,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);;
@@ -747,11 +747,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));
@@ -772,13 +772,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);
@@ -798,7 +798,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));
@@ -823,7 +823,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);
@@ -842,7 +842,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);
@@ -861,7 +861,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);
@@ -876,7 +876,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);
@@ -889,7 +889,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);
@@ -913,11 +913,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));
@@ -960,23 +960,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) {
}
@@ -1027,12 +1013,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() {
@@ -1040,11 +1020,6 @@ public class SystemCapabilityManagerTests {
}
@Override
- public Object getCapability(SystemCapabilityType systemCapabilityType, OnSystemCapabilityListener scListener, boolean forceUpdate) {
- return null;
- }
-
- @Override
public SdlMsgVersion getSdlMsgVersion() {
return null;
}
@@ -1054,46 +1029,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/LockScreenManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/lockscreen/LockScreenManagerTests.java
index 2509a2298..6baf9f7ee 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
@@ -60,7 +60,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/screen/ScreenManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/ScreenManagerTests.java
index f1e68e9b3..11d8472c2 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
@@ -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 e5daf375b..b43be2af6 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,12 +3,12 @@ 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.rpc.DisplayCapability;
@@ -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/TextAndGraphicManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/screen/TextAndGraphicManagerTests.java
index 439b7ebe9..e5deb7f30 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
@@ -4,28 +4,35 @@ 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.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.rpc.MetadataTags;
-import com.smartdevicelink.proxy.rpc.Show;
+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 +40,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 +62,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 +74,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 +170,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 +197,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 +219,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 +254,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..cdfab186c
--- /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.proxy.interfaces.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/video/VideoStreamManagerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/managers/video/VideoStreamManagerTests.java
index a393bf34f..2a09311e9 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.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/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 92670c7d4..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.GenericResponse;
-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 onResponse(int correlationId, RPCResponse response) {
- if (response.getSuccess()) {
- onResponseListenerCounter++;
- remainingRequestsExpected--;
- } else {
- onErrorListenerCounter++;
- 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).onResponse(request.getCorrelationID(), new GenericResponse(false, Result.DISALLOWED));
- } 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/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/GetVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/GetVehicleDataTests.java
index f3b4b564e..467c37b2e 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
@@ -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/SubscribeVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/SubscribeVehicleDataTests.java
index fee5ddd25..7f5113fc7 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
@@ -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/UnsubscribeVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/requests/UnsubscribeVehicleDataTests.java
index 747b61563..9ca309030 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
@@ -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/responses/GetVehicleDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java
index 6ebc03f80..818c9b4ce 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;
@@ -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/SubscribeVehicleDataResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/SubscribeVehicleDataResponseTest.java
index 643935a02..79af1baa8 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
@@ -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/UnsubscribeVehicleDataResponseTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/UnsubscribeVehicleDataResponseTest.java
index dc69b66ae..284090cd5 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
@@ -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/streaming/AbstractPacketizerTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/AbstractPacketizerTests.java
index e5e47f3a5..0cccc48e8 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
@@ -5,8 +5,6 @@ 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/MockPacketizer.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/streaming/MockPacketizer.java
index 2c6618f62..ca6a77820 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
@@ -2,10 +2,8 @@ package com.smartdevicelink.test.streaming;
import com.smartdevicelink.SdlConnection.SdlSession;
import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.RPCRequest;
import com.smartdevicelink.streaming.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..bf6f6a850 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
@@ -7,8 +7,6 @@ import com.smartdevicelink.proxy.interfaces.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/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/transport/MultiplexTransportTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/MultiplexTransportTest.java
index 6f4f0231b..d1a359e24 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 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..69a8caeea 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
@@ -86,7 +86,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 +99,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 +112,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 +125,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 +138,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 +217,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 +233,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 +406,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 +486,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/TransportBrokerTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/transport/TransportBrokerTest.java
index 22837f77d..aa0507a36 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,6 +1,7 @@
package com.smartdevicelink.transport;
import android.bluetooth.BluetoothAdapter;
+import android.content.ComponentName;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -27,7 +28,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/main/java/com/smartdevicelink/SdlConnection/SdlSession.java b/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
index f4bdb7136..c57743a2f 100644
--- a/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
+++ b/android/sdl_android/src/main/java/com/smartdevicelink/SdlConnection/SdlSession.java
@@ -34,22 +34,14 @@ package com.smartdevicelink.SdlConnection;
import android.content.Context;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.exception.SdlException;
-import com.smartdevicelink.protocol.ProtocolMessage;
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";
@@ -178,13 +170,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 +185,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 +196,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/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..f109cbe85 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
@@ -124,7 +124,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 +142,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 +150,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/AudioStreamManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/audio/AudioStreamManager.java
index 38bc357b6..52b4db580 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
@@ -40,11 +40,13 @@ 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.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;
@@ -57,10 +59,13 @@ 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.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 +96,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 +114,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 +135,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 +152,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 +186,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 +220,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 +273,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 +356,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 +509,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/file/FileManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/file/FileManager.java
index bdd21ba45..0efc3b6ff 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
@@ -36,6 +36,7 @@ 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.file.filetypes.SdlFile;
import com.smartdevicelink.proxy.interfaces.ISdl;
@@ -65,20 +66,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/lifecycle/LifecycleManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lifecycle/LifecycleManager.java
index 73757292b..78233dc0f 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
@@ -48,7 +48,6 @@ 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;
@@ -76,22 +75,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 +111,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);
}
@@ -242,25 +219,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 +231,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/lockscreen/LockScreenConfig.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenConfig.java
index 8fe3286ba..8d1e9a6c8 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
@@ -88,30 +88,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/LockScreenManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/lockscreen/LockScreenManager.java
index c5d567e56..06f992875 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,6 +38,8 @@ 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;
@@ -64,6 +66,7 @@ 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";
@@ -96,7 +99,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/permission/PermissionManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/managers/permission/PermissionManager.java
index e3a85bb1b..7430c3143 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,6 +33,7 @@
package com.smartdevicelink.managers.permission;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
import com.smartdevicelink.proxy.interfaces.ISdl;
@@ -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..31c6da0b1 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,6 +33,7 @@
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;
@@ -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..5499d3a5a 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,6 +33,7 @@
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;
@@ -42,6 +43,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl;
* 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..9f08bef36 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,6 +1,8 @@
package com.smartdevicelink.managers.screen;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.proxy.interfaces.ISdl;
/**
@@ -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..fe216ea5f 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,6 +33,7 @@
package com.smartdevicelink.managers.screen;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
import com.smartdevicelink.R;
import com.smartdevicelink.managers.file.FileManager;
@@ -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..f0895fe22 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,6 +33,7 @@
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;
@@ -42,6 +43,7 @@ import com.smartdevicelink.proxy.interfaces.ISdl;
* 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..d29312cdf 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,6 +32,8 @@
package com.smartdevicelink.managers.screen.menu;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.managers.file.FileManager;
import com.smartdevicelink.proxy.interfaces.ISdl;
@@ -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..afde7404d 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,6 +32,8 @@
package com.smartdevicelink.managers.screen.menu;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.proxy.interfaces.ISdl;
/**
@@ -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..78b6bb03b 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
@@ -65,7 +65,7 @@ class HapticInterfaceManager extends BaseHapticInterfaceManager {
ISdl proxy = proxyHolder.get();
SendHapticData msg = new SendHapticData();
msg.setHapticRectData(userHapticData);
- proxy.sendRPCRequest(msg);
+ proxy.sendRPC(msg);
}
}
@@ -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 81db89049..77467f429 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,12 +40,15 @@ import android.view.Display;
import android.view.InputDevice;
import android.view.MotionEvent;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.SdlConnection.SdlSession;
import com.smartdevicelink.encoder.VirtualDisplayEncoder;
import com.smartdevicelink.managers.BaseSubManager;
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;
@@ -59,18 +62,25 @@ 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.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;
@@ -95,6 +105,7 @@ public class VideoStreamManager extends BaseVideoStreamManager {
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);
@@ -454,14 +483,20 @@ 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);
+ 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);
+ DisplayCapabilities dispCap = null;
+ if (internalInterface.getSystemCapabilityManager() != null) {
+ dispCap = (DisplayCapabilities) internalInterface.getSystemCapabilityManager().getCapability(SystemCapabilityType.DISPLAY, null, false);
+ }
if (dispCap != null) {
resolution = (dispCap.getScreenParams().getImageResolution());
}
@@ -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..723af1939 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;
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..fd6ac275f 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,6 +46,7 @@ import java.util.Collections;
@SuppressWarnings("WeakerAccess")
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public class SdlProtocol extends SdlProtocolBase {
private static final String TAG ="SdlProtocol";
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..dd65cc3a4 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;
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..6ad5fb001 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,37 +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.protocol.heartbeat;
+import androidx.annotation.RestrictTo;
+@RestrictTo(RestrictTo.Scope.LIBRARY)
public interface IHeartbeatMonitor {
/**
* Starts the monitor. If the monitor is already started, nothing happens.
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..26f3535b2 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
+ */
+ public void sendHeartbeat(IHeartbeatMonitor monitor);
+
+ /**
+ * Notifies the listener that the heartbeat timed out.
+ *
+ * @param monitor the caller
+ */
+ public void heartbeatTimedOut(IHeartbeatMonitor monitor);
+}
diff --git a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/LockScreenManager.java b/android/sdl_android/src/main/java/com/smartdevicelink/proxy/LockScreenManager.java
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 90dba74bd..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/proxy/SdlProxyBase.java
+++ /dev/null
@@ -1,8494 +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 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 androidx.annotation.NonNull;
-
-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.ServiceEncryptionListener;
-import com.smartdevicelink.managers.lifecycle.OnSystemCapabilityListener;
-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.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.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;
-
-//import com.smartdevicelink.managers.video.HapticInterfaceManager;
-
-
-/**
- * @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) {
- GenericResponse response = new GenericResponse(false, Result.REJECTED);
- response.setInfo(errorInfo);
- listener.onResponse(request.getCorrelationID(), response);
- }
- }
- 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);
- }
- }
-
- /**
- * 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);
- listener.onResponse(correlationId, msg);
- 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){
- 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) {
- GenericResponse genericResponse = new GenericResponse(false, Result.GENERIC_ERROR);
- genericResponse.setInfo(e.toString());
- listener.onResponse(correlationId, genericResponse);
- }
- }
- }
- });
- 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) {
- GenericResponse response = new GenericResponse(false, Result.REJECTED);
- response.setInfo(e.toString());
- listener.onResponse(0, response);
- }
- }
- }
-
-
- }
-
- /**
- * 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);
- }
- }
- });
- }
- 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/streaming/StreamPacketizer.java b/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamPacketizer.java
index accb59948..24608ecfe 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,6 +31,8 @@
*/
package com.smartdevicelink.streaming;
+import androidx.annotation.RestrictTo;
+
import com.smartdevicelink.SdlConnection.SdlSession;
import com.smartdevicelink.managers.CompletionListener;
import com.smartdevicelink.protocol.ProtocolMessage;
@@ -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";
@@ -237,17 +240,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 91623dd9d..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/streaming/StreamRPCPacketizer.java
+++ /dev/null
@@ -1,333 +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.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/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..e1f138978 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;
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..449774d57 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
@@ -74,7 +74,6 @@ public class MultiplexBluetoothTransport extends MultiplexBaseTransport{
private ConnectThread mConnectThread;
private ConnectedThread mConnectedThread;
private ConnectedWriteThread mConnectedWriteThread;
- private int mBluetoothLevel = 0;
Handler timeOutHandler;
Runnable socketRunable;
boolean keepSocketAlive = true;
@@ -85,43 +84,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)
@@ -515,169 +477,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, 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;
+ 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(socketRunable);
+ 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(socketRunable);
+ 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(socketRunable);
+ 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 +629,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
}
}
}
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..78f78ccb2 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
@@ -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.
*/
@@ -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;
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..bad3ccc2e 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
@@ -51,6 +51,8 @@ import android.os.Looper;
import android.os.Parcelable;
import android.util.AndroidRuntimeException;
+import androidx.annotation.CallSuper;
+
import com.smartdevicelink.R;
import com.smartdevicelink.transport.RouterServiceValidator.TrustedListCallback;
import com.smartdevicelink.transport.enums.TransportType;
@@ -96,6 +98,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 +116,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);
@@ -237,7 +240,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);
@@ -297,7 +300,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) {
@@ -462,11 +465,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){
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..3df010bcf 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
@@ -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..3851ab563 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
@@ -752,11 +752,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..c653c7d93 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
@@ -125,14 +125,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 +214,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 +233,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){
@@ -284,13 +263,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);
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/utl/ByteArrayMessageSpliter.java b/android/sdl_android/src/main/java/com/smartdevicelink/transport/utl/ByteArrayMessageSpliter.java
index c7333fb08..9ab93aea9 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
@@ -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/util/HttpUtils.java b/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.java
deleted file mode 100644
index ad43c40f5..000000000
--- a/android/sdl_android/src/main/java/com/smartdevicelink/util/HttpUtils.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.util;
-
-import android.graphics.Bitmap;
-
-import java.io.IOException;
-
-/**
- * @see AndroidTools
- */
-@Deprecated
-public class HttpUtils{
-
- public static Bitmap downloadImage(String urlStr) throws IOException{
- return AndroidTools.downloadImage(urlStr);
- }
-
-}