diff options
author | Justin Dickow <jjdickow@gmail.com> | 2014-03-18 13:46:46 -0400 |
---|---|---|
committer | Justin Dickow <jjdickow@gmail.com> | 2014-03-18 13:46:46 -0400 |
commit | ba492fb83c258bc60ca68120ce964a95b41133b5 (patch) | |
tree | af99c087941d65a19831397c1ec5eb34850cfc7f /SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy | |
parent | 8504605b01177da2e55bee6abe4c3f20c82da379 (diff) | |
download | smartdevicelink-ba492fb83c258bc60ca68120ce964a95b41133b5.tar.gz |
initial commit for API 3.0 (replaced all)
Diffstat (limited to 'SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy')
270 files changed, 23838 insertions, 0 deletions
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/IProtocolMessageHolder.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/IProtocolMessageHolder.java new file mode 100644 index 000000000..609f67c59 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/IProtocolMessageHolder.java @@ -0,0 +1,52 @@ +package com.ford.syncV4.proxy; + +import com.ford.syncV4.protocol.ProtocolMessage; + +import java.util.List; + +/** + * Stores pending protocol messages for specified correlation ID. + * + * Created by enikolsky on 2014-01-22. + */ +public interface IProtocolMessageHolder { + /** + * Saves the ProtocolMessage objects. All the messages in the list are + * expected to have the same correlation ID. + * + * @param messages messages to save + */ + void saveMessages(List<ProtocolMessage> messages); + + /** + * Clears stored messages for the specified correlation ID. + * + * @param correlationID correlation ID + */ + void clearMessages(Integer correlationID); + + /** + * Checks if there are messages left for the correlation ID. + * + * @param correlationID correlation ID + * @return true if there are messages left + */ + boolean hasMessages(Integer correlationID); + + /** + * Returns the next message for the correlation ID. + * + * @param correlationID correlation ID + * @return next message in the sequence, or null if none + */ + ProtocolMessage peekNextMessage(Integer correlationID); + + /** + * Returns the next message for the correlation ID and removes it from the + * sequence. + * + * @param correlationID correlation ID + * @return next message in the sequence, or null if none + */ + ProtocolMessage popNextMessage(Integer correlationID); +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/IProxyListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/IProxyListener.java new file mode 100644 index 000000000..7ad28d7c3 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/IProxyListener.java @@ -0,0 +1,19 @@ +package com.ford.syncV4.proxy;
+
+import com.ford.syncV4.proxy.interfaces.IProxyListenerBase;
+import com.ford.syncV4.proxy.rpc.OnAppInterfaceUnregistered;
+import com.ford.syncV4.proxy.rpc.RegisterAppInterfaceResponse;
+import com.ford.syncV4.proxy.rpc.UnregisterAppInterfaceResponse;
+
+public interface IProxyListener extends IProxyListenerBase{
+ // Adds Legacy Life-cycle Management call-backs to the IProxyListenerAbstract interface
+
+ public void onProxyOpened();
+
+ public void onRegisterAppInterfaceResponse(RegisterAppInterfaceResponse response);
+
+ public void onOnAppInterfaceUnregistered(OnAppInterfaceUnregistered notification);
+
+ public void onUnregisterAppInterfaceResponse(UnregisterAppInterfaceResponse response);
+
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/IRPCMessageHandler.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/IRPCMessageHandler.java new file mode 100644 index 000000000..ac6e9a1e7 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/IRPCMessageHandler.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy; + +import java.util.Hashtable; + +/** + * Created by Andrew Batutin on 2/10/14. + */ +public interface IRPCMessageHandler { + + public void handleRPCMessage(Hashtable hash); +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/ProtocolMessageHolder.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/ProtocolMessageHolder.java new file mode 100644 index 000000000..134a78157 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/ProtocolMessageHolder.java @@ -0,0 +1,64 @@ +package com.ford.syncV4.proxy; + +import android.util.SparseArray; + +import com.ford.syncV4.protocol.ProtocolMessage; + +import java.util.List; + +/** + * Stores pending protocol messages for specified correlation ID using a sparse + * array. + * + * This class is not thread-safe. + * + * Created by enikolsky on 2014-01-22. + */ +public class ProtocolMessageHolder implements IProtocolMessageHolder { + private SparseArray<List<ProtocolMessage>> array = + new SparseArray<List<ProtocolMessage>>(); + + @Override + public void saveMessages(List<ProtocolMessage> messages) { + final int corrID = messages.get(0).getCorrID(); + array.put(corrID, messages); + } + + @Override + public void clearMessages(Integer correlationID) { + array.remove(correlationID); + } + + @Override + public boolean hasMessages(Integer correlationID) { + final List<ProtocolMessage> messages = array.get(correlationID); + return ((null != messages) && (messages.size() > 0)); + } + + @Override + public ProtocolMessage peekNextMessage(Integer correlationID) { + if (hasMessages(correlationID)) { + final List<ProtocolMessage> messages = array.get(correlationID); + return messages.get(0); + } + + return null; + } + + @Override + public ProtocolMessage popNextMessage(Integer correlationID) { + if (hasMessages(correlationID)) { + final List<ProtocolMessage> messages = array.get(correlationID); + final ProtocolMessage pm = messages.get(0); + + messages.remove(0); + if (0 == messages.size()) { + clearMessages(correlationID); + } + + return pm; + } + + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCMessage.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCMessage.java new file mode 100644 index 000000000..f5cc6e8a0 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCMessage.java @@ -0,0 +1,78 @@ +package com.ford.syncV4.proxy;
+
+import com.ford.syncV4.proxy.constants.Names;
+
+import java.util.Hashtable;
+
+public class RPCMessage extends RPCStruct {
+
+ public RPCMessage(String functionName) {
+ this(functionName, "request");
+ }
+
+ protected RPCMessage(RPCMessage rpcm) {
+ this.store = new Hashtable<String, Object>();
+ this.messageType = rpcm.messageType;
+ this.function = (Hashtable) rpcm.function.clone();
+ this.store.put(messageType, function);
+ if (rpcm.parameters != null) {
+ this.parameters = (Hashtable) rpcm.parameters.clone();
+ this.function.put(Names.parameters, this.parameters);
+ }
+ if (rpcm.getFunctionName() != null) {
+ this.function.put(Names.function_name, rpcm.getFunctionName());
+ }
+ }
+
+ protected RPCMessage(RPCStruct rpcs) {
+ this("", "");
+ this.parameters = rpcs.store;
+ }
+
+ public RPCMessage(String functionName, String messageType) {
+ function = new Hashtable();
+ this.messageType = messageType;
+ store.put(messageType, function);
+ parameters = new Hashtable();
+ function.put(Names.parameters, parameters);
+ function.put(Names.function_name, functionName);
+ }
+
+ public RPCMessage(Hashtable hash) {
+ store = hash;
+ messageType = getMessageTypeName(hash.keySet());
+ function = (Hashtable) hash.get(messageType);
+ parameters = (Hashtable) function.get(Names.parameters);
+ if (hasKey(hash.keySet(), Names.bulkData)) {
+ setBulkData((byte[]) hash.get(Names.bulkData));
+ }
+ }
+
+ protected String messageType;
+ protected Hashtable parameters;
+ protected Hashtable function;
+
+ public String getFunctionName() {
+ return (String) function.get(Names.function_name);
+ }
+
+ protected void setFunctionName(String functionName) {
+ function.put(Names.function_name, functionName);
+ }
+
+ public String getMessageType() {
+ return messageType;
+ }
+
+ public void setParameters(String functionName, Object value) {
+ if (value != null) {
+ parameters.put(functionName, value);
+ } else {
+ parameters.remove(functionName);
+ }
+ }
+
+ public Object getParameters(String functionName) {
+ return parameters.get(functionName);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCMessageHandler.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCMessageHandler.java new file mode 100644 index 000000000..0e6e36004 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCMessageHandler.java @@ -0,0 +1,1176 @@ +package com.ford.syncV4.proxy; + +import android.os.Handler; +import android.util.Log; + +import com.ford.syncV4.exception.SyncException; +import com.ford.syncV4.exception.SyncExceptionCause; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.interfaces.IProxyListenerBase; +import com.ford.syncV4.proxy.rpc.AddCommandResponse; +import com.ford.syncV4.proxy.rpc.AddSubMenuResponse; +import com.ford.syncV4.proxy.rpc.AlertManeuverResponse; +import com.ford.syncV4.proxy.rpc.AlertResponse; +import com.ford.syncV4.proxy.rpc.ChangeRegistrationResponse; +import com.ford.syncV4.proxy.rpc.CreateInteractionChoiceSetResponse; +import com.ford.syncV4.proxy.rpc.DeleteCommandResponse; +import com.ford.syncV4.proxy.rpc.DeleteFileResponse; +import com.ford.syncV4.proxy.rpc.DeleteInteractionChoiceSetResponse; +import com.ford.syncV4.proxy.rpc.DeleteSubMenuResponse; +import com.ford.syncV4.proxy.rpc.EncodedSyncPDataResponse; +import com.ford.syncV4.proxy.rpc.EndAudioPassThruResponse; +import com.ford.syncV4.proxy.rpc.GenericResponse; +import com.ford.syncV4.proxy.rpc.GetDTCsResponse; +import com.ford.syncV4.proxy.rpc.GetVehicleDataResponse; +import com.ford.syncV4.proxy.rpc.ListFilesResponse; +import com.ford.syncV4.proxy.rpc.OnAppInterfaceUnregistered; +import com.ford.syncV4.proxy.rpc.OnAudioPassThru; +import com.ford.syncV4.proxy.rpc.OnButtonEvent; +import com.ford.syncV4.proxy.rpc.OnButtonPress; +import com.ford.syncV4.proxy.rpc.OnCommand; +import com.ford.syncV4.proxy.rpc.OnDriverDistraction; +import com.ford.syncV4.proxy.rpc.OnEncodedSyncPData; +import com.ford.syncV4.proxy.rpc.OnHMIStatus; +import com.ford.syncV4.proxy.rpc.OnHashChange; +import com.ford.syncV4.proxy.rpc.OnKeyboardInput; +import com.ford.syncV4.proxy.rpc.OnLanguageChange; +import com.ford.syncV4.proxy.rpc.OnPermissionsChange; +import com.ford.syncV4.proxy.rpc.OnSyncPData; +import com.ford.syncV4.proxy.rpc.OnTBTClientState; +import com.ford.syncV4.proxy.rpc.OnTouchEvent; +import com.ford.syncV4.proxy.rpc.OnVehicleData; +import com.ford.syncV4.proxy.rpc.PerformAudioPassThruResponse; +import com.ford.syncV4.proxy.rpc.PerformInteractionResponse; +import com.ford.syncV4.proxy.rpc.PutFileResponse; +import com.ford.syncV4.proxy.rpc.ReadDIDResponse; +import com.ford.syncV4.proxy.rpc.RegisterAppInterfaceResponse; +import com.ford.syncV4.proxy.rpc.ResetGlobalPropertiesResponse; +import com.ford.syncV4.proxy.rpc.ScrollableMessageResponse; +import com.ford.syncV4.proxy.rpc.SetAppIconResponse; +import com.ford.syncV4.proxy.rpc.SetDisplayLayoutResponse; +import com.ford.syncV4.proxy.rpc.SetGlobalPropertiesResponse; +import com.ford.syncV4.proxy.rpc.SetMediaClockTimerResponse; +import com.ford.syncV4.proxy.rpc.ShowConstantTBTResponse; +import com.ford.syncV4.proxy.rpc.ShowResponse; +import com.ford.syncV4.proxy.rpc.SliderResponse; +import com.ford.syncV4.proxy.rpc.SpeakResponse; +import com.ford.syncV4.proxy.rpc.SubscribeButtonResponse; +import com.ford.syncV4.proxy.rpc.SubscribeVehicleDataResponse; +import com.ford.syncV4.proxy.rpc.SyncPDataResponse; +import com.ford.syncV4.proxy.rpc.SystemRequestResponse; +import com.ford.syncV4.proxy.rpc.UnsubscribeButtonResponse; +import com.ford.syncV4.proxy.rpc.UnsubscribeVehicleDataResponse; +import com.ford.syncV4.proxy.rpc.UpdateTurnListResponse; +import com.ford.syncV4.proxy.rpc.enums.AppInterfaceUnregisteredReason; +import com.ford.syncV4.proxy.rpc.enums.HMILevel; +import com.ford.syncV4.proxy.rpc.enums.SyncConnectionState; +import com.ford.syncV4.proxy.rpc.enums.SyncDisconnectedReason; +import com.ford.syncV4.trace.SyncTrace; +import com.ford.syncV4.trace.enums.InterfaceActivityDirection; +import com.ford.syncV4.transport.TransportType; +import com.ford.syncV4.util.DebugTool; + +import java.util.Hashtable; + + +/** + * Created by Andrew Batutin on 2/10/14. + */ +public class RPCMessageHandler implements IRPCMessageHandler { + + private SyncProxyBase syncProxyBase; + + public RPCMessageHandler(SyncProxyBase syncProxyBase) { + this.syncProxyBase = syncProxyBase; + } + + @Override + public void handleRPCMessage(Hashtable hash) { + if (hash != null) { + handleRPCMessageInt(hash); + } + } + + private void handleRPCMessageInt(Hashtable hash) { + RPCMessage rpcMsg = new RPCMessage(hash); + String functionName = rpcMsg.getFunctionName(); + String messageType = rpcMsg.getMessageType(); + + if (messageType.equals(Names.response)) { + SyncTrace.logRPCEvent(InterfaceActivityDirection.Receive, new RPCResponse(rpcMsg), SyncProxyBase.SYNC_LIB_TRACE_KEY); + + final RPCResponse response = new RPCResponse(hash); + final Integer responseCorrelationID = response.getCorrelationID(); + if (!syncProxyBase.handlePartialRPCResponse(response) && + !syncProxyBase.handleLastInternalResponse(response)) { + + // Check to ensure response is not from an internal message (reserved correlation ID) + if (syncProxyBase.isCorrelationIDProtected(responseCorrelationID)) { + // 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 (responseCorrelationID == + syncProxyBase.REGISTER_APP_INTERFACE_CORRELATION_ID && + syncProxyBase.getAdvancedLifecycleManagementEnabled() && + functionName.equals(Names.RegisterAppInterface)) { + final RegisterAppInterfaceResponse msg = + new RegisterAppInterfaceResponse(hash); + if (msg.getSuccess()) { + syncProxyBase.setAppInterfaceRegisterd(true); + } + + //_autoActivateIdReturned = msg.getAutoActivateID(); + /*Place holder for legacy support*/ + syncProxyBase.setAutoActivateIdReturned("8675309"); + syncProxyBase.setButtonCapabilities(msg.getButtonCapabilities()); + syncProxyBase.setDisplayCapabilities(msg.getDisplayCapabilities()); + syncProxyBase.setSoftButtonCapabilities(msg.getSoftButtonCapabilities()); + syncProxyBase.setPresetBankCapabilities(msg.getPresetBankCapabilities()); + syncProxyBase.setHmiZoneCapabilities(msg.getHmiZoneCapabilities()); + syncProxyBase.setSpeechCapabilities(msg.getSpeechCapabilities()); + syncProxyBase.setSyncLanguage(msg.getLanguage()); + syncProxyBase.setHmiDisplayLanguage(msg.getHmiDisplayLanguage()); + syncProxyBase.setSyncMsgVersion(msg.getSyncMsgVersion()); + syncProxyBase.setVrCapabilities(msg.getVrCapabilities()); + syncProxyBase.setVehicleType(msg.getVehicleType()); + syncProxyBase.setSyncConnectionState(SyncConnectionState.SYNC_CONNECTED); + + // If registerAppInterface failed, exit with OnProxyUnusable + if (!msg.getSuccess()) { + syncProxyBase.notifyProxyClosed( + "Unable to register app interface. Review values passed to the SyncProxy constructor. RegisterAppInterface result code: ", + new SyncException( + "Unable to register app interface. Review values passed to the SyncProxy constructor. RegisterAppInterface result code: " + + msg.getResultCode(), + SyncExceptionCause.SYNC_REGISTRATION_ERROR)); + } + + syncProxyBase.processRegisterAppInterfaceResponse(msg); + } else if ( + responseCorrelationID == syncProxyBase.POLICIES_CORRELATION_ID && + functionName.equals( + Names.OnEncodedSyncPData)) { + // OnEncodedSyncPData + + final OnEncodedSyncPData msg = + new OnEncodedSyncPData(hash); + + // If url is null, then send notification to the app, otherwise, send to URL + if (msg.getUrl() != null) { + // URL has data, attempt to post request to external server + Thread handleOffboardSyncTransmissionTread = + new Thread() { + @Override + public void run() { + syncProxyBase.sendEncodedSyncPDataToUrl( + msg.getUrl(), msg.getData(), + msg.getTimeout()); + } + }; + + handleOffboardSyncTransmissionTread.start(); + } + } else if ((responseCorrelationID == + syncProxyBase.UNREGISTER_APP_INTERFACE_CORRELATION_ID) && + functionName.equals(Names.UnregisterAppInterface)) { + syncProxyBase.onUnregisterAppInterfaceResponse(hash); + } + return; + } + + if (functionName.equals(Names.RegisterAppInterface)) { + final RegisterAppInterfaceResponse msg = + new RegisterAppInterfaceResponse(hash); + if (msg.getSuccess()) { + syncProxyBase.setAppInterfaceRegisterd(true); + } + + //_autoActivateIdReturned = msg.getAutoActivateID(); + /*Place holder for legacy support*/ + + syncProxyBase.setAutoActivateIdReturned("8675309"); + syncProxyBase.setButtonCapabilities(msg.getButtonCapabilities()); + syncProxyBase.setDisplayCapabilities(msg.getDisplayCapabilities()); + syncProxyBase.setSoftButtonCapabilities(msg.getSoftButtonCapabilities()); + syncProxyBase.setPresetBankCapabilities(msg.getPresetBankCapabilities()); + syncProxyBase.setHmiZoneCapabilities(msg.getHmiZoneCapabilities()); + syncProxyBase.setSpeechCapabilities(msg.getSpeechCapabilities()); + syncProxyBase.setSyncLanguage(msg.getLanguage()); + syncProxyBase.setHmiDisplayLanguage(msg.getHmiDisplayLanguage()); + syncProxyBase.setSyncMsgVersion(msg.getSyncMsgVersion()); + syncProxyBase.setVrCapabilities(msg.getVrCapabilities()); + syncProxyBase.setVehicleType(msg.getVehicleType()); + + + // RegisterAppInterface + if (syncProxyBase.getAdvancedLifecycleManagementEnabled()) { + syncProxyBase.setSyncConnectionState(SyncConnectionState.SYNC_CONNECTED); + + // If registerAppInterface failed, exit with OnProxyUnusable + if (!msg.getSuccess()) { + syncProxyBase.notifyProxyClosed( + "Unable to register app interface. Review values passed to the SyncProxy constructor. RegisterAppInterface result code: ", + new SyncException( + "Unable to register app interface. Review values passed to the SyncProxy constructor. RegisterAppInterface result code: " + + msg.getResultCode(), + SyncExceptionCause.SYNC_REGISTRATION_ERROR)); + } + } + syncProxyBase.processRegisterAppInterfaceResponse(msg); + } else if (functionName.equals(Names.Speak)) { + // SpeakResponse + + final SpeakResponse msg = new SpeakResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onSpeakResponse(msg); + } + }); + } else { + getProxyListener().onSpeakResponse(msg); + } + } else if (functionName.equals(Names.Alert)) { + // AlertResponse + + final AlertResponse msg = new AlertResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onAlertResponse(msg); + } + }); + } else { + getProxyListener().onAlertResponse(msg); + } + } else if (functionName.equals(Names.Show)) { + // ShowResponse + + final ShowResponse msg = new ShowResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onShowResponse( + (ShowResponse) msg); + } + }); + } else { + getProxyListener().onShowResponse((ShowResponse) msg); + } + } else if (functionName.equals(Names.AddCommand)) { + // AddCommand + final AddCommandResponse msg = new AddCommandResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onAddCommandResponse(msg); + } + }); + } else { + getProxyListener().onAddCommandResponse(msg); + } + } else if (functionName.equals(Names.DeleteCommand)) { + // DeleteCommandResponse + + final DeleteCommandResponse msg = + new DeleteCommandResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onDeleteCommandResponse( + (DeleteCommandResponse) msg); + } + }); + } else { + getProxyListener().onDeleteCommandResponse( + (DeleteCommandResponse) msg); + } + } else if (functionName.equals(Names.AddSubMenu)) { + // AddSubMenu + + final AddSubMenuResponse msg = new AddSubMenuResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onAddSubMenuResponse( + (AddSubMenuResponse) msg); + } + }); + } else { + getProxyListener().onAddSubMenuResponse( + (AddSubMenuResponse) msg); + } + } else if (functionName.equals(Names.DeleteSubMenu)) { + // DeleteSubMenu + + final DeleteSubMenuResponse msg = + new DeleteSubMenuResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onDeleteSubMenuResponse( + (DeleteSubMenuResponse) msg); + } + }); + } else { + getProxyListener().onDeleteSubMenuResponse( + (DeleteSubMenuResponse) msg); + } + } else if (functionName.equals(Names.SubscribeButton)) { + // SubscribeButton + + final SubscribeButtonResponse msg = + new SubscribeButtonResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onSubscribeButtonResponse( + (SubscribeButtonResponse) msg); + } + }); + } else { + getProxyListener().onSubscribeButtonResponse( + (SubscribeButtonResponse) msg); + } + } else if (functionName.equals(Names.UnsubscribeButton)) { + // UnsubscribeButton + + final UnsubscribeButtonResponse msg = + new UnsubscribeButtonResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onUnsubscribeButtonResponse( + (UnsubscribeButtonResponse) msg); + } + }); + } else { + getProxyListener().onUnsubscribeButtonResponse( + (UnsubscribeButtonResponse) msg); + } + } else if (functionName.equals(Names.SetMediaClockTimer)) { + // SetMediaClockTimer + + final SetMediaClockTimerResponse msg = + new SetMediaClockTimerResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onSetMediaClockTimerResponse( + (SetMediaClockTimerResponse) msg); + } + }); + } else { + getProxyListener().onSetMediaClockTimerResponse( + (SetMediaClockTimerResponse) msg); + } + } else if (functionName.equals(Names.EncodedSyncPData)) { + // EncodedSyncPData + + final EncodedSyncPDataResponse msg = + new EncodedSyncPDataResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onEncodedSyncPDataResponse(msg); + } + }); + } else { + getProxyListener().onEncodedSyncPDataResponse(msg); + } + } else if (functionName.equals(Names.SyncPData)) { + // SyncPData + + final SyncPDataResponse msg = new SyncPDataResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onSyncPDataResponse(msg); + } + }); + } else { + getProxyListener().onSyncPDataResponse(msg); + } + } else if (functionName.equals( + Names.CreateInteractionChoiceSet)) { + // CreateInteractionChoiceSet + + final CreateInteractionChoiceSetResponse msg = + new CreateInteractionChoiceSetResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onCreateInteractionChoiceSetResponse( + (CreateInteractionChoiceSetResponse) msg); + } + }); + } else { + getProxyListener().onCreateInteractionChoiceSetResponse( + (CreateInteractionChoiceSetResponse) msg); + } + } else if (functionName.equals( + Names.DeleteInteractionChoiceSet)) { + // DeleteInteractionChoiceSet + + final DeleteInteractionChoiceSetResponse msg = + new DeleteInteractionChoiceSetResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onDeleteInteractionChoiceSetResponse( + (DeleteInteractionChoiceSetResponse) msg); + } + }); + } else { + getProxyListener().onDeleteInteractionChoiceSetResponse( + (DeleteInteractionChoiceSetResponse) msg); + } + } else if (functionName.equals(Names.PerformInteraction)) { + // PerformInteraction + + final PerformInteractionResponse msg = + new PerformInteractionResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onPerformInteractionResponse( + (PerformInteractionResponse) msg); + } + }); + } else { + getProxyListener().onPerformInteractionResponse( + (PerformInteractionResponse) msg); + } + } else if (functionName.equals(Names.SetGlobalProperties)) { + final SetGlobalPropertiesResponse msg = + new SetGlobalPropertiesResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onSetGlobalPropertiesResponse( + (SetGlobalPropertiesResponse) msg); + } + }); + } else { + getProxyListener().onSetGlobalPropertiesResponse( + (SetGlobalPropertiesResponse) msg); + } + } else if (functionName.equals(Names.ResetGlobalProperties)) { + // ResetGlobalProperties + + final ResetGlobalPropertiesResponse msg = + new ResetGlobalPropertiesResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onResetGlobalPropertiesResponse( + (ResetGlobalPropertiesResponse) msg); + } + }); + } else { + getProxyListener().onResetGlobalPropertiesResponse( + (ResetGlobalPropertiesResponse) msg); + } + } else if (functionName.equals(Names.UnregisterAppInterface)) { + syncProxyBase.onUnregisterAppInterfaceResponse(hash); + } else if (functionName.equals(Names.GenericResponse)) { + // GenericResponse (Usually and error) + final GenericResponse msg = new GenericResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onGenericResponse( + (GenericResponse) msg); + } + }); + } else { + getProxyListener().onGenericResponse((GenericResponse) msg); + } + } else if (functionName.equals(Names.Slider)) { + // Slider + final SliderResponse msg = new SliderResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onSliderResponse( + (SliderResponse) msg); + } + }); + } else { + getProxyListener().onSliderResponse((SliderResponse) msg); + } + } else if (functionName.equals(Names.PutFile)) { + // PutFile + final PutFileResponse msg = new PutFileResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onPutFileResponse( + (PutFileResponse) msg); + } + }); + } else { + getProxyListener().onPutFileResponse((PutFileResponse) msg); + } + } else if (functionName.equals(Names.DeleteFile)) { + // DeleteFile + final DeleteFileResponse msg = new DeleteFileResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onDeleteFileResponse( + (DeleteFileResponse) msg); + } + }); + } else { + getProxyListener().onDeleteFileResponse( + (DeleteFileResponse) msg); + } + } else if (functionName.equals(Names.ListFiles)) { + // ListFiles + final ListFilesResponse msg = new ListFilesResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onListFilesResponse( + (ListFilesResponse) msg); + } + }); + } else { + getProxyListener().onListFilesResponse( + (ListFilesResponse) msg); + } + } else if (functionName.equals(Names.SetAppIcon)) { + // SetAppIcon + final SetAppIconResponse msg = new SetAppIconResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onSetAppIconResponse( + (SetAppIconResponse) msg); + } + }); + } else { + getProxyListener().onSetAppIconResponse( + (SetAppIconResponse) msg); + } + } else if (functionName.equals(Names.ScrollableMessage)) { + // ScrollableMessage + final ScrollableMessageResponse msg = + new ScrollableMessageResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onScrollableMessageResponse( + (ScrollableMessageResponse) msg); + } + }); + } else { + getProxyListener().onScrollableMessageResponse( + (ScrollableMessageResponse) msg); + } + } else if (functionName.equals(Names.ChangeRegistration)) { + // ChangeLanguageRegistration + final ChangeRegistrationResponse msg = + new ChangeRegistrationResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onChangeRegistrationResponse( + (ChangeRegistrationResponse) msg); + } + }); + } else { + getProxyListener().onChangeRegistrationResponse( + (ChangeRegistrationResponse) msg); + } + } else if (functionName.equals(Names.SetDisplayLayout)) { + // SetDisplayLayout + final SetDisplayLayoutResponse msg = + new SetDisplayLayoutResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onSetDisplayLayoutResponse( + (SetDisplayLayoutResponse) msg); + } + }); + } else { + getProxyListener().onSetDisplayLayoutResponse( + (SetDisplayLayoutResponse) msg); + } + } else if (functionName.equals(Names.PerformAudioPassThru)) { + // PerformAudioPassThru + final PerformAudioPassThruResponse msg = + new PerformAudioPassThruResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onPerformAudioPassThruResponse( + (PerformAudioPassThruResponse) msg); + } + }); + } else { + getProxyListener().onPerformAudioPassThruResponse( + (PerformAudioPassThruResponse) msg); + } + } else if (functionName.equals(Names.EndAudioPassThru)) { + // EndAudioPassThru + final EndAudioPassThruResponse msg = + new EndAudioPassThruResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onEndAudioPassThruResponse( + (EndAudioPassThruResponse) msg); + } + }); + } else { + getProxyListener().onEndAudioPassThruResponse( + (EndAudioPassThruResponse) msg); + } + } else if (functionName.equals(Names.SubscribeVehicleData)) { + // SubscribeVehicleData + final SubscribeVehicleDataResponse msg = + new SubscribeVehicleDataResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onSubscribeVehicleDataResponse( + (SubscribeVehicleDataResponse) msg); + } + }); + } else { + getProxyListener().onSubscribeVehicleDataResponse( + (SubscribeVehicleDataResponse) msg); + } + } else if (functionName.equals(Names.UnsubscribeVehicleData)) { + // UnsubscribeVehicleData + final UnsubscribeVehicleDataResponse msg = + new UnsubscribeVehicleDataResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onUnsubscribeVehicleDataResponse( + (UnsubscribeVehicleDataResponse) msg); + } + }); + } else { + getProxyListener().onUnsubscribeVehicleDataResponse( + (UnsubscribeVehicleDataResponse) msg); + } + } else if (functionName.equals(Names.GetVehicleData)) { + // GetVehicleData + final GetVehicleDataResponse msg = + new GetVehicleDataResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onGetVehicleDataResponse( + (GetVehicleDataResponse) msg); + } + }); + } else { + getProxyListener().onGetVehicleDataResponse( + (GetVehicleDataResponse) msg); + } + } else if (functionName.equals(Names.ReadDID)) { + // ReadDID + final ReadDIDResponse msg = new ReadDIDResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onReadDIDResponse( + (ReadDIDResponse) msg); + } + }); + } else { + getProxyListener().onReadDIDResponse((ReadDIDResponse) msg); + } + } else if (functionName.equals(Names.GetDTCs)) { + // GetDTCs + final GetDTCsResponse msg = new GetDTCsResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onGetDTCsResponse( + (GetDTCsResponse) msg); + } + }); + } else { + getProxyListener().onGetDTCsResponse((GetDTCsResponse) msg); + } + } else if (functionName.equals(Names.AlertManeuver)) { + // AlertManeuver + final AlertManeuverResponse msg = + new AlertManeuverResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onAlertManeuverResponse( + (AlertManeuverResponse) msg); + } + }); + } else { + getProxyListener().onAlertManeuverResponse( + (AlertManeuverResponse) msg); + } + } else if (functionName.equals(Names.ShowConstantTBT)) { + // ShowConstantTBT + final ShowConstantTBTResponse msg = + new ShowConstantTBTResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onShowConstantTBTResponse( + (ShowConstantTBTResponse) msg); + } + }); + } else { + getProxyListener().onShowConstantTBTResponse( + (ShowConstantTBTResponse) msg); + } + } else if (functionName.equals(Names.UpdateTurnList)) { + // UpdateTurnList + final UpdateTurnListResponse msg = + new UpdateTurnListResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onUpdateTurnListResponse( + (UpdateTurnListResponse) msg); + } + }); + } else { + getProxyListener().onUpdateTurnListResponse( + (UpdateTurnListResponse) msg); + } + } else if (functionName.equals(Names.SystemRequest)) { + final SystemRequestResponse msg = + new SystemRequestResponse(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onSystemRequestResponse(msg); + } + }); + } else { + getProxyListener().onSystemRequestResponse(msg); + } + } else { + try { + if (syncProxyBase.getSyncMsgVersion() != null) { + DebugTool.logError("Unrecognized response Message: " + + functionName.toString() + + "SYNC Message Version = " + syncProxyBase.getSyncMsgVersion()); + } else { + DebugTool.logError("Unrecognized response Message: " + + functionName.toString()); + } + } catch (SyncException e) { + e.printStackTrace(); + } + } // end-if + + } + } else if (messageType.equals(Names.notification)) { + SyncTrace.logRPCEvent(InterfaceActivityDirection.Receive, new RPCNotification(rpcMsg), SyncProxyBase.SYNC_LIB_TRACE_KEY); + if (functionName.equals(Names.OnHMIStatus)) { + // OnHMIStatus + + final OnHMIStatus msg = new OnHMIStatus(hash); + msg.setFirstRun(new Boolean(syncProxyBase.getFirstTimeFull())); + if (msg.getHmiLevel() == HMILevel.HMI_FULL) syncProxyBase.setFirstTimeFull(false); + + if (msg.getHmiLevel() != syncProxyBase.getPriorHmiLevel() && msg.getAudioStreamingState() != syncProxyBase.getPriorAudioStreamingState()) { + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnHMIStatus(msg); + } + }); + } else { + getProxyListener().onOnHMIStatus(msg); + } + } + } else if (functionName.equals(Names.OnCommand)) { + // OnCommand + + final OnCommand msg = new OnCommand(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnCommand(msg); + } + }); + } else { + getProxyListener().onOnCommand(msg); + } + } else if (functionName.equals(Names.OnDriverDistraction)) { + // OnDriverDistration + + final OnDriverDistraction msg = new OnDriverDistraction(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnDriverDistraction(msg); + } + }); + } else { + getProxyListener().onOnDriverDistraction(msg); + } + } else if (functionName.equals(Names.OnEncodedSyncPData)) { + // OnEncodedSyncPData + + final OnEncodedSyncPData msg = new OnEncodedSyncPData(hash); + + // If url is null, then send notification to the app, otherwise, send to URL + if (msg.getUrl() == null) { + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnEncodedSyncPData(msg); + } + }); + } else { + getProxyListener().onOnEncodedSyncPData(msg); + } + } else { + // URL has data, attempt to post request to external server + Thread handleOffboardSyncTransmissionTread = new Thread() { + @Override + public void run() { + syncProxyBase.sendEncodedSyncPDataToUrl(msg.getUrl(), msg.getData(), msg.getTimeout()); + } + }; + + handleOffboardSyncTransmissionTread.start(); + } + } else if (functionName.equals(Names.OnSyncPData)) { + // OnSyncPData + Log.i("pt", "functionName.equals(Names.OnEncodedSyncPData)"); + final OnSyncPData msg = new OnSyncPData(hash); + + // If url is null, then send notification to the app, otherwise, send to URL + if (msg.getUrl() == null) { + Log.i("pt", "send syncp to app"); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnSyncPData(msg); + } + }); + } else { + getProxyListener().onOnSyncPData(msg); + } + } else { //url not null, send to url + Log.i("pt", "send syncp to url"); + // URL has data, attempt to post request to external server + Thread handleOffboardSyncTransmissionTread = new Thread() { + @Override + public void run() { + syncProxyBase.sendSyncPDataToUrl(msg.getUrl(), msg.getSyncPData(), msg.getTimeout()); + } + }; + + handleOffboardSyncTransmissionTread.start(); + } + } else if (functionName.equals(Names.OnPermissionsChange)) { + //OnPermissionsChange + + final OnPermissionsChange msg = new OnPermissionsChange(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnPermissionsChange(msg); + } + }); + } else { + getProxyListener().onOnPermissionsChange(msg); + } + } else if (functionName.equals(Names.OnTBTClientState)) { + // OnTBTClientState + + final OnTBTClientState msg = new OnTBTClientState(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnTBTClientState(msg); + } + }); + } else { + getProxyListener().onOnTBTClientState(msg); + } + } else if (functionName.equals(Names.OnButtonPress)) { + // OnButtonPress + + final OnButtonPress msg = new OnButtonPress(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnButtonPress(msg); + } + }); + } else { + getProxyListener().onOnButtonPress(msg); + } + } else if (functionName.equals(Names.OnButtonEvent)) { + // OnButtonEvent + + final OnButtonEvent msg = new OnButtonEvent(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnButtonEvent(msg); + } + }); + } else { + getProxyListener().onOnButtonEvent(msg); + } + } else if (functionName.equals(Names.OnLanguageChange)) { + // OnLanguageChange + + final OnLanguageChange msg = new OnLanguageChange(hash); + syncProxyBase.setLastLanguageChange(msg); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnLanguageChange(msg); + } + }); + } else { + getProxyListener().onOnLanguageChange(msg); + } + } else if (functionName.equals(Names.OnAudioPassThru)) { + // OnAudioPassThru + final OnAudioPassThru msg = new OnAudioPassThru(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnAudioPassThru(msg); + } + }); + } else { + getProxyListener().onOnAudioPassThru(msg); + } + } else if (functionName.equals(Names.OnVehicleData)) { + // OnVehicleData + final OnVehicleData msg = new OnVehicleData(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnVehicleData(msg); + } + }); + } else { + getProxyListener().onOnVehicleData(msg); + } + } else if (functionName.equals(Names.OnTouchEvent)) { + // OnTouchEvent + final OnTouchEvent msg = new OnTouchEvent(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onOnTouchEvent(msg); + } + }); + } else { + getProxyListener().onOnTouchEvent(msg); + } + } else if (functionName.equals(Names.OnKeyboardInput)) { + // OnKeyboardInput + final OnKeyboardInput msg = new OnKeyboardInput(hash); + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onKeyboardInput(msg); + } + }); + } else { + getProxyListener().onKeyboardInput(msg); + } + } else if (functionName.equals(Names.OnSystemRequest)) { + syncProxyBase.handleOnSystemRequest(hash); + } else if (functionName.equals(Names.OnAppInterfaceUnregistered)) { + // OnAppInterfaceUnregistered + syncProxyBase.setAppInterfaceRegisterd(false); + synchronized (syncProxyBase.APP_INTERFACE_REGISTERED_LOCK) { + syncProxyBase.APP_INTERFACE_REGISTERED_LOCK.notify(); + } + + final OnAppInterfaceUnregistered msg = new OnAppInterfaceUnregistered(hash); + + if (syncProxyBase.getAdvancedLifecycleManagementEnabled()) { + if (msg.getReason() == AppInterfaceUnregisteredReason.LANGUAGE_CHANGE) { + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onAppUnregisteredAfterLanguageChange(syncProxyBase.getLastLanguageChange()); + } + }); + } else { + getProxyListener().onAppUnregisteredAfterLanguageChange(syncProxyBase.getLastLanguageChange()); + } + } else if (msg.getReason() != null) { + syncProxyBase.onAppUnregisteredReason(msg.getReason()); + } else { + // This requires the proxy to be cycled + if (syncProxyBase.getCurrentTransportType() == TransportType.BLUETOOTH) { + syncProxyBase.cycleProxy(SyncDisconnectedReason.convertAppInterfaceUnregisteredReason(msg.getReason())); + } else { + Log.e(this.getClass().getName(), "HandleRPCMessage. No cycle required if transport is TCP"); + } + syncProxyBase.notifyOnAppInterfaceUnregistered(msg); + } + } else { + syncProxyBase.notifyOnAppInterfaceUnregistered(msg); + } + } else if (functionName.equals(Names.OnHashChange)) { + // OnHashChange + final OnHashChange onHashChange = new OnHashChange(hash); + + syncProxyBase.setHashId(onHashChange.getHashID()); + + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onHashChange(onHashChange); + } + }); + } else { + getProxyListener().onHashChange(onHashChange); + } + } else { + try { + if (syncProxyBase.getSyncMsgVersion() != null) { + DebugTool.logInfo("Unrecognized notification Message: " + functionName.toString() + + " connected to SYNC using message version: " + syncProxyBase.getSyncMsgVersion().getMajorVersion() + "." + syncProxyBase.getSyncMsgVersion().getMinorVersion()); + } else { + DebugTool.logInfo("Unrecognized notification Message: " + functionName.toString()); + } + } catch (SyncException e) { + e.printStackTrace(); + } + } + } + + SyncTrace.logProxyEvent("Proxy received RPC Message: " + functionName, SyncProxyBase.SYNC_LIB_TRACE_KEY); + } + + private Handler getMainUIHandler() { + return syncProxyBase.getMainUIHandler(); + } + + private IProxyListenerBase getProxyListener() { + return syncProxyBase.getProxyListener(); + } + + private Boolean getCallbackToUIThread() { + return syncProxyBase.getCallbackToUIThread(); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCNotification.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCNotification.java new file mode 100644 index 000000000..dc50900ea --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCNotification.java @@ -0,0 +1,21 @@ +/**
+ *
+ */
+package com.ford.syncV4.proxy;
+
+import java.util.Hashtable;
+
+public class RPCNotification extends RPCMessage {
+
+ public RPCNotification(String functionName) {
+ super(functionName, "notification");
+ }
+
+ public RPCNotification(Hashtable hash) {
+ super(hash);
+ }
+
+ public RPCNotification(RPCMessage rpcMsg) {
+ super(rpcMsg);
+ }
+} // end-class
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCRequest.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCRequest.java new file mode 100644 index 000000000..ae8f9d91a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCRequest.java @@ -0,0 +1,38 @@ +/**
+ *
+ */
+package com.ford.syncV4.proxy;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.constants.Names;
+
+public class RPCRequest extends RPCMessage {
+
+ public RPCRequest(String functionName) {
+ super(functionName, "request");
+ messageType = Names.request;
+ }
+
+ public RPCRequest(Hashtable hash) {
+ super(hash);
+ }
+
+ public RPCRequest(RPCRequest that) {
+ // FIXME test this!
+ super(that);
+ this.setCorrelationID(that.getCorrelationID());
+ }
+
+ public Integer getCorrelationID() {
+ return (Integer)function.get(Names.correlationID);
+ }
+
+ public void setCorrelationID(Integer correlationID) {
+ if (correlationID != null) {
+ function.put(Names.correlationID, correlationID );
+ } else if (parameters.contains(Names.correlationID)) {
+ function.remove(Names.correlationID);
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCRequestFactory.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCRequestFactory.java new file mode 100644 index 000000000..5a8e932c8 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCRequestFactory.java @@ -0,0 +1,673 @@ +package com.ford.syncV4.proxy;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.rpc.AddCommand;
+import com.ford.syncV4.proxy.rpc.AddSubMenu;
+import com.ford.syncV4.proxy.rpc.Alert;
+import com.ford.syncV4.proxy.rpc.Choice;
+import com.ford.syncV4.proxy.rpc.CreateInteractionChoiceSet;
+import com.ford.syncV4.proxy.rpc.DeleteCommand;
+import com.ford.syncV4.proxy.rpc.DeleteFile;
+import com.ford.syncV4.proxy.rpc.DeleteInteractionChoiceSet;
+import com.ford.syncV4.proxy.rpc.DeleteSubMenu;
+import com.ford.syncV4.proxy.rpc.EncodedSyncPData;
+import com.ford.syncV4.proxy.rpc.ListFiles;
+import com.ford.syncV4.proxy.rpc.MenuParams;
+import com.ford.syncV4.proxy.rpc.PerformInteraction;
+import com.ford.syncV4.proxy.rpc.PutFile;
+import com.ford.syncV4.proxy.rpc.RegisterAppInterface;
+import com.ford.syncV4.proxy.rpc.SetAppIcon;
+import com.ford.syncV4.proxy.rpc.SetGlobalProperties;
+import com.ford.syncV4.proxy.rpc.SetMediaClockTimer;
+import com.ford.syncV4.proxy.rpc.Show;
+import com.ford.syncV4.proxy.rpc.Speak;
+import com.ford.syncV4.proxy.rpc.StartTime;
+import com.ford.syncV4.proxy.rpc.SubscribeButton;
+import com.ford.syncV4.proxy.rpc.SubscribeVehicleData;
+import com.ford.syncV4.proxy.rpc.SyncMsgVersion;
+import com.ford.syncV4.proxy.rpc.SyncPData;
+import com.ford.syncV4.proxy.rpc.TTSChunk;
+import com.ford.syncV4.proxy.rpc.UnregisterAppInterface;
+import com.ford.syncV4.proxy.rpc.UnsubscribeButton;
+import com.ford.syncV4.proxy.rpc.enums.AppHMIType;
+import com.ford.syncV4.proxy.rpc.enums.ButtonName;
+import com.ford.syncV4.proxy.rpc.enums.FileType;
+import com.ford.syncV4.proxy.rpc.enums.InteractionMode;
+import com.ford.syncV4.proxy.rpc.enums.Language;
+import com.ford.syncV4.proxy.rpc.enums.TextAlignment;
+import com.ford.syncV4.proxy.rpc.enums.UpdateMode;
+
+public class RPCRequestFactory {
+
+ public static final int NGN_MEDIA_SCREEN_APP_NAME_MAX_LENGTH = 5;
+ public static final int SYNC_MSG_MAJOR_VERSION = 1;
+ public static final int SYNC_MSG_MINOR_VERSION = 0;
+
+ public static EncodedSyncPData buildEncodedSyncPData(
+ Vector<String> data, Integer correlationID) {
+
+ if(data == null) return null;
+
+ EncodedSyncPData msg = new EncodedSyncPData();
+ msg.setCorrelationID(correlationID);
+ msg.setData(data);
+ return msg;
+ }
+
+ public static SyncPData buildSyncPData(
+ byte[] data, Integer correlationID) {
+
+ if(data == null) return null;
+
+ SyncPData msg = new SyncPData();
+ msg.setCorrelationID(correlationID);
+ msg.setSyncPData(data);
+ return msg;
+ }
+
+ /**
+ * AddCommand section
+ */
+
+ /**
+ * Build <b>AddCommand</b> empty object
+ *
+ * @return created empty <b>AddCommand</b> object
+ */
+ public static AddCommand buildAddCommand() {
+ return new AddCommand();
+ }
+
+ public static AddCommand buildAddCommand(Integer commandID,
+ String menuText, Integer parentID, Integer position,
+ Vector<String> vrCommands, Integer correlationID) {
+ AddCommand addCommand = new AddCommand();
+ addCommand.setCorrelationID(correlationID);
+ addCommand.setCmdID(commandID);
+ addCommand.setVrCommands(vrCommands);
+
+ if (menuText != null || parentID != null || position != null) {
+ MenuParams menuParams = new MenuParams();
+ menuParams.setMenuName(menuText);
+ menuParams.setPosition(position);
+ menuParams.setParentID(parentID);
+ addCommand.setMenuParams(menuParams);
+ }
+
+ return addCommand;
+ }
+
+ public static AddCommand buildAddCommand(Integer commandID,
+ String menuText, Vector<String> vrCommands, Integer correlationID) {
+ AddCommand addCommand = buildAddCommand(commandID, menuText, null, null,
+ vrCommands, correlationID);
+ return addCommand;
+ }
+
+ public static AddCommand buildAddCommand(Integer commandID,
+ Vector<String> vrCommands, Integer correlationID) {
+ AddCommand addCommand = new AddCommand();
+ addCommand.setCorrelationID(correlationID);
+ addCommand.setCmdID(commandID);
+ addCommand.setVrCommands(vrCommands);
+
+ return addCommand;
+ }
+
+ /**
+ * AddSubMenu section
+ */
+
+ /**
+ * Build <b>AddSubMenu</b> empty object
+ *
+ * @return created empty <b>AddSubMenu</b> object
+ */
+ public static AddSubMenu buildAddSubMenu() {
+ return new AddSubMenu();
+ }
+
+ public static AddSubMenu buildAddSubMenu(Integer menuID, String menuName,
+ Integer correlationID) {
+ AddSubMenu addSubMenu = buildAddSubMenu(menuID, menuName, null, correlationID);
+ return addSubMenu;
+ }
+
+ public static AddSubMenu buildAddSubMenu(Integer menuID, String menuName,
+ Integer position, Integer correlationID) {
+ AddSubMenu addSubMenu = new AddSubMenu();
+ addSubMenu.setCorrelationID(correlationID);
+ addSubMenu.setMenuName(menuName);
+ addSubMenu.setMenuID(menuID);
+ addSubMenu.setPosition(position);
+
+ return addSubMenu;
+ }
+
+ 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;
+ }
+
+ /**
+ * CreateInteractionChoiceSet section
+ */
+
+ /**
+ * Build empty <b>CreateInteractionChoiceSet</b> request object
+ *
+ * @return an empty <b>CreateInteractionChoiceSet</b> request object
+ */
+ public static CreateInteractionChoiceSet buildCreateInteractionChoiceSet() {
+ return new CreateInteractionChoiceSet();
+ }
+
+ /**
+ * Build <b>CreateInteractionChoiceSet</b> request
+ *
+ * @param choiceSet Vector of {@link com.ford.syncV4.proxy.rpc.Choice} objects
+ * @param interactionChoiceSetID Id of the interaction choice set
+ * @param correlationID Correlation Id of the request
+ * @return instance of the <b>CreateInteractionChoiceSet</b> request
+ */
+ public static CreateInteractionChoiceSet buildCreateInteractionChoiceSet(
+ Vector<Choice> choiceSet, Integer interactionChoiceSetID,
+ Integer correlationID) {
+ CreateInteractionChoiceSet createInteractionChoiceSet = new CreateInteractionChoiceSet();
+ createInteractionChoiceSet.setChoiceSet(choiceSet);
+ createInteractionChoiceSet.setInteractionChoiceSetID(interactionChoiceSetID);
+ createInteractionChoiceSet.setCorrelationID(correlationID);
+ return createInteractionChoiceSet;
+ }
+
+ 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 syncFileName,
+ Integer correlationID) {
+ DeleteFile deleteFile = new DeleteFile();
+ deleteFile.setCorrelationID(correlationID);
+ deleteFile.setSyncFileName(syncFileName);
+ 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,
+ 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;
+ }
+
+ /**
+ * PutFile section
+ */
+
+ /**
+ * Build empty <b>PutFile</b> object
+ * @return empty <b>PutFile</b> object
+ */
+ public static PutFile buildPutFile() {
+ PutFile putFile = new PutFile();
+ return putFile;
+ }
+
+ /**
+ * Build <b>PutFile</b> object with provided parameters
+ *
+ * @param syncFileName File name
+ * @param fileType File type {@link com.ford.syncV4.proxy.rpc.enums.FileType}
+ * @param persistentFile Boolean value indicated whether this file is persistent or not
+ * @param fileData Raw file data
+ * @param correlationID Correlation Id of the object
+ * @return <b>PutFile</b> object
+ */
+ public static PutFile buildPutFile(String syncFileName, FileType fileType,
+ Boolean persistentFile, byte[] fileData, Integer correlationID) {
+ PutFile putFile = new PutFile();
+ putFile.setCorrelationID(correlationID);
+ putFile.setSyncFileName(syncFileName);
+ putFile.setFileType(fileType);
+ if (persistentFile != null) {
+ putFile.setPersistentFile(persistentFile);
+ }
+ putFile.setBulkData(fileData);
+ return putFile;
+ }
+
+ public static RegisterAppInterface buildRegisterAppInterface(String appName) {
+ return buildRegisterAppInterface(appName, false);
+ }
+
+ public static RegisterAppInterface buildRegisterAppInterface(
+ String appName, Boolean isMediaApp) {
+
+ return buildRegisterAppInterface(null, appName, null, null, null, isMediaApp,
+ null, null, null, null, null, null);
+ }
+
+ public static RegisterAppInterface buildRegisterAppInterface(
+ SyncMsgVersion syncMsgVersion, String appName, Vector<TTSChunk> ttsName,
+ String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appHMIType,
+ String appID, Integer correlationID, String hashId) {
+ RegisterAppInterface msg = new RegisterAppInterface();
+
+ if (correlationID == null) {
+ correlationID = 1;
+ }
+ msg.setCorrelationID(correlationID);
+
+ if (syncMsgVersion == null) {
+ syncMsgVersion = new SyncMsgVersion();
+ syncMsgVersion.setMajorVersion(new Integer(SYNC_MSG_MAJOR_VERSION));
+ syncMsgVersion.setMinorVersion(new Integer(SYNC_MSG_MINOR_VERSION));
+ }
+ msg.setSyncMsgVersion(syncMsgVersion);
+
+ msg.setAppName(appName);
+
+ msg.setTtsName(ttsName);
+
+ if (ngnMediaScreenAppName == null) {
+ ngnMediaScreenAppName = appName;
+ }
+
+ if (ngnMediaScreenAppName.length() > NGN_MEDIA_SCREEN_APP_NAME_MAX_LENGTH) {
+ ngnMediaScreenAppName = ngnMediaScreenAppName.substring(0,
+ NGN_MEDIA_SCREEN_APP_NAME_MAX_LENGTH);
+ }
+ 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);
+
+ msg.setHmiDisplayLanguageDesired(hmiDisplayLanguageDesired);
+
+ msg.setAppType(appHMIType);
+
+ msg.setAppID(appID);
+
+ if (hashId != null) {
+ msg.setHashID(hashId);
+ }
+
+ return msg;
+ }
+
+ /**
+ * <b>SetAppIcon</b> section
+ */
+
+ /**
+ * Build an empty {@link com.ford.syncV4.proxy.rpc.SetAppIcon} request
+ *
+ * @return {@link com.ford.syncV4.proxy.rpc.SetAppIcon} request object
+ */
+ public static SetAppIcon buildSetAppIcon() {
+ return new SetAppIcon();
+ }
+
+ /**
+ * Build {@link com.ford.syncV4.proxy.rpc.SetAppIcon} request
+ *
+ * @param syncFileName name of the file
+ * @param correlationID correlation id of the request
+ * @return {@link com.ford.syncV4.proxy.rpc.SetAppIcon} request object
+ */
+ public static SetAppIcon buildSetAppIcon(String syncFileName, Integer correlationID) {
+ SetAppIcon setAppIcon = new SetAppIcon();
+ setAppIcon.setCorrelationID(correlationID);
+ setAppIcon.setSyncFileName(syncFileName);
+ return setAppIcon;
+ }
+
+ /**
+ * <b>SetGlobalProperties</b> section
+ *
+ */
+
+ /**
+ * Build {@link com.ford.syncV4.proxy.rpc.SetGlobalProperties} request
+ *
+ * @param helpPrompt
+ * @param timeoutPrompt
+ * @param correlationID Correlation Id of the request
+ * @return {@link com.ford.syncV4.proxy.rpc.SetGlobalProperties} request object
+ */
+ public static SetGlobalProperties buildSetGlobalProperties(String helpPrompt,
+ String timeoutPrompt,
+ Integer correlationID) {
+ return buildSetGlobalProperties(TTSChunkFactory
+ .createSimpleTTSChunks(helpPrompt), TTSChunkFactory
+ .createSimpleTTSChunks(timeoutPrompt), correlationID);
+ }
+
+ /**
+ * Build {@link com.ford.syncV4.proxy.rpc.SetGlobalProperties} request
+ *
+ * @param helpChunks
+ * @param timeoutChunks
+ * @param correlationID
+ * @return {@link com.ford.syncV4.proxy.rpc.SetGlobalProperties} request object
+ */
+ 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;
+ }
+
+ /**
+ * Build an empty {@link com.ford.syncV4.proxy.rpc.SetGlobalProperties} request
+ *
+ * @return {@link com.ford.syncV4.proxy.rpc.SetGlobalProperties} request object
+ */
+ public static SetGlobalProperties buildSetGlobalProperties() {
+ return new SetGlobalProperties();
+ }
+
+ 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;
+ }
+
+ 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;
+ }
+
+ /**
+ * <b>SubscribeButton</b> section
+ *
+ */
+
+ /**
+ * Create {@link com.ford.syncV4.proxy.rpc.SubscribeButton} request
+ *
+ * @param buttonName Name of the button
+ * @param correlationID Correlation Id of the request
+ * @return {@link com.ford.syncV4.proxy.rpc.SubscribeButton} request
+ */
+ public static SubscribeButton buildSubscribeButton(ButtonName buttonName,
+ Integer correlationID) {
+
+ SubscribeButton msg = new SubscribeButton();
+ msg.setCorrelationID(correlationID);
+ msg.setButtonName(buttonName);
+
+ return msg;
+ }
+
+ /**
+ * Create an empty {@link com.ford.syncV4.proxy.rpc.SubscribeButton} request
+ *
+ * @return {@link com.ford.syncV4.proxy.rpc.SubscribeButton} request
+ */
+ public static SubscribeButton buildSubscribeButton() {
+ return new SubscribeButton();
+ }
+
+ /**
+ * <b>SubscribeVehicleData</b> section
+ *
+ */
+
+ /**
+ * Create an empty {@link com.ford.syncV4.proxy.rpc.SubscribeVehicleData} request
+ *
+ * @return {@link com.ford.syncV4.proxy.rpc.SubscribeVehicleData} request
+ */
+ public static SubscribeVehicleData buildSubscribeVehicleData() {
+ return new SubscribeVehicleData();
+ }
+
+ 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;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCResponse.java new file mode 100644 index 000000000..7c0754134 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCResponse.java @@ -0,0 +1,79 @@ +/**
+ *
+ */
+package com.ford.syncV4.proxy;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.Result;
+import com.ford.syncV4.util.DebugTool;
+
+public class RPCResponse extends RPCMessage {
+
+ public RPCResponse(String functionName) {
+ super(functionName, "response");
+ }
+
+ public RPCResponse(Hashtable hash) {
+ super(hash);
+ }
+
+ public RPCResponse(RPCMessage rpcMsg) {
+ super(rpcMsg);
+ }
+
+ public Integer getCorrelationID() {
+ return (Integer)function.get(Names.correlationID);
+ }
+
+ public void setCorrelationID(Integer correlationID) {
+ if (correlationID != null) {
+ function.put(Names.correlationID, correlationID );
+ } else if (parameters.contains(Names.correlationID)){
+ function.remove(Names.correlationID);
+ }
+ }
+
+ public Boolean getSuccess() {
+ return (Boolean) parameters.get( Names.success );
+ }
+
+ public void setSuccess( Boolean success ) {
+ if (success != null) {
+ parameters.put(Names.success, success );
+ }
+ }
+
+ public Result getResultCode() {
+ Object obj = parameters.get(Names.resultCode);
+ if (obj instanceof Result) {
+ return (Result) obj;
+ } else if (obj instanceof String) {
+ Result theCode = null;
+ try {
+ theCode = Result.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.resultCode, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+
+ public void setResultCode( Result resultCode ) {
+ if (resultCode != null) {
+ parameters.put(Names.resultCode, resultCode );
+ }
+ }
+
+ public String getInfo() {
+ return (String) parameters.get( Names.info );
+ }
+
+ public void setInfo( String info ) {
+ if (info != null) {
+ parameters.put(Names.info, info );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCStruct.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCStruct.java new file mode 100644 index 000000000..4b35002f6 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/RPCStruct.java @@ -0,0 +1,109 @@ +package com.ford.syncV4.proxy;
+
+import java.util.Hashtable;
+import java.util.Set;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import com.ford.syncV4.marshal.JsonRPCMarshaller;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class RPCStruct {
+
+ private byte[] _bulkData = null;
+
+ protected Hashtable<String, Object> store = null;
+
+ public RPCStruct() {
+ store = new Hashtable<String, Object>();
+ }
+
+ protected RPCStruct(RPCStruct rpcs) {
+ this.store = rpcs.store;
+ }
+
+ public RPCStruct(Hashtable<String, Object> hashtable) {
+ store = hashtable;
+ //store = (Hashtable<String, Object>) ObjectCopier.copy(hashtable);
+ }
+
+ public void deserializeJSON(JSONObject jsonObject) throws JSONException {
+ store = JsonRPCMarshaller.deserializeJSONObject(jsonObject);
+ }
+
+ // deserializeJSONObject method moved to JsonRPCMarshaller for consistency
+ // Keep reference here for backwards compatibility
+ @Deprecated
+ public static Hashtable<String, Object> deserializeJSONObject(JSONObject jsonObject)
+ throws JSONException {
+ return JsonRPCMarshaller.deserializeJSONObject(jsonObject);
+ }
+
+ public JSONObject serializeJSON() throws JSONException {
+ return JsonRPCMarshaller.serializeHashtable(store);
+ }
+
+ public JSONObject serializeJSON(byte version) throws JSONException {
+ if (version == 2) {
+ String messageType = getMessageTypeName(store.keySet());
+ Hashtable function = (Hashtable) store.get(messageType);
+ Hashtable parameters = (Hashtable) function.get(Names.parameters);
+ return JsonRPCMarshaller.serializeHashtable(parameters);
+ //Hashtable hashToSend = new Hashtable();
+ //hashToSend.put(Names.parameters, parameters);
+ //return JsonRPCMarshaller.serializeHashtable(hashToSend);
+ } else {
+ return JsonRPCMarshaller.serializeHashtable(store);
+ }
+ }
+
+ public byte[] getBulkData() {
+ return this._bulkData;
+ }
+
+ public void setBulkData(byte[] bulkData) {
+ if (bulkData != null) {
+ this._bulkData = new byte[bulkData.length];
+ System.arraycopy(bulkData, 0, _bulkData, 0, bulkData.length);
+ //this._bulkData = bulkData;
+ }
+ }
+
+ /**
+ * Workaround method to get RPC message type from a table.
+ *
+ * @param keys Set of the keys in the Table
+ * @return founded value or null
+ */
+ protected String getMessageTypeName(Set<String> keys) {
+ for (String key : keys) {
+ if (key == null) {
+ continue;
+ }
+ if (key.equals(Names.request) || key.equals(Names.response) ||
+ key.equals(Names.notification)) {
+ return key;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Method to check whether provided key contains in the Table
+ *
+ * @param keys Set of the keys in the Table
+ * @return true if found, else - otherwise
+ */
+ protected boolean hasKey(Set<String> keys, String keyName) {
+ for (String key : keys) {
+ if (key == null) {
+ continue;
+ }
+ if (key.equals(keyName)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxy.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxy.java new file mode 100644 index 000000000..57af47637 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxy.java @@ -0,0 +1,355 @@ +package com.ford.syncV4.proxy; + +import java.util.Vector; + +import com.ford.syncV4.exception.SyncException; +import com.ford.syncV4.exception.SyncExceptionCause; +import com.ford.syncV4.proxy.rpc.SyncMsgVersion; +import com.ford.syncV4.proxy.rpc.enums.Language; +import com.ford.syncV4.trace.SyncTrace; +import com.ford.syncV4.transport.BTTransportConfig; +import com.ford.syncV4.transport.BaseTransportConfig; +import com.ford.syncV4.transport.TransportType; +import com.ford.syncV4.util.TestConfig; + +public class SyncProxy extends SyncProxyBase<IProxyListener> { + + private static final String SYNC_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66"; + private static final String SYNC_LIB_PRIVATE_TOKEN = "{DAE1A88C-6C16-4768-ACA5-6F1247EA01C2}"; + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC. + * + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @throws SyncException + */ + public SyncProxy(IProxyListener listener) throws SyncException { + super( listener, + /*application context*/null, + /*enable advanced lifecycle management*/false, + /*app name*/ null, + /*TTS Name*/null, + /*ngn media screen app name*/null, + /*vr synonyms*/null, + /*is media app*/ null, + /*syncMsgVersion*/null, + /*language desired*/null, + /*HMI Display Language Desired*/null, + /*App Type*/null, + /*App ID*/null, + /*autoActivateID*/null, + /*callbackToUIThread*/ true, + new BTTransportConfig(), new TestConfig()); + + SyncTrace.logProxyEvent("Application constructed SyncProxy instance passing in: IProxyListener.", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC. + * + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @throws SyncException + */ + public SyncProxy(IProxyListener listener, SyncProxyConfigurationResources syncProxyConfigurationResources) + throws SyncException { + super( listener, + syncProxyConfigurationResources, + /*enable advanced lifecycle management*/false, + /*app name*/ null, + /*TTS Name*/null, + /*ngn media screen app name*/null, + /*vr synonyms*/null, + /*is media app*/ null, + /*syncMsgVersion*/null, + /*language desired*/null, + /*HMI Display Language Desired*/null, + /*App Type*/null, + /*App ID*/null, + /*autoActivateID*/null, + /*callbackToUIThread*/ true, + new BTTransportConfig(), new TestConfig()); + + SyncTrace.logProxyEvent("Application constructed SyncProxy instance passing in: IProxyListener, SyncProxyConfigurationResources.", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC. + * + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @param callbackToUIThread - If true, all callbacks will occur on the UI thread. + * @throws SyncException + */ + public SyncProxy(IProxyListener listener, boolean callbackToUIThread) throws SyncException { + super( listener, + /*sync proxy configuration resources*/null, + /*enable advanced lifecycle management*/false, + /*app name*/ null, + /*TTS Name*/null, + /*ngn media screen app name*/null, + /*vr synonyms*/null, + /*is media app*/ null, + /*syncMsgVersion*/null, + /*language desired*/null, + /*HMI Display Language Desired*/null, + /*App Type*/null, + /*App ID*/null, + /*autoActivateID*/null, + callbackToUIThread, + new BTTransportConfig(), new TestConfig()); + + SyncTrace.logProxyEvent("Application constructed SyncProxy instance passing in: IProxyListener, callBackToUIThread.", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC. + * + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @param callbackToUIThread - If true, all callbacks will occur on the UI thread. + * @throws SyncException + */ + public SyncProxy(IProxyListener listener, SyncProxyConfigurationResources syncProxyConfigurationResources, + boolean callbackToUIThread) throws SyncException { + super( listener, + syncProxyConfigurationResources, + /*enable advanced lifecycle management*/false, + /*app name*/ null, + /*TTS Name*/null, + /*ngn media screen app name*/null, + /*vr synonyms*/null, + /*is media app*/ null, + /*syncMsgVersion*/null, + /*language desired*/null, + /*HMI Display Language Desired*/null, + /*App Type*/null, + /*App ID*/null, + /*autoActivateID*/null, + callbackToUIThread, + new BTTransportConfig(), new TestConfig()); + + SyncTrace.logProxyEvent("Application constructed SyncProxy instance passing in: IProxyListener, callBackToUIThread.", SYNC_LIB_TRACE_KEY); + } + + /********************************************** TRANSPORT SWITCHING SUPPORT *****************************************/ + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC. + * + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @param transportConfig Initial configuration for transport. + * @throws SyncException + */ + public SyncProxy(IProxyListener listener, BaseTransportConfig transportConfig) throws SyncException { + super( listener, + /*application context*/null, + /*enable advanced lifecycle management*/false, + /*app name*/ null, + /*TTS Name*/null, + /*ngn media screen app name*/null, + /*vr synonyms*/null, + /*is media app*/ null, + /*syncMsgVersion*/null, + /*language desired*/null, + /*HMI Display Language Desired*/null, + /*App Type*/null, + /*App ID*/null, + /*autoActivateID*/null, + /*callbackToUIThread*/ true, + transportConfig, new TestConfig()); + + SyncTrace.logProxyEvent("Application constructed SyncProxy instance passing in: IProxyListener.", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC. + * + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @param transportConfig Initial configuration for transport. + * @throws SyncException + */ + public SyncProxy(IProxyListener listener, SyncProxyConfigurationResources syncProxyConfigurationResources, + BaseTransportConfig transportConfig) + throws SyncException { + super( listener, + syncProxyConfigurationResources, + /*enable advanced lifecycle management*/false, + /*app name*/ null, + /*TTS Name*/null, + /*ngn media screen app name*/null, + /*vr synonyms*/null, + /*is media app*/ null, + /*syncMsgVersion*/null, + /*language desired*/null, + /*HMI Display Language Desired*/null, + /*App Type*/null, + /*App ID*/null, + /*autoActivateID*/null, + /*callbackToUIThread*/ true, + transportConfig, new TestConfig()); + + SyncTrace.logProxyEvent("Application constructed SyncProxy instance passing in: IProxyListener, SyncProxyConfigurationResources.", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC. + * + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @param callbackToUIThread - If true, all callbacks will occur on the UI thread. + * @param transportConfig Initial configuration for transport. + * @throws SyncException + */ + public SyncProxy(IProxyListener listener, boolean callbackToUIThread, BaseTransportConfig transportConfig) throws SyncException { + super( listener, + /*sync proxy configuration resources*/null, + /*enable advanced lifecycle management*/false, + /*app name*/ null, + /*TTS Name*/null, + /*ngn media screen app name*/null, + /*vr synonyms*/null, + /*is media app*/ null, + /*syncMsgVersion*/null, + /*language desired*/null, + /*HMI Display Language Desired*/null, + /*App Type*/null, + /*App ID*/null, + /*autoActivateID*/null, + callbackToUIThread, + transportConfig, new TestConfig()); + + SyncTrace.logProxyEvent("Application constructed SyncProxy instance passing in: IProxyListener, callBackToUIThread.", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC. + * + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @param callbackToUIThread - If true, all callbacks will occur on the UI thread. + * @param transportConfig Initial configuration for transport. + * @throws SyncException + */ + public SyncProxy(IProxyListener listener, SyncProxyConfigurationResources syncProxyConfigurationResources, + boolean callbackToUIThread, BaseTransportConfig transportConfig) throws SyncException { + super( listener, + syncProxyConfigurationResources, + /*enable advanced lifecycle management*/false, + /*app name*/ null, + /*TTS Name*/null, + /*ngn media screen app name*/null, + /*vr synonyms*/null, + /*is media app*/ null, + /*syncMsgVersion*/null, + /*language desired*/null, + /*HMI Display Language Desired*/null, + /*App Type*/null, + /*App ID*/null, + /*autoActivateID*/null, + callbackToUIThread, + transportConfig, new TestConfig()); + + SyncTrace.logProxyEvent("Application constructed SyncProxy instance passing in: IProxyListener, callBackToUIThread.", SYNC_LIB_TRACE_KEY); + } + + /******************** Public Helper Methods *************************/ + + + /** + * Sends a RegisterAppInterface RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param syncMsgVersion + * @param appName + * @param ngnMediaScreenAppName + * @param vrSynonyms + * @param isMediaApp + * @param languageDesired + * @param autoActivateID + * @param correlationID + * + * @throws SyncException + */ + public void registerAppInterface( + SyncMsgVersion syncMsgVersion, String appName, String ngnMediaScreenAppName, + Vector<String> vrSynonyms, Boolean isMediaApp, Language languageDesired, + String autoActivateID, Integer correlationID) + throws SyncException { + + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This SyncProxy object has been disposed, it is no long capable of sending requests.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + registerAppInterfacePrivate( + syncMsgVersion, + appName, + null, + ngnMediaScreenAppName, + vrSynonyms, + isMediaApp, + languageDesired, + null, + null, + null, + autoActivateID, + correlationID, + getHashId()); + } + + /** + * Sends a RegisterAppInterface RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param appName + * @param isMediaApp + * @param autoActivateID + * @throws SyncException + */ + public void registerAppInterface( + String appName, Boolean isMediaApp, String autoActivateID, Integer correlationID) + throws SyncException { + + registerAppInterface( + /*syncMsgVersion*/null, + appName, + /*ngnMediaScreenAppName*/null, + /*vrSynonyms*/null, + isMediaApp, + /*languageDesired*/null, + autoActivateID, + correlationID); + } + + /** + * Sends a RegisterAppInterface RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param appName + * @throws SyncException + */ + public void registerAppInterface(String appName, Integer correlationID) + throws SyncException { + + registerAppInterface(appName, false, "", correlationID); + } + + /** + * Sends an UnregisterAppInterface RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param correlationID + * @throws SyncException + */ + public void unregisterAppInterface(Integer correlationID) + throws SyncException { + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This SyncProxy object has been disposed, it is no long capable of executing methods.", + SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + unregisterAppInterfacePrivate(correlationID); + } + + /** + * Returns is isConnected state of the SYNC transport. + * + * @return Boolean isConnected + */ + public Boolean getIsConnected() { + return super.getIsConnected(); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyALM.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyALM.java new file mode 100644 index 000000000..baba4a76b --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyALM.java @@ -0,0 +1,805 @@ +package com.ford.syncV4.proxy; + +import com.ford.syncV4.exception.SyncException; +import com.ford.syncV4.exception.SyncExceptionCause; +import com.ford.syncV4.proxy.interfaces.IProxyListenerALM; +import com.ford.syncV4.proxy.rpc.ButtonCapabilities; +import com.ford.syncV4.proxy.rpc.DisplayCapabilities; +import com.ford.syncV4.proxy.rpc.PresetBankCapabilities; +import com.ford.syncV4.proxy.rpc.SoftButtonCapabilities; +import com.ford.syncV4.proxy.rpc.SyncMsgVersion; +import com.ford.syncV4.proxy.rpc.VehicleType; +import com.ford.syncV4.proxy.rpc.enums.AppHMIType; +import com.ford.syncV4.proxy.rpc.enums.HmiZoneCapabilities; +import com.ford.syncV4.proxy.rpc.enums.Language; +import com.ford.syncV4.proxy.rpc.enums.SpeechCapabilities; +import com.ford.syncV4.proxy.rpc.enums.SyncDisconnectedReason; +import com.ford.syncV4.proxy.rpc.enums.VrCapabilities; +import com.ford.syncV4.syncConnection.SyncConnection; +import com.ford.syncV4.trace.SyncTrace; +import com.ford.syncV4.transport.BTTransportConfig; +import com.ford.syncV4.transport.BaseTransportConfig; +import com.ford.syncV4.transport.TransportType; +import com.ford.syncV4.util.TestConfig; + +import java.util.Vector; + +public class SyncProxyALM extends SyncProxyBase<IProxyListenerALM> { + + private static final String SYNC_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66"; + private static final String SYNC_LIB_PRIVATE_TOKEN = "{DAE1A88C-6C16-4768-ACA5-6F1247EA01C2}"; + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC + * + * Takes advantage of the advanced lifecycle management. + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @param appName - Name of the application displayed on SYNC. + * @param isMediaApp - Indicates if the app is a media application. + */ + public SyncProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp, + Language languageDesired, Language hmiDisplayLanguageDesired, String appID, TestConfig testConfig) throws SyncException { + super( listener, + /*sync proxy configuration resources*/null, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + /*ngn media app*/null, + /*vr synonyms*/null, + /*is media app*/isMediaApp, + /*syncMsgVersion*/null, + /*language desired*/languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/null, + /*App ID*/appID, + /*autoActivateID*/null, + /*callbackToUIThread*/ false, + new BTTransportConfig(), testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, appName, and isMediaApp.", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC. + * + * Takes advantage of the advanced lifecycle management. + * + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @param appName - Name of the application displayed on SYNC. + * @param ngnMediaScreenAppName - Name of the application displayed on SYNC 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 syncMsgVersion - Indicates the version of SYNC AppLink Messages desired. Must be less than + * or equal to the version of SYNC AppLink running on the vehicle. + * @param languageDesired - Indicates the language desired for the SYNC interface. + * @param autoActivateID - ID used to re-register previously registered application. + * @throws SyncException + */ + public SyncProxyALM(IProxyListenerALM listener, String appName, String ngnMediaScreenAppName, + Vector<String> vrSynonyms, Boolean isMediaApp, SyncMsgVersion syncMsgVersion, + Language languageDesired, Language hmiDisplayLanguageDesired, String appID, + String autoActivateID, TestConfig testConfig) throws SyncException { + super( listener, + /*sync proxy configuration resources*/null, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + ngnMediaScreenAppName, + vrSynonyms, + isMediaApp, + syncMsgVersion, + languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/null, + /*App ID*/appID, + autoActivateID, + /*callbackToUIThread*/ false, + new BTTransportConfig(), testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, appName, ngnMediaScreenAppName, " + + "vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, and autoActivateID.", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC. + * + * Takes advantage of the advanced lifecycle management. + * + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @param appName - Name of the application displayed on SYNC. + * @param ngnMediaScreenAppName - Name of the application displayed on SYNC 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 syncMsgVersion - Indicates the version of SYNC AppLink Messages desired. Must be less than + * or equal to the version of SYNC AppLink running on the vehicle. + * @param languageDesired - Indicates the language desired for the SYNC interface. + * @param autoActivateID - ID used to re-register previously registered application. + * @throws SyncException + */ + public SyncProxyALM(IProxyListenerALM listener, SyncProxyConfigurationResources syncProxyConfigurationResources, + String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, + Boolean isMediaApp, SyncMsgVersion syncMsgVersion, Language languageDesired, + Language hmiDisplayLanguageDesired, String appID, String autoActivateID, TestConfig testConfig) throws SyncException { + super( listener, + syncProxyConfigurationResources, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + ngnMediaScreenAppName, + vrSynonyms, + isMediaApp, + syncMsgVersion, + languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/null, + /*App ID*/appID, + autoActivateID, + /*callbackToUIThread*/ false, + new BTTransportConfig(), testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, syncProxyConfigurationResources, " + + "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, and autoActivateID.", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC. + * + * Takes advantage of the advanced lifecycle management. + * + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @param appName - Name of the application displayed on SYNC. + * @param ngnMediaScreenAppName - Name of the application displayed on SYNC 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 syncMsgVersion - Indicates the version of SYNC AppLink Messages desired. Must be less than + * or equal to the version of SYNC AppLink running on the vehicle. + * @param languageDesired - Indicates the language desired for the SYNC interface. + * @param autoActivateID - ID used to re-register previously registered application. + * @param callbackToUIThread - If true, all callbacks will occur on the UI thread. + * @throws SyncException + */ + public SyncProxyALM(IProxyListenerALM listener, String appName, String ngnMediaScreenAppName, + Vector<String> vrSynonyms, Boolean isMediaApp, SyncMsgVersion syncMsgVersion, + Language languageDesired, Language hmiDisplayLanguageDesired, String appID, + String autoActivateID, boolean callbackToUIThread, TestConfig testConfig) throws SyncException { + super( listener, + /*sync proxy configuration resources*/null, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + ngnMediaScreenAppName, + vrSynonyms, + isMediaApp, + syncMsgVersion, + languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/null, + /*App ID*/appID, + autoActivateID, + callbackToUIThread, + new BTTransportConfig(), testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, " + + "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, autoActivateID, " + + "and callbackToUIThread", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC. + * + * Takes advantage of the advanced lifecycle management. + * + * @param listener - Reference to the object in the App listening to callbacks from SYNC. + * @param appName - Name of the application displayed on SYNC. + * @param ngnMediaScreenAppName - Name of the application displayed on SYNC 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 syncMsgVersion - Indicates the version of SYNC AppLink Messages desired. Must be less than + * or equal to the version of SYNC AppLink running on the vehicle. + * @param languageDesired - Indicates the language desired for the SYNC interface. + * @param autoActivateID - ID used to re-register previously registered application. + * @param callbackToUIThread - If true, all callbacks will occur on the UI thread. + * @throws SyncException + */ + public SyncProxyALM(IProxyListenerALM listener, SyncProxyConfigurationResources syncProxyConfigurationResources, + String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, + SyncMsgVersion syncMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, + String appID, String autoActivateID, boolean callbackToUIThread, TestConfig testConfig) throws SyncException { + super( listener, + syncProxyConfigurationResources, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + ngnMediaScreenAppName, + vrSynonyms, + isMediaApp, + syncMsgVersion, + languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/null, + /*App ID*/appID, + autoActivateID, + callbackToUIThread, + new BTTransportConfig(), testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, syncProxyConfigurationResources, " + + "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, autoActivateID, " + + "and callbackToUIThread", SYNC_LIB_TRACE_KEY); + } + + public SyncProxyALM(IProxyListenerALM listener, SyncProxyConfigurationResources syncProxyConfigurationResources, + String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, Vector<AppHMIType> appHMIType, + SyncMsgVersion syncMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, + String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister, int version, + TestConfig testConfig) throws SyncException { + super( listener, + syncProxyConfigurationResources, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + ngnMediaScreenAppName, + vrSynonyms, + isMediaApp, + syncMsgVersion, + languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/appHMIType, + /*App ID*/appID, + autoActivateID, + callbackToUIThread, + preRegister, + version, + new BTTransportConfig(), + null, testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using legacy constructor for BT transport) instance passing in: IProxyListener, syncProxyConfigurationResources, " + + "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, autoActivateID, " + + "callbackToUIThread and version", SYNC_LIB_TRACE_KEY); + } + + /********************************************** TRANSPORT SWITCHING SUPPORT *****************************************/ + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC via specified transport. + * + * Takes advantage of the advanced lifecycle management. + * + * @param listener Reference to the object in the App listening to callbacks from SYNC. + * @param appName Name of the application displayed on SYNC. + * @param isMediaApp Indicates if the app is a media application. + * @param transportConfig Initial configuration for transport. + * @throws SyncException + */ + public SyncProxyALM(IProxyListenerALM listener, String appName, Boolean isMediaApp, + Language languageDesired, Language hmiDisplayLanguageDesired, String appID, + BaseTransportConfig transportConfig, TestConfig testConfig) throws SyncException { + super( listener, + /*sync proxy configuration resources*/null, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + /*ngn media app*/null, + /*vr synonyms*/null, + /*is media app*/isMediaApp, + /*syncMsgVersion*/null, + /*language desired*/languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/null, + /*App ID*/appID, + /*autoActivateID*/null, + /*callbackToUIThread*/ false, + transportConfig, testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, appName, and isMediaApp.", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC via specified transport. + * + * Takes advantage of the advanced lifecycle management. + * + * @param listener Reference to the object in the App listening to callbacks from SYNC. + * @param appName Name of the application displayed on SYNC. + * @param ngnMediaScreenAppName Name of the application displayed on SYNC 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 syncMsgVersion Indicates the version of SYNC AppLink Messages desired. Must be less than + * or equal to the version of SYNC AppLink running on the vehicle. + * @param languageDesired Indicates the language desired for the SYNC interface. + * @param autoActivateID ID used to re-register previously registered application. + * @param transportConfig Initial configuration for transport. + * @throws SyncException + */ + public SyncProxyALM(IProxyListenerALM listener, String appName, String ngnMediaScreenAppName, + Vector<String> vrSynonyms, Boolean isMediaApp, SyncMsgVersion syncMsgVersion, + Language languageDesired, Language hmiDisplayLanguageDesired, String appID, + String autoActivateID, TransportType transportType, BaseTransportConfig transportConfig, + TestConfig testConfig) throws SyncException { + super( listener, + /*sync proxy configuration resources*/null, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + ngnMediaScreenAppName, + vrSynonyms, + isMediaApp, + syncMsgVersion, + languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/null, + /*App ID*/appID, + autoActivateID, + /*callbackToUIThread*/ false, + transportConfig, testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, appName, ngnMediaScreenAppName, " + + "vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, and autoActivateID.", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC via specified transport. + * + * Takes advantage of the advanced lifecycle management. + * + * @param listener Reference to the object in the App listening to callbacks from SYNC. + * @param appName Name of the application displayed on SYNC. + * @param ngnMediaScreenAppName Name of the application displayed on SYNC 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 syncMsgVersion Indicates the version of SYNC AppLink Messages desired. Must be less than + * or equal to the version of SYNC AppLink running on the vehicle. + * @param languageDesired Indicates the language desired for the SYNC interface. + * @param autoActivateID ID used to re-register previously registered application. + * @param transportConfig Initial configuration for transport. + * @throws SyncException + */ + public SyncProxyALM(IProxyListenerALM listener, SyncProxyConfigurationResources syncProxyConfigurationResources, + String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, + Boolean isMediaApp, SyncMsgVersion syncMsgVersion, Language languageDesired, + Language hmiDisplayLanguageDesired, String appID, String autoActivateID, + BaseTransportConfig transportConfig, TestConfig testConfig) throws SyncException { + super( listener, + syncProxyConfigurationResources, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + ngnMediaScreenAppName, + vrSynonyms, + isMediaApp, + syncMsgVersion, + languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/null, + /*App ID*/appID, + autoActivateID, + /*callbackToUIThread*/ false, + transportConfig, testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, syncProxyConfigurationResources, " + + "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, and autoActivateID.", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC via specified transport. + * + * Takes advantage of the advanced lifecycle management. + * + * @param listener Reference to the object in the App listening to callbacks from SYNC. + * @param appName Name of the application displayed on SYNC. + * @param ngnMediaScreenAppName Name of the application displayed on SYNC 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 syncMsgVersion Indicates the version of SYNC AppLink Messages desired. Must be less than + * or equal to the version of SYNC AppLink running on the vehicle. + * @param languageDesired Indicates the language desired for the SYNC 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 SyncException + */ + public SyncProxyALM(IProxyListenerALM listener, String appName, String ngnMediaScreenAppName, + Vector<String> vrSynonyms, Boolean isMediaApp, SyncMsgVersion syncMsgVersion, + Language languageDesired, Language hmiDisplayLanguageDesired, String appID, + String autoActivateID, boolean callbackToUIThread, + BaseTransportConfig transportConfig, TestConfig testConfig) throws SyncException { + super( listener, + /*sync proxy configuration resources*/null, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + ngnMediaScreenAppName, + vrSynonyms, + isMediaApp, + syncMsgVersion, + languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/null, + /*App ID*/appID, + autoActivateID, + callbackToUIThread, + transportConfig, testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, " + + "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, autoActivateID, " + + "and callbackToUIThread", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC via specified transport. + * + * Takes advantage of the advanced lifecycle management. + * + * @param listener Reference to the object in the App listening to callbacks from SYNC. + * @param appName Name of the application displayed on SYNC. + * @param ngnMediaScreenAppName Name of the application displayed on SYNC 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 syncMsgVersion Indicates the version of SYNC AppLink Messages desired. Must be less than + * or equal to the version of SYNC AppLink running on the vehicle. + * @param languageDesired Indicates the language desired for the SYNC 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 SyncException + */ + public SyncProxyALM(IProxyListenerALM listener, SyncProxyConfigurationResources syncProxyConfigurationResources, + String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, + SyncMsgVersion syncMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, + String appID, String autoActivateID, boolean callbackToUIThread, BaseTransportConfig transportConfig, + TestConfig testConfig) throws SyncException { + super( listener, + syncProxyConfigurationResources, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + ngnMediaScreenAppName, + vrSynonyms, + isMediaApp, + syncMsgVersion, + languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/null, + /*App ID*/appID, + autoActivateID, + callbackToUIThread, + transportConfig, testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, syncProxyConfigurationResources, " + + "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, autoActivateID, " + + "and callbackToUIThread", SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC via specified transport. + * + * Takes advantage of the advanced lifecycle management. + * + * @param listener Reference to the object in the App listening to callbacks from SYNC. + * @param syncProxyConfigurationResources Proxy configuration resources. + * @param appName Name of the application displayed on SYNC. + * @param ngnMediaScreenAppName Name of the application displayed on SYNC 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 syncMsgVersion Indicates the version of SYNC AppLink Messages desired. Must be less than + * or equal to the version of SYNC AppLink running on the vehicle. + * @param languageDesired Indicates the language desired for the SYNC 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 version Desired version of SYNC protocol. + * @param transportConfig Initial configuration for transport. + * @throws SyncException + */ + public SyncProxyALM(IProxyListenerALM listener, SyncProxyConfigurationResources syncProxyConfigurationResources, + String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, Vector<AppHMIType> appHMIType, + SyncMsgVersion syncMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, + String appID, String autoActivateID, boolean callbackToUIThread, boolean preRegister, int version, + BaseTransportConfig transportConfig, TestConfig testConfig) throws SyncException { + super( listener, + syncProxyConfigurationResources, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + ngnMediaScreenAppName, + vrSynonyms, + isMediaApp, + syncMsgVersion, + languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/appHMIType, + /*App ID*/appID, + autoActivateID, + callbackToUIThread, + preRegister, + version, + transportConfig, + null, testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, syncProxyConfigurationResources, " + + "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, autoActivateID, " + + "callbackToUIThread and version", SYNC_LIB_TRACE_KEY); + } + + // TODO: use Builder here + public SyncProxyALM(IProxyListenerALM listener, + SyncProxyConfigurationResources syncProxyConfigurationResources, + String appName, String ngnMediaScreenAppName, + Vector<String> vrSynonyms, Boolean isMediaApp, + Vector<AppHMIType> appHMIType, + SyncMsgVersion syncMsgVersion, Language languageDesired, + Language hmiDisplayLanguageDesired, String appID, + String autoActivateID, boolean callbackToUIThread, + boolean preRegister, int version, + BaseTransportConfig transportConfig, + SyncConnection connection, TestConfig testConfig) throws SyncException { + super( listener, + syncProxyConfigurationResources, + /*enable advanced lifecycle management*/true, + appName, + /*TTS Name*/null, + ngnMediaScreenAppName, + vrSynonyms, + isMediaApp, + syncMsgVersion, + languageDesired, + /*HMI Display Language Desired*/hmiDisplayLanguageDesired, + /*App Type*/appHMIType, + /*App ID*/appID, + autoActivateID, + callbackToUIThread, + preRegister, + version, + transportConfig, + connection, testConfig); + + SyncTrace.logProxyEvent("Application constructed SyncProxyALM (using new constructor with specified transport) instance passing in: IProxyListener, syncProxyConfigurationResources, " + + "appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, autoActivateID, " + + "callbackToUIThread, version, transportConfig, and connection", SYNC_LIB_TRACE_KEY); + } + + /***************************************** END OF TRANSPORT SWITCHING SUPPORT ***************************************/ + + // Allow applications using ALM to reset the proxy (dispose and reinstantiate) + /** + * Disconnects the application from SYNC, then recreates the transport such that + * the next time a SYNC unit discovers applications, this application will be + * available. + */ + public void resetProxy() throws SyncException { + super.cycleProxy(SyncDisconnectedReason.APPLICATION_REQUESTED_DISCONNECT); + } + + /********* Getters for values returned by RegisterAppInterfaceResponse **********/ + + /** + * Gets buttonCapabilities set when application interface is registered. + * + * @return buttonCapabilities + * @throws SyncException + */ + @Override + public Vector<ButtonCapabilities> getButtonCapabilities() throws SyncException{ + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + // Test SYNC availability + if (!_appInterfaceRegisterd) { + throw new SyncException("SYNC is unavailable. Unable to get the buttonCapabilities.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + return _buttonCapabilities; + } + + /** + * Gets getSoftButtonCapabilities set when application interface is registered. + * + * @return softButtonCapabilities + * @throws SyncException + */ + @Override + public Vector<SoftButtonCapabilities> getSoftButtonCapabilities() throws SyncException { + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + // Test SYNC availability + if (!_appInterfaceRegisterd) { + throw new SyncException("SYNC is not connected. Unable to get the softButtonCapabilities.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + return _softButtonCapabilities; + } + + /** + * Gets getPresetBankCapabilities set when application interface is registered. + * + * @return presetBankCapabilities + * @throws SyncException + */ + @Override + public PresetBankCapabilities getPresetBankCapabilities() throws SyncException { + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + // Test SYNC availability + if (!_appInterfaceRegisterd) { + throw new SyncException("SYNC is not connected. Unable to get the presetBankCapabilities.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + return _presetBankCapabilities; + } + + /** + * Gets displayCapabilities set when application interface is registered. + * + * @return displayCapabilities + * @throws SyncException + */ + @Override + public DisplayCapabilities getDisplayCapabilities() throws SyncException { + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + // Test SYNC availability + if (!_appInterfaceRegisterd) { + throw new SyncException("SYNC is unavailable. Unable to get the displayCapabilities.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + return _displayCapabilities; + } + + /** + * Gets hmiZoneCapabilities set when application interface is registered. + * + * @return hmiZoneCapabilities + * @throws SyncException + */ + @Override + public Vector<HmiZoneCapabilities> getHmiZoneCapabilities() throws SyncException { + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + // Test SYNC availability + if (!_appInterfaceRegisterd) { + throw new SyncException("SYNC is unavailable. Unable to get the hmiZoneCapabilities.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + return _hmiZoneCapabilities; + } + + /** + * Gets speechCapabilities set when application interface is registered. + * + * @return speechCapabilities + * @throws SyncException + */ + @Override + public Vector<SpeechCapabilities> getSpeechCapabilities() throws SyncException { + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + // Test SYNC availability + if (!_appInterfaceRegisterd) { + throw new SyncException("SYNC is unavailable. Unable to get the speechCapabilities.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + + return _speechCapabilities; + } + + /** + * Gets syncLanguage set when application interface is registered. + * + * @return syncLanguage + * @throws SyncException + */ + @Override + public Language getSyncLanguage() throws SyncException { + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + // Test SYNC availability + if (!_appInterfaceRegisterd) { + throw new SyncException("SYNC is unavailable. Unable to get the syncLanguage.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + return _syncLanguage; + } + + /** + * Gets getHmiDisplayLanguage set when application interface is registered. + * + * @return hmiDisplayLanguage + * @throws SyncException + */ + @Override + public Language getHmiDisplayLanguage() throws SyncException { + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + // Test SYNC availability + if (!_appInterfaceRegisterd) { + throw new SyncException("SYNC is not connected. Unable to get the hmiDisplayLanguage.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + return _hmiDisplayLanguage; + } + + /** + * Gets syncMsgVersion set when application interface is registered. + * + * @return syncMsgVersion + * @throws SyncException + */ + @Override + public SyncMsgVersion getSyncMsgVersion() throws SyncException { + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + // Test SYNC availability + if (!_appInterfaceRegisterd) { + throw new SyncException("SYNC is unavailable. Unable to get the syncMsgVersion.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + return _syncMsgVersion; + } + + /** + * Gets vrCapabilities set when application interface is registered. + * + * @return vrCapabilities + * @throws SyncException + */ + @Override + public Vector<VrCapabilities> getVrCapabilities() throws SyncException { + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + // Test SYNC availability + if (!_appInterfaceRegisterd) { + throw new SyncException("SYNC is unavailable. Unable to get the vrCapabilities.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + return _vrCapabilities; + } + + /** + * Gets getVehicleType set when application interface is registered. + * + * @return vehicleType + * @throws SyncException + */ + @Override + public VehicleType getVehicleType() throws SyncException { + // Test if proxy has been disposed + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + // Test SYNC availability + if (!_appInterfaceRegisterd) { + throw new SyncException("SYNC is not connected. Unable to get the vehicleType.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + return _vehicleType; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyALMManager.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyALMManager.java new file mode 100644 index 000000000..eb938b1dc --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyALMManager.java @@ -0,0 +1,2628 @@ +package com.ford.syncV4.proxy;
+
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Vector;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+
+import com.ford.syncV4.exception.SyncException;
+import com.ford.syncV4.exception.SyncExceptionCause;
+import com.ford.syncV4.protocol.enums.ServiceType;
+import com.ford.syncV4.proxy.interfaces.ISyncALMLifeCycleListener;
+import com.ford.syncV4.proxy.interfaces.ISyncAddSubMenuResponseListener;
+import com.ford.syncV4.proxy.interfaces.ISyncAlertResponseListener;
+import com.ford.syncV4.proxy.interfaces.ISyncCreateInteractionChoiceSetResponseListener;
+import com.ford.syncV4.proxy.interfaces.ISyncDeleteCommandResponseListener;
+import com.ford.syncV4.proxy.interfaces.ISyncDeleteInteractionChoiceSetResponseListener;
+import com.ford.syncV4.proxy.interfaces.ISyncDeleteSubMenuResponseListener;
+import com.ford.syncV4.proxy.interfaces.ISyncDriverDistractionListener;
+import com.ford.syncV4.proxy.interfaces.ISyncEncodedSyncPDataListener;
+import com.ford.syncV4.proxy.interfaces.ISyncSyncPDataListener;
+import com.ford.syncV4.proxy.interfaces.ISyncEncodedSyncPDataResponseListener;
+import com.ford.syncV4.proxy.interfaces.ISyncSyncPDataResponseListener;
+import com.ford.syncV4.proxy.interfaces.IProxyListenerALM;
+import com.ford.syncV4.proxy.interfaces.ISyncChoiceListener;
+import com.ford.syncV4.proxy.interfaces.ISyncPerformInteractionResponseListener;
+import com.ford.syncV4.proxy.interfaces.ISyncResetGlobalPropertiesListener;
+import com.ford.syncV4.proxy.interfaces.ISyncSetGlobalPropertiesResponseListener;
+import com.ford.syncV4.proxy.interfaces.ISyncSetMediaClockTimerResponseListener;
+import com.ford.syncV4.proxy.interfaces.ISyncShowResponseListener;
+import com.ford.syncV4.proxy.interfaces.ISyncSpeakResponseListener;
+import com.ford.syncV4.proxy.interfaces.ISyncButtonListener;
+import com.ford.syncV4.proxy.interfaces.ISyncCommandListener;
+import com.ford.syncV4.proxy.interfaces.ISyncTBTClientStateListener;
+import com.ford.syncV4.proxy.interfaces.ISyncUnsubscribeButtonResponseListener;
+import com.ford.syncV4.proxy.rpc.AddCommandResponse;
+import com.ford.syncV4.proxy.rpc.AddSubMenuResponse;
+import com.ford.syncV4.proxy.rpc.AlertManeuverResponse;
+import com.ford.syncV4.proxy.rpc.AlertResponse;
+import com.ford.syncV4.proxy.rpc.ChangeRegistrationResponse;
+import com.ford.syncV4.proxy.rpc.Choice;
+import com.ford.syncV4.proxy.rpc.CreateInteractionChoiceSetResponse;
+import com.ford.syncV4.proxy.rpc.DeleteCommandResponse;
+import com.ford.syncV4.proxy.rpc.DeleteFileResponse;
+import com.ford.syncV4.proxy.rpc.DeleteInteractionChoiceSetResponse;
+import com.ford.syncV4.proxy.rpc.DeleteSubMenuResponse;
+import com.ford.syncV4.proxy.rpc.EncodedSyncPDataResponse;
+import com.ford.syncV4.proxy.rpc.OnHashChange;
+import com.ford.syncV4.proxy.rpc.OnKeyboardInput;
+import com.ford.syncV4.proxy.rpc.OnSystemRequest;
+import com.ford.syncV4.proxy.rpc.OnTouchEvent;
+import com.ford.syncV4.proxy.rpc.RegisterAppInterface;
+import com.ford.syncV4.proxy.rpc.SyncPDataResponse;
+import com.ford.syncV4.proxy.rpc.GenericResponse;
+import com.ford.syncV4.proxy.rpc.GetDTCsResponse;
+import com.ford.syncV4.proxy.rpc.EndAudioPassThruResponse;
+import com.ford.syncV4.proxy.rpc.GetVehicleDataResponse;
+import com.ford.syncV4.proxy.rpc.OnAudioPassThru;
+import com.ford.syncV4.proxy.rpc.ListFilesResponse;
+import com.ford.syncV4.proxy.rpc.OnButtonEvent;
+import com.ford.syncV4.proxy.rpc.OnButtonPress;
+import com.ford.syncV4.proxy.rpc.OnCommand;
+import com.ford.syncV4.proxy.rpc.OnDriverDistraction;
+import com.ford.syncV4.proxy.rpc.OnEncodedSyncPData;
+import com.ford.syncV4.proxy.rpc.OnSyncPData;
+import com.ford.syncV4.proxy.rpc.OnHMIStatus;
+import com.ford.syncV4.proxy.rpc.OnLanguageChange;
+import com.ford.syncV4.proxy.rpc.OnPermissionsChange;
+import com.ford.syncV4.proxy.rpc.OnSyncChoiceChosen;
+import com.ford.syncV4.proxy.rpc.OnTBTClientState;
+import com.ford.syncV4.proxy.rpc.OnVehicleData;
+import com.ford.syncV4.proxy.rpc.PerformInteractionResponse;
+import com.ford.syncV4.proxy.rpc.PerformAudioPassThruResponse;
+import com.ford.syncV4.proxy.rpc.PutFileResponse;
+import com.ford.syncV4.proxy.rpc.ReadDIDResponse;
+import com.ford.syncV4.proxy.rpc.ResetGlobalPropertiesResponse;
+import com.ford.syncV4.proxy.rpc.ScrollableMessageResponse;
+import com.ford.syncV4.proxy.rpc.SetAppIconResponse;
+import com.ford.syncV4.proxy.rpc.SetDisplayLayoutResponse;
+import com.ford.syncV4.proxy.rpc.SetGlobalPropertiesResponse;
+import com.ford.syncV4.proxy.rpc.SetMediaClockTimerResponse;
+import com.ford.syncV4.proxy.rpc.ShowConstantTBTResponse;
+import com.ford.syncV4.proxy.rpc.ShowResponse;
+import com.ford.syncV4.proxy.rpc.SliderResponse;
+import com.ford.syncV4.proxy.rpc.SpeakResponse;
+import com.ford.syncV4.proxy.rpc.SubscribeButtonResponse;
+import com.ford.syncV4.proxy.rpc.SubscribeVehicleDataResponse;
+import com.ford.syncV4.proxy.rpc.SyncMsgVersion;
+import com.ford.syncV4.proxy.rpc.SystemRequestResponse;
+import com.ford.syncV4.proxy.rpc.TTSChunk;
+import com.ford.syncV4.proxy.rpc.UnsubscribeButtonResponse;
+import com.ford.syncV4.proxy.rpc.UnsubscribeVehicleDataResponse;
+import com.ford.syncV4.proxy.rpc.UpdateTurnListResponse;
+import com.ford.syncV4.proxy.rpc.enums.AppInterfaceUnregisteredReason;
+import com.ford.syncV4.proxy.rpc.enums.ButtonName;
+import com.ford.syncV4.proxy.rpc.enums.GlobalProperty;
+import com.ford.syncV4.proxy.rpc.enums.InteractionMode;
+import com.ford.syncV4.proxy.rpc.enums.Language;
+import com.ford.syncV4.proxy.rpc.enums.TextAlignment;
+import com.ford.syncV4.proxy.rpc.enums.UpdateMode;
+import com.ford.syncV4.util.DebugTool;
+import com.ford.syncV4.util.TestConfig;
+
+public class SyncProxyALMManager {
+
+ public class SyncSubMenu {
+ private Integer _menuID = null;
+ private Integer _position = null;
+ private String _menuName = null;
+
+ // Constructor
+ SyncSubMenu(Integer menuID, Integer position, String menuName) {
+ _menuID = menuID;
+ _position = position;
+ _menuName = menuName;
+ }
+
+ // Restrict no-arg constructor
+ private SyncSubMenu() {}
+
+ // Public Getters
+ public Integer getMenuID() {
+ return _menuID;
+ }
+
+ public String getMenuName() {
+ return _menuName;
+ }
+
+ public String toString() {
+ return _menuName;
+ }
+ }
+
+ public class SyncCommand {
+ private Integer _commandID = null;
+ private SyncSubMenu _parentSubMenu = null;
+ private Integer _position = null;
+ private String _menuName = null;
+ private Vector<String> _vrCommands = null;
+
+ // Constructor
+ SyncCommand(Integer commandID, SyncSubMenu parentSubMenu, Integer position, String menuName, Vector<String> vrCommands) {
+ _commandID = commandID;
+ _parentSubMenu = parentSubMenu;
+ _position = position;
+ _menuName = menuName;
+ _vrCommands = vrCommands;
+ }
+
+ // Restrict no-arg constructor
+ private SyncCommand() {}
+
+ // Public Getters
+ public Integer getCommandID() {
+ return _commandID;
+ }
+
+ public SyncSubMenu getParentSubMenu() {
+ return _parentSubMenu;
+ }
+
+ public String getMenuName() {
+ return _menuName;
+ }
+
+ public Vector<String> getVrCommands() {
+ return _vrCommands;
+ }
+
+ public String toString() {
+ return _menuName;
+ }
+ }
+
+ public class SyncChoice {
+
+ private Choice _choice = null;
+
+ // Constructor
+ SyncChoice(Choice choice) {
+ _choice = choice;
+ }
+
+ public Choice getChoice() {
+ return _choice;
+ }
+
+ public Integer getChoiceID() {
+ return _choice.getChoiceID();
+ }
+
+ public String getMenuName() {
+ return _choice.getMenuName();
+ }
+
+ public Vector<String> getVrCommands() {
+ return _choice.getVrCommands();
+ }
+
+ public String toString() {
+ return _choice.getMenuName();
+ }
+ }
+
+ public class SyncChoiceSet {
+ private Integer _choiceSetID = null;
+ private Vector<SyncChoice> _choiceSet = null;
+
+ // Constructor
+ SyncChoiceSet(Integer choiceSetID, Vector<SyncChoice> choiceSet) {
+ _choiceSetID = choiceSetID;
+ _choiceSet = choiceSet;
+ }
+
+ public Integer getChoiceSetID() {
+ return _choiceSetID;
+ }
+
+ public Vector<SyncChoice> getChoiceSet() {
+ return _choiceSet;
+ }
+ }
+
+ private class SpeakTextParser implements ISyncSpeakResponseListener {
+
+ private int MAX_SUBSTRING_LENGTH = 500;
+
+ private Object _mainTag;
+ private ISyncSpeakResponseListener _mainSpeakListener;
+ private BlockingQueue<String> _speakQueue;
+
+ public SpeakTextParser(String ttsText, Object tag, ISyncSpeakResponseListener listener) throws SyncException {
+ if (ttsText == null) {
+ throw new SyncException("ttsText must not be null", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ // Set the main tag
+ _mainTag = tag;
+ // Set the main listener
+ _mainSpeakListener = listener;
+
+ // TODO What size is needed? Add one for remained and another for chars cut short based on
+ // separating by word and not by a character limit
+ _speakQueue = new ArrayBlockingQueue<String>((ttsText.length()/MAX_SUBSTRING_LENGTH)+2);
+
+ setTextToSpeak(ttsText);
+ }
+
+ private void setTextToSpeak(String text) throws SyncException {
+ String[] wordArray = text.split(" ");
+ StringBuilder sb = new StringBuilder();
+
+ for (int i=0; i<wordArray.length; i++) {
+ if ((sb.length()+wordArray[i].length()+1)<MAX_SUBSTRING_LENGTH) {
+ sb.append(wordArray[i]);
+ sb.append(" ");
+ } else {
+ _speakQueue.offer(sb.toString());
+ sb = new StringBuilder();
+
+ // Is the "word" greater than MAX_SUBSTRING_LENGTH characters
+ if ((wordArray[i].length()+1) > MAX_SUBSTRING_LENGTH) {
+ throw new SyncException("No word for speaking can be " + MAX_SUBSTRING_LENGTH + " characters of length or greater.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ sb.append(wordArray[i]);
+ sb.append(" ");
+ }
+ }
+
+ // Add remaining content of the string builder
+ if (sb.length() > 0) {
+ _speakQueue.offer(sb.toString());
+ }
+ }
+
+ public void speakFromQueue() {
+ if (_speakQueue == null || _speakQueue.size() < 1) {
+ return;
+ }
+
+ try {
+ String textToSpeak = _speakQueue.poll();
+
+ speak(textToSpeak, _mainTag, this);
+ } catch (SyncException e) {
+ DebugTool.logError("smartSpeak failed to speak!", e);
+ return;
+ }
+ }
+
+ @Override
+ public void onSpeakResponse(SpeakResponse response, Object tag) {
+ if (!response.getSuccess()) {
+ // There was an error, notify main listener and return
+ if (_mainSpeakListener != null) {
+ _mainSpeakListener.onSpeakResponse(response, tag);
+ }
+
+ return;
+ } else {
+ if (_speakQueue.size() > 0) {
+ speakFromQueue();
+ } else {
+ // All strings have been spoken, notify main listener and return
+ if (_mainSpeakListener != null) {
+ _mainSpeakListener.onSpeakResponse(response, tag);
+ }
+ }
+ }
+ }
+ }
+
+ // ArrayLists of SyncCommands, SyncChoices
+ private Hashtable<Integer, SyncCommand> _syncCommandsByCommandID = new Hashtable<Integer, SyncCommand>();
+ private Hashtable<Integer, SyncCommand> _syncCommandsByCorrelationID = new Hashtable<Integer, SyncCommand>();
+ private Hashtable<Integer, SyncSubMenu> _syncSubMenusByCorrelationID = new Hashtable<Integer, SyncSubMenu>();
+ private Hashtable<Integer, SyncChoice> _syncChoicesByChoiceID = new Hashtable<Integer, SyncChoice>();
+ private Hashtable<Integer, Vector<SyncChoice>> _syncChoicesBySyncChoiceSetID = new Hashtable<Integer, Vector<SyncChoice>>();
+ private Hashtable<Integer, SyncChoiceSet> _syncChoiceSetByCorrelationID = new Hashtable<Integer, SyncChoiceSet>();
+
+ // Generic Object Tags
+ private Hashtable<Integer, Object> _genericTagsByCorrelationID = new Hashtable<Integer, Object>();
+ private Hashtable<Integer, Object> _genericTagsByCommandID = new Hashtable<Integer, Object>();
+ private Hashtable<Integer, Object> _genericTagsByChoiceSetID = new Hashtable<Integer, Object>();
+ private Hashtable<Integer, Object> _genericTagsByChoiceID = new Hashtable<Integer, Object>();
+
+ // Containers for the Interfaces to the Application
+ private ISyncALMLifeCycleListener _lifecycleListener = null;
+ private Vector<ISyncDriverDistractionListener> _driverDistractionListeners = new Vector<ISyncDriverDistractionListener>();
+ private Vector<ISyncEncodedSyncPDataListener> _encodedSyncPDataListeners = new Vector<ISyncEncodedSyncPDataListener>();
+ private Vector<ISyncSyncPDataListener> _syncPDataListeners = new Vector<ISyncSyncPDataListener>();
+ private Vector<ISyncTBTClientStateListener> _tbtClientStateListeners = new Vector<ISyncTBTClientStateListener>();
+ private Hashtable<ButtonName, ISyncButtonListener> _buttonListeners = new Hashtable<ButtonName, ISyncButtonListener>();
+ private Hashtable<Integer, ISyncButtonListener> _buttonResponseListeners = new Hashtable<Integer, ISyncButtonListener>();
+ private Hashtable<Integer, ISyncCommandListener> _commandListeners = new Hashtable<Integer, ISyncCommandListener>();
+ private Hashtable<Integer, ISyncCommandListener> _commandResponseListeners = new Hashtable<Integer, ISyncCommandListener>();
+ private Hashtable<Integer, ISyncEncodedSyncPDataResponseListener> _encodedSyncPDataResponseListeners = new Hashtable<Integer, ISyncEncodedSyncPDataResponseListener>();
+ private Hashtable<Integer, ISyncSyncPDataResponseListener> _syncPDataResponseListeners = new Hashtable<Integer, ISyncSyncPDataResponseListener>();
+ private Hashtable<Integer, ISyncAddSubMenuResponseListener> _addSubMenuResponseListeners = new Hashtable<Integer,ISyncAddSubMenuResponseListener>();
+ private Hashtable<Integer, ISyncAlertResponseListener> _alertResponseListeners = new Hashtable<Integer, ISyncAlertResponseListener>();
+ private Hashtable<Integer, ISyncCreateInteractionChoiceSetResponseListener> _createInteractionChoiceSetResponseListeners = new Hashtable<Integer, ISyncCreateInteractionChoiceSetResponseListener>();
+ private Hashtable<Integer, ISyncChoiceListener> _interactionChoiceListeners = new Hashtable<Integer, ISyncChoiceListener>();
+ private Hashtable<Integer, ISyncDeleteCommandResponseListener> _createDeleteCommandResponseListeners = new Hashtable<Integer, ISyncDeleteCommandResponseListener>();
+ private Hashtable<Integer, ISyncDeleteInteractionChoiceSetResponseListener> _deleteInteractionchoiceSetResponseListeners = new Hashtable<Integer, ISyncDeleteInteractionChoiceSetResponseListener>();
+ private Hashtable<Integer, ISyncDeleteSubMenuResponseListener> _deleteSubMenuResponseListeners = new Hashtable<Integer, ISyncDeleteSubMenuResponseListener>();
+ private Hashtable<Integer, ISyncPerformInteractionResponseListener> _performInteractionResponseListeners = new Hashtable<Integer, ISyncPerformInteractionResponseListener>();
+ private Hashtable<Integer, ISyncSetGlobalPropertiesResponseListener> _setGlobalPropertiesResponseListeners = new Hashtable<Integer, ISyncSetGlobalPropertiesResponseListener>();
+ private Hashtable<Integer, ISyncResetGlobalPropertiesListener> _resetGlobalPropertiesResponseListeners = new Hashtable<Integer, ISyncResetGlobalPropertiesListener>();
+ private Hashtable<Integer, ISyncSetMediaClockTimerResponseListener> _setMediaClockTimerResponseListeners = new Hashtable<Integer, ISyncSetMediaClockTimerResponseListener>();
+ private Hashtable<Integer, ISyncShowResponseListener> _showResponseListeners = new Hashtable<Integer, ISyncShowResponseListener>();
+ private Hashtable<Integer, ISyncSpeakResponseListener> _speakResponseListeners = new Hashtable<Integer, ISyncSpeakResponseListener>();
+ private Hashtable<Integer, ISyncUnsubscribeButtonResponseListener> _unsubscribeButtonResponseListeners = new Hashtable<Integer, ISyncUnsubscribeButtonResponseListener>();
+
+ // SyncProxy Object
+ private SyncProxyALM syncProxy = null;
+
+ // ALM Interface Broker
+ private ALMInterfaceBroker _almInterfaceBroker = null;
+
+ // Command/Menu ID
+ private Integer _commandMenuID = 0;
+
+ // Choice ID
+ private Integer _interactionChoiceID = 0;
+
+ // ChoiceSet ID
+ private Integer _interactionChoiceSetID = 0;
+
+ // Correlation ID
+ private Integer _correlationID = 0;
+
+
+ /************************** Start Constructors **********************************/
+ /**
+ * Constructor for the SyncProxyALMManager object, the manager for communicating between the App and SYNC
+ *
+ * Takes advantage of the advanced lifecycle management.
+ * @param appName - Name of the application displayed on SYNC.
+ * @param isMediaApp - Indicates if the app is a media application.
+ */
+ public SyncProxyALMManager(ISyncALMLifeCycleListener lifeCycleListener, String appName, Boolean isMediaApp,
+ Language languageDesired, Language hmiDisplayLanguageDesired, String appID) throws SyncException {
+
+ this(lifeCycleListener);
+
+ syncProxy = new SyncProxyALM(_almInterfaceBroker, appName, isMediaApp,
+ languageDesired, hmiDisplayLanguageDesired, appID, new TestConfig());
+ }
+
+ /**
+ * Constructor for the SyncProxyALMManager object, the manager for communicating between the App and SYNC.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param appName - Name of the application displayed on SYNC.
+ * @param ngnMediaScreenAppName - Name of the application displayed on SYNC 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 syncMsgVersion - Indicates the version of SYNC AppLink Messages desired. Must be less than
+ * or equal to the version of SYNC AppLink running on the vehicle.
+ * @param languageDesired - Indicates the language desired for the SYNC interface.
+ * @param autoActivateID - ID used to re-register previously registered application.
+ * @throws SyncException
+ */
+ public SyncProxyALMManager(ISyncALMLifeCycleListener lifeCycleListener, String appName, String ngnMediaScreenAppName,
+ Vector<String> vrSynonyms, Boolean isMediaApp, SyncMsgVersion syncMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
+ String autoActivateID) throws SyncException{
+
+ this(lifeCycleListener);
+
+ syncProxy = new SyncProxyALM(_almInterfaceBroker, appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion,
+ languageDesired, hmiDisplayLanguageDesired, appID, autoActivateID, new TestConfig());
+ }
+
+ /**
+ * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param appName - Name of the application displayed on SYNC.
+ * @param ngnMediaScreenAppName - Name of the application displayed on SYNC 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 syncMsgVersion - Indicates the version of SYNC AppLink Messages desired. Must be less than
+ * or equal to the version of SYNC AppLink running on the vehicle.
+ * @param languageDesired - Indicates the language desired for the SYNC interface.
+ * @param autoActivateID - ID used to re-register previously registered application.
+ * @throws SyncException
+ */
+ public SyncProxyALMManager(ISyncALMLifeCycleListener lifeCycleListener, SyncProxyConfigurationResources syncProxyConfigurationResources,
+ String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms,
+ Boolean isMediaApp, SyncMsgVersion syncMsgVersion, Language languageDesired,
+ Language hmiDisplayLanguageDesired, String appID, String autoActivateID) throws SyncException {
+
+ this(lifeCycleListener);
+
+ syncProxy = new SyncProxyALM(_almInterfaceBroker, syncProxyConfigurationResources,
+ appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion,
+ languageDesired, hmiDisplayLanguageDesired, appID, autoActivateID, new TestConfig());
+ }
+
+ /**
+ * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param appName - Name of the application displayed on SYNC.
+ * @param ngnMediaScreenAppName - Name of the application displayed on SYNC 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 syncMsgVersion - Indicates the version of SYNC AppLink Messages desired. Must be less than
+ * or equal to the version of SYNC AppLink running on the vehicle.
+ * @param languageDesired - Indicates the language desired for the SYNC interface.
+ * @param autoActivateID - ID used to re-register previously registered application.
+ * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.
+ * @throws SyncException
+ */
+ public SyncProxyALMManager(ISyncALMLifeCycleListener lifeCycleListener, String appName, String ngnMediaScreenAppName,
+ Vector<String> vrSynonyms, Boolean isMediaApp, SyncMsgVersion syncMsgVersion,
+ Language languageDesired, Language hmiDisplayLanguageDesired, String appID,
+ String autoActivateID, boolean callbackToUIThread) throws SyncException {
+
+ this(lifeCycleListener);
+
+ syncProxy = new SyncProxyALM(_almInterfaceBroker, appName, ngnMediaScreenAppName,
+ vrSynonyms, isMediaApp, syncMsgVersion,
+ languageDesired, hmiDisplayLanguageDesired, appID, autoActivateID, callbackToUIThread,
+ new TestConfig());
+ }
+
+ /**
+ * Constructor for the SyncProxy object, the proxy for communicating between the App and SYNC.
+ *
+ * Takes advantage of the advanced lifecycle management.
+ *
+ * @param appName - Name of the application displayed on SYNC.
+ * @param ngnMediaScreenAppName - Name of the application displayed on SYNC 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 syncMsgVersion - Indicates the version of SYNC AppLink Messages desired. Must be less than
+ * or equal to the version of SYNC AppLink running on the vehicle.
+ * @param languageDesired - Indicates the language desired for the SYNC interface.
+ * @param autoActivateID - ID used to re-register previously registered application.
+ * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.
+ * @throws SyncException
+ */
+ public SyncProxyALMManager(ISyncALMLifeCycleListener lifeCycleListener, SyncProxyConfigurationResources syncProxyConfigurationResources,
+ String appName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp,
+ SyncMsgVersion syncMsgVersion, Language languageDesired,
+ Language hmiDisplayLanguageDesired, String appID, String autoActivateID,
+ boolean callbackToUIThread) throws SyncException {
+
+ this(lifeCycleListener);
+
+ syncProxy = new SyncProxyALM(_almInterfaceBroker, syncProxyConfigurationResources, appName, ngnMediaScreenAppName,
+ vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, hmiDisplayLanguageDesired, appID, autoActivateID,
+ callbackToUIThread, new TestConfig());
+ }
+
+ // Private constructor called by all public constructors
+ private SyncProxyALMManager(ISyncALMLifeCycleListener lifeCycleListener) throws SyncException {
+
+ // Ensure lifeCycleListener is not null
+ if (lifeCycleListener == null) {
+ throw new SyncException("IProxyALMLifeCycleListener cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ _almInterfaceBroker = new ALMInterfaceBroker();
+
+ _lifecycleListener = lifeCycleListener;
+ }
+ /************************** End Constructors **********************************/
+
+
+ // Function to return next correlation ID
+ private synchronized Integer getNextAlmCorrelationId() {
+ // Note: This method is synchronized to ensure no two calls ever return the same value
+ return _correlationID++;
+ }
+
+ // Function to return next commandMenuID
+ private synchronized Integer getNextAlmCommandMenuId() {
+ // Note: This method is synchronized to ensure no two calls ever return the same value
+ return _commandMenuID++;
+ }
+
+ // Function to return next interactionChoiceID
+ private synchronized Integer getNextInteractionChoiceID() {
+ // Note: This method is synchronized to ensure no two calls ever return the same value
+ return _interactionChoiceID++;
+ }
+
+ // Function to return next interactionChoiceSetID
+ private synchronized Integer getNextInteractionChoiceSetID() {
+ // Note: This method is synchronized to ensure no two calls ever return the same value
+ return _interactionChoiceSetID++;
+ }
+
+ /************************** Siphon Methods *************************************/
+ // Public method to enable the siphon transport
+ public static void enableSiphonDebug() {
+ SyncProxyBase.enableSiphonDebug();
+ }
+
+ // Public method to disable the Siphon Trace Server
+ public static void disableSiphonDebug() {
+ SyncProxyBase.disableSiphonDebug();
+ }
+ /************************** End Siphon Methods *************************************/
+
+ /*********************** Expose Public Proxy Methods *******************************/
+ public void dispose() throws SyncException {
+ syncProxy.dispose();
+ }
+
+ public void resetProxy() throws SyncException {
+ syncProxy.resetProxy();
+ }
+ /********************* End Expose Public Proxy Methods *****************************/
+
+
+
+ // DriverDistraction Listeners
+ private void addIProxyDriverDistractionListener(ISyncDriverDistractionListener newListener) {
+ _driverDistractionListeners.add(newListener);
+ }
+ private void removeIProxyDriverDistractionListener(ISyncDriverDistractionListener removeListener) {
+ _driverDistractionListeners.remove(removeListener);
+ }
+
+ // EncodedSyncPData Listeners
+ private void addIProxyEncodedSyncPDataListener(ISyncEncodedSyncPDataListener newListener) {
+ // Add a listener for new Encoded Sync PData
+ _encodedSyncPDataListeners.add(newListener);
+ }
+ private void removeIProxyEncodedSyncPDataListener(ISyncEncodedSyncPDataListener removeListener) {
+ // Add a listener for new Encoded Sync PData
+ _encodedSyncPDataListeners.remove(removeListener);
+ }
+
+ // SyncPData Listeners
+ private void addIProxySyncPDataListener(ISyncSyncPDataListener newListener) {
+ // Add a listener for new Sync PData
+ _syncPDataListeners.add(newListener);
+ }
+ private void removeIProxySyncPDataListener(ISyncSyncPDataListener removeListener) {
+ // Add a listener for new Sync PData
+ _syncPDataListeners.remove(removeListener);
+ }
+
+ // TBTClientState Listeners
+ private void addIProxyTBTClientStateListener(ISyncTBTClientStateListener newListener) {
+ _tbtClientStateListeners.add(newListener);
+ }
+ private void removeIProxyTBTClientStateListener(ISyncTBTClientStateListener removeListener) {
+ _tbtClientStateListeners.remove(removeListener);
+ }
+
+ // Button Listeners
+ private void addIProxySyncButtonListener(ISyncButtonListener newListener, Integer correlationID, ButtonName button) {
+ // Add button event/press listener
+ _buttonListeners.put(button, newListener);
+
+ // Add addButton response listener
+ _buttonResponseListeners.put(correlationID, newListener);
+ }
+ private void removeAddIProxySyncButtonListener(ButtonName button) {
+ _buttonListeners.remove(button);
+ }
+ private void removeAddIProxySyncButtonResponseListener(Integer correlationID) {
+ _buttonResponseListeners.remove(correlationID);
+ }
+
+ // Command Listeners
+ private void addIProxySyncCommandListener(ISyncCommandListener newListener,
+ Integer correltionID, Integer commandID) {
+ // Add listener for command selections
+ _commandListeners.put(commandID, newListener);
+
+ // Add listener for addCommand response
+ _commandResponseListeners.put(correltionID, newListener);
+ }
+ private void removeIProxySyncCommandListener(Integer commandID) {
+ _commandListeners.remove(commandID);
+ }
+ private void removeAddCommandResponseListener(Integer correlationID) {
+ _commandResponseListeners.remove(correlationID);
+ }
+
+ // SyncCommands
+ private void addSyncCommand(SyncCommand newSyncCommand, Integer correlationID) {
+ _syncCommandsByCommandID.put(newSyncCommand.getCommandID(), newSyncCommand);
+ _syncCommandsByCorrelationID.put(correlationID, newSyncCommand);
+ }
+ private void removeSyncCommand(SyncCommand syncCommandToRemove) {
+ _syncCommandsByCommandID.remove(syncCommandToRemove.getCommandID());
+ }
+ private void removeSyncCommandByCorrelationID(Integer correlationID) {
+ _syncCommandsByCorrelationID.remove(correlationID);
+ }
+
+ // EncodedSyncPDataResponse Listeners
+ private void addIProxyEncodedSyncPDataResponseListener(ISyncEncodedSyncPDataResponseListener newListener, Integer correlationID) {
+ // Add a listener for the response
+ _encodedSyncPDataResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxyEncodedSyncPDataResponseListener(Integer correlationID) {
+ _encodedSyncPDataResponseListeners.remove(correlationID);
+ }
+
+ // SyncPDataResponse Listeners
+ private void addIProxySyncPDataResponseListener(ISyncSyncPDataResponseListener newListener, Integer correlationID) {
+ // Add a listener for the response
+ _syncPDataResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxySyncPDataResponseListener(Integer correlationID) {
+ _syncPDataResponseListeners.remove(correlationID);
+ }
+
+ // AddSubMenuResponse Listeners
+ private void addIProxyAddSubMenuResponseListener(ISyncAddSubMenuResponseListener newListener, Integer correlationID) {
+ _addSubMenuResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxyAddSubMenuResponseListener(Integer correlationID) {
+ _addSubMenuResponseListeners.remove(correlationID);
+ }
+ private void addSyncSubMenuByCorrelationID(SyncSubMenu syncSubMenu, Integer correlationID) {
+ _syncSubMenusByCorrelationID.put(correlationID, syncSubMenu);
+ }
+ private void removeSyncSubMenuByCorrelationID(Integer correlationID) {
+ _syncSubMenusByCorrelationID.remove(correlationID);
+ }
+
+ // AlertResponse Listeners
+ private void addIProxyAlertResponseListener(ISyncAlertResponseListener newListener, Integer correlationID) {
+ _alertResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxyAlertResponseListener(Integer correlationID) {
+ _alertResponseListeners.remove(correlationID);
+ }
+
+ // CreateInteractionChoiceSetResponse Listeners
+ private void addIProxyCreateInteractionChoiceSetResponseListener(ISyncCreateInteractionChoiceSetResponseListener newListener, Integer correlationID) {
+ _createInteractionChoiceSetResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxyCreateInteractionChoiceSetResponse(Integer correlationID) {
+ _createInteractionChoiceSetResponseListeners.remove(correlationID);
+ }
+ private void associateSyncChoicesWithInteractionChoiceSet(Vector<SyncChoice> syncChoiceSet, Integer interactionChoiceSetID) {
+ _syncChoicesBySyncChoiceSetID.put(interactionChoiceSetID, syncChoiceSet);
+ }
+ private void addSyncChoiceSetByCorrelationID(SyncChoiceSet syncChoiceSet, Integer correlationID) {
+ _syncChoiceSetByCorrelationID.put(correlationID, syncChoiceSet);
+ }
+ private void removeSyncChoiceSetByCorrelationID(Integer correlationID) {
+ _syncChoiceSetByCorrelationID.remove(correlationID);
+ }
+
+ // DeleteCommandResponse Listeners
+ private void addIProxyDeleteCommandResponse(ISyncDeleteCommandResponseListener newListener, Integer correlationID) {
+ _createDeleteCommandResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxyDeleteCommandResponse(Integer correlationID) {
+ _createDeleteCommandResponseListeners.remove(correlationID);
+ }
+
+ // DeleteInteractionChoiceSetResponse Listeners
+ private void addIProxyDeleteInteractionChoiceSetResponseListener(ISyncDeleteInteractionChoiceSetResponseListener newListener, Integer correlationID) {
+ _deleteInteractionchoiceSetResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxyDeleteInteractionChoiceSetResponseListener(Integer correlationID) {
+ _deleteInteractionchoiceSetResponseListeners.remove(correlationID);
+ }
+ private void disassociateSyncChoicesWithInteractionChoiceSet(Integer interactionChoiceSetID) {
+ _syncChoicesBySyncChoiceSetID.remove(interactionChoiceSetID);
+ }
+
+ // DeleteSubMenuRespose Listeners
+ private void addIProxyDeleteSubMenuResponseListener(ISyncDeleteSubMenuResponseListener newListener, Integer correlationID) {
+ _deleteSubMenuResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxyDeleteSubMenuResponseListener(Integer correlationID) {
+ _deleteSubMenuResponseListeners.remove(correlationID);
+ }
+
+ // PerformInteractionResponse Listener
+ private void addIProxyPerformInteractionResponseListener(ISyncPerformInteractionResponseListener newListener, Integer correlationID) {
+ _performInteractionResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxyPerformInteractionResponseListener(Integer correlationID) {
+ _performInteractionResponseListeners.remove(correlationID);
+ }
+
+ // SetGlobalPropertiesResponse Listener
+ private void addIProxySetGlobalPropertiesResponseListener(ISyncSetGlobalPropertiesResponseListener newListener, Integer correlationID) {
+ _setGlobalPropertiesResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxySetGlobalPropertiesResponseListener(Integer correlationID) {
+ _setGlobalPropertiesResponseListeners.remove(correlationID);
+ }
+
+ // ResetGlobalPropertiesResponse Listener
+ private void addIProxyResetGlobalPropertiesListener(ISyncResetGlobalPropertiesListener newListener, Integer correlationID) {
+ _resetGlobalPropertiesResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxyResetGlobalPropertiesResponse(Integer correlationID) {
+ _resetGlobalPropertiesResponseListeners.remove(correlationID);
+ }
+
+ // SetMediaClockTimerResponse Listeners
+ private void addIProxySetMediaClockTimerResponseListener(ISyncSetMediaClockTimerResponseListener newListener, Integer correlationID) {
+ _setMediaClockTimerResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxySetMediaClockTimerResponseListener(Integer correlationID) {
+ _setMediaClockTimerResponseListeners.remove(correlationID);
+ }
+
+ // ShowResponse Listeners
+ private void addIProxyShowResponseListener(ISyncShowResponseListener newListener, Integer correlationID) {
+ _showResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxyShowResponseListener(Integer correlationID) {
+ _showResponseListeners.remove(correlationID);
+ }
+
+ // SpeakResponse Listeners
+ private void addIProxySpeakResponseListener(ISyncSpeakResponseListener newListener, Integer correlationID) {
+ _speakResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxySpeakResponseListener(Integer correlationID) {
+ _speakResponseListeners.remove(correlationID);
+ }
+
+ // UnsubscribeButtonResponse Listeners
+ private void addIProxyUnsubscribeButtonResponseListener(ISyncUnsubscribeButtonResponseListener newListener, Integer correlationID) {
+ _unsubscribeButtonResponseListeners.put(correlationID, newListener);
+ }
+ private void removeIProxyUnsubscribeButtonResponseListener(Integer correlationID) {
+ _unsubscribeButtonResponseListeners.remove(correlationID);
+ }
+
+ //****** IProxySyncInteractionChoiceListener
+ private void addIProxySyncInteractionChoiceListener(ISyncChoiceListener newListener,
+ Integer choiceID) {
+ // Add listener for choice selections
+ _interactionChoiceListeners.put(choiceID, newListener);
+ }
+ private void deleteIProxySyncInteractionChoiceListener(Integer choiceID) {
+ // TODO This is never called. Is there a time when we can delete a choice listener. I don't thinks so.
+
+ // Delete listener for choice selections
+ _interactionChoiceListeners.remove(choiceID);
+ }
+
+ // SyncChoices
+ private void addSyncChoice(SyncChoice newSyncChoice) {
+ _syncChoicesByChoiceID.put(newSyncChoice.getChoiceID(), newSyncChoice);
+ }
+ private void removeSyncChoice(SyncChoice syncChoiceToRemove) {
+ // TODO Currently, we do not delete SYNC Choices as they have no direct counterpart on SYNC.
+ _syncChoicesByChoiceID.remove(syncChoiceToRemove.getChoice());
+ }
+
+ // Generic Object Tags By CorrelationID
+ private void addGenericObjectTagByCorrelationID(Object tag, Integer correlationID) {
+ _genericTagsByCorrelationID.put(correlationID, tag);
+ }
+ private void removeGenericObjectTagByCorrelationID(Integer correlationID) {
+ _genericTagsByCorrelationID.remove(correlationID);
+ }
+
+ // Generic Object Tags By CommandID
+ private void addGenericObjectTagByCommandID(Object tag, Integer commandID) {
+ _genericTagsByCommandID.put(commandID, tag);
+ }
+ private void removeGenericObjectTagByCommandID(Integer commandID) {
+ _genericTagsByCommandID.remove(commandID);
+ }
+
+ // Generic Object Tags By ChoiceSetID
+ private void addGenericObjectTagByChoiceSetID(Object tag, Integer choiceSetID) {
+ _genericTagsByChoiceSetID.put(choiceSetID, tag);
+ }
+ private void removeGenericObjectTagByChoiceSetID(Integer choiceSetID) {
+ _genericTagsByChoiceSetID.remove(choiceSetID);
+ }
+
+ // Generic Object Tags By ChoiceID
+ private void addGenericObjectTagByChoiceID(Object tag, Integer choiceID) {
+ _genericTagsByChoiceID.put(choiceID, tag);
+ }
+ private void removeGenericObjectTagByChoiceID(Integer choiceID) {
+ // TODO: Is this needed? It's never called. I don't think so.
+ _genericTagsByChoiceID.remove(choiceID);
+ }
+
+ /***************** Public RPC Helper Methods ***************/
+ // Note: These are mandatory to use the native interface construct
+ /**
+ *Sends an AddCommand RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ *@param menuText
+ *@param position
+ *@param vrCommands
+ *@throws SyncException
+ */
+ public SyncCommand addSyncCommand(String menuText, SyncSubMenu parentSubMenu, Integer position,
+ Vector<String> vrCommands, Object tag, ISyncCommandListener listener)
+ throws SyncException {
+
+ // Listener required for addCommand
+ if (listener == null) {
+ throw new SyncException("IProxySyncCommandListener cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ Integer correlationID = getNextAlmCorrelationId();
+ Integer commandID = getNextAlmCommandMenuId();
+
+ // Create an SyncCommand Object to return
+ SyncCommand thisSyncCommand = new SyncCommand(commandID, parentSubMenu, position, menuText, vrCommands);
+
+ // Add listener
+ addIProxySyncCommandListener(listener, correlationID, commandID);
+
+ // Add SyncCommand
+ addSyncCommand(thisSyncCommand, correlationID);
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ addGenericObjectTagByCommandID(tag, commandID);
+ }
+
+ // Call base addCommand
+ if (parentSubMenu != null) {
+ syncProxy.addCommand(commandID, menuText, parentSubMenu.getMenuID(), position, vrCommands, correlationID);
+ } else {
+ syncProxy.addCommand(commandID, menuText, null, position, vrCommands, correlationID);
+ }
+ return thisSyncCommand;
+ }
+
+ /**
+ * Sends an AddCommand RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param menuText
+ * @param vrCommands
+ * @return
+ * @throws SyncException
+ */
+ public SyncCommand addSyncCommand(String menuText, Vector<String> vrCommands, Object tag, ISyncCommandListener listener)
+ throws SyncException {
+
+ return addSyncCommand(menuText, null, null, vrCommands, tag, listener);
+ }
+
+ /**
+ * Sends an AddCommand RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param vrCommands
+ * @return
+ * @throws SyncException
+ */
+ public SyncCommand addSyncCommand(Vector<String> vrCommands, Object tag, ISyncCommandListener listener)
+ throws SyncException {
+
+ return addSyncCommand(null, null, null, vrCommands, tag, listener);
+ }
+
+ /**
+ *Sends an AddCommand RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ *@param menuText
+ *@param position
+ * @return
+ *@throws SyncException
+ */
+ public SyncCommand addSyncCommand(String menuText, Integer position, Object tag,
+ ISyncCommandListener listener)
+ throws SyncException {
+
+ return addSyncCommand(menuText, null, position, null, tag, listener);
+ }
+
+ /**
+ *Sends an AddCommand RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ *@param menuText
+ * @return
+ *@throws SyncException
+ */
+ public SyncCommand addSyncCommand(String menuText, Object tag, ISyncCommandListener listener)
+ throws SyncException {
+
+ return addSyncCommand(menuText, null, null, null, tag, listener);
+ }
+
+ /**
+ * Sends an AddSyncSubMenu RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param menuName
+ * @param position
+ * @throws SyncException
+ */
+ public void addSyncSubMenu(String menuName, Integer position, Object tag,
+ ISyncAddSubMenuResponseListener listener)
+ throws SyncException {
+
+ // Require a listener
+ if (listener == null) {
+ throw new SyncException("ISyncAddSubMenuResponseListener cannot be null.",
+ SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ Integer correlationID = getNextAlmCorrelationId();
+ Integer menuID = getNextAlmCommandMenuId();
+
+ SyncSubMenu thisSubMenu = new SyncSubMenu(menuID, position, menuName);
+
+ addIProxyAddSubMenuResponseListener(listener, correlationID);
+ addSyncSubMenuByCorrelationID(thisSubMenu, correlationID);
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base addSubMenu
+ syncProxy.addSubMenu(menuID, menuName, position, correlationID);
+ }
+
+ /**
+ * Sends an AddSyncSubMenu RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param menuName
+ * @throws SyncException
+ */
+ public void addSyncSubMenu(String menuName, Object tag, ISyncAddSubMenuResponseListener listener)
+ throws SyncException {
+
+ addSyncSubMenu(menuName, null, tag, listener);
+ }
+
+ /**
+ * Sends an EncodedData RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param data
+ * @throws SyncException
+ */
+ public void encodedSyncPData(Vector<String> data, Object tag,
+ ISyncEncodedSyncPDataResponseListener listener)
+ throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ if (listener != null) {
+ // Add listener
+ addIProxyEncodedSyncPDataResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base encodedSyncPData
+ syncProxy.encodedSyncPData(data, correlationID);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsText
+ * @param alertText1
+ * @param alertText2
+ * @param playTone
+ * @param duration
+ * @throws SyncException
+ */
+ public void alert(String ttsText, String alertText1,
+ String alertText2, Boolean playTone, Integer duration,
+ Object tag, ISyncAlertResponseListener listener) throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyAlertResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base alert
+ syncProxy.alert(ttsText, alertText1, alertText2, playTone, duration, correlationID);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsChunks
+ * @param alertText1
+ * @param alertText2
+ * @param playTone
+ * @param duration
+ * @throws SyncException
+ */
+ public void alert(Vector<TTSChunk> ttsChunks,
+ String alertText1, String alertText2, Boolean playTone,
+ Integer duration, Object tag, ISyncAlertResponseListener listener)
+ throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyAlertResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ syncProxy.alert(ttsChunks, alertText1, alertText2, playTone, duration, correlationID);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsText
+ * @param playTone
+ * @throws SyncException
+ */
+ public void alert(String ttsText, Boolean playTone, Object tag,
+ ISyncAlertResponseListener listener) throws SyncException {
+
+ alert(ttsText, null, null, playTone, null, tag, listener);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param alertText1
+ * @param alertText2
+ * @param duration
+ * @throws SyncException
+ */
+ public void alert(String alertText1, String alertText2, Boolean playTone,
+ Integer duration, Object tag, ISyncAlertResponseListener listener)
+ throws SyncException {
+
+ alert((Vector<TTSChunk>)null, alertText1, alertText2, playTone, duration, tag, listener);
+ }
+
+ /**
+ * Sends an Alert RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param chunks
+ * @param playTone
+ * @throws SyncException
+ */
+ public void alert(Vector<TTSChunk> chunks, Boolean playTone, Object tag,
+ ISyncAlertResponseListener listener) throws SyncException {
+
+ alert(chunks, null, null, playTone, null, tag, listener);
+ }
+
+ /**
+ * Sends a CreateInteractionChoiceSet RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param syncChoiceSet
+ * @throws SyncException
+ */
+ public SyncChoiceSet createInteractionChoiceSet(Vector<SyncChoice> syncChoiceSet, Object tag,
+ ISyncCreateInteractionChoiceSetResponseListener listener)
+ throws SyncException {
+
+ // Require a SyncChoiceSet
+ if (syncChoiceSet == null) {
+ throw new SyncException("syncChoiceSet cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ // Require a listener
+ if (listener == null) {
+ throw new SyncException("ISyncCreateInteractionChoiceSetResponseListener cannot be null.",
+ SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ Integer correlationID = getNextAlmCorrelationId();
+ Integer interactionChoiceSetID = getNextInteractionChoiceSetID();
+
+ // Add listener
+ addIProxyCreateInteractionChoiceSetResponseListener(listener, correlationID);
+
+ SyncChoiceSet syncInteractionChoiceSet = new SyncChoiceSet(interactionChoiceSetID, syncChoiceSet);
+
+ // Convert the Vector<SyncChoice> to a Vector<Choice>
+ Vector<Choice> choiceSet = new Vector<Choice>();
+ Iterator<SyncChoice> itr = syncChoiceSet.iterator();
+ while (itr.hasNext()) {
+ SyncChoice tempChoice = itr.next();
+
+ if (tempChoice != null) {
+ choiceSet.add(tempChoice.getChoice());
+ }
+ }
+
+ // Add vector of choices for deletion purposes, because each choice
+ // can only be used with one interaction choice set
+ associateSyncChoicesWithInteractionChoiceSet(syncChoiceSet, interactionChoiceSetID);
+
+ // Associate this choice set with its correlationID
+ addSyncChoiceSetByCorrelationID(syncInteractionChoiceSet, correlationID);
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ addGenericObjectTagByChoiceSetID(tag, interactionChoiceSetID);
+ }
+
+ // Base createInteractionChoiceSet
+ syncProxy.createInteractionChoiceSet(choiceSet, interactionChoiceSetID, correlationID);
+ return syncInteractionChoiceSet;
+ }
+
+ /**
+ * Sends a DeleteInteractionChoiceSet RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @throws SyncException
+ */
+ public void deleteSyncChoiceSet(SyncChoiceSet syncChoiceSetToDelete,
+ Object tag, ISyncDeleteInteractionChoiceSetResponseListener listener)
+ throws SyncException {
+
+ // Ensure syncChoiceSetToDelete is not null
+ if (syncChoiceSetToDelete == null) {
+ throw new SyncException("SyncChoiceSet cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyDeleteInteractionChoiceSetResponseListener(listener, correlationID);
+ }
+
+ // Delete list of choice set choices
+ disassociateSyncChoicesWithInteractionChoiceSet(syncChoiceSetToDelete.getChoiceSetID());
+ // Delete any object tags associated with the choice set
+ removeGenericObjectTagByChoiceSetID(syncChoiceSetToDelete.getChoiceSetID());
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base deleteInteracationChoiceSet
+ syncProxy.deleteInteractionChoiceSet(syncChoiceSetToDelete.getChoiceSetID(), correlationID);
+ }
+
+
+
+ /**
+ * Deletes a SyncCommand from the Ford SYNC System.
+ *
+ * @param syncCommandToDelete - The Choice SyncCommand to delete.
+ * @param listener - Interface to return the response to the deleteCommand request.
+ * @throws SyncException
+ */
+ public void deleteSyncCommand(SyncCommand syncCommandToDelete, Object tag,
+ ISyncDeleteCommandResponseListener listener) throws SyncException{
+
+ // Do not allow syncCommandToDelete to be null
+ if (syncCommandToDelete == null) {
+ throw new SyncException("SyncCommand cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Remove command selector listener
+ removeIProxySyncCommandListener(syncCommandToDelete.getCommandID());
+
+ // Remove the Tag for this Command
+ removeGenericObjectTagByCommandID(syncCommandToDelete.getCommandID());
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyDeleteCommandResponse(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base deleteCommand (from SYNC)
+ syncProxy.deleteCommand(syncCommandToDelete.getCommandID(), correlationID);
+
+ // Remove SyncCommand from list of SyncCommands
+ removeSyncCommand(syncCommandToDelete);
+ }
+
+ /**
+ * Sends a DeleteSubMenu RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @throws SyncException
+ */
+ public void deleteSyncSubMenu(SyncSubMenu syncSubMenuToDelete, Object tag,
+ ISyncDeleteSubMenuResponseListener listener) throws SyncException {
+
+ if (syncSubMenuToDelete == null) {
+ throw new SyncException("SyncSubMenu must not be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyDeleteSubMenuResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base deleteSubMenu
+ syncProxy.deleteSubMenu(syncSubMenuToDelete.getMenuID(), correlationID);
+ }
+
+ /**
+ * Sends a PerformInteraction RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param initPrompt
+ * @param displayText
+ * @param syncChoiceSet
+ * @throws SyncException
+ */
+ public void performInteraction(String initPrompt, String displayText,
+ SyncChoiceSet syncChoiceSet, Object tag,
+ ISyncPerformInteractionResponseListener listener)
+ throws SyncException {
+
+ if (syncChoiceSet == null) {
+ throw new SyncException("SyncChoiceSet cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyPerformInteractionResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base performInteraction
+ syncProxy.performInteraction(initPrompt, displayText, syncChoiceSet.getChoiceSetID(), correlationID);
+ }
+
+ /**
+ * Sends a PerformInteraction RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param initPrompt
+ * @param displayText
+ * @param syncChoiceSet
+ * @throws SyncException
+ */
+ public void performInteraction(String initPrompt,
+ String displayText, SyncChoiceSet syncChoiceSet,
+ String helpPrompt, String timeoutPrompt, InteractionMode interactionMode,
+ Integer timeout, Object tag,
+ ISyncPerformInteractionResponseListener listener)
+ throws SyncException {
+
+ if (syncChoiceSet == null) {
+ throw new SyncException("SyncChoiceSet must not be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyPerformInteractionResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base performInteraction
+ syncProxy.performInteraction(initPrompt, displayText, syncChoiceSet.getChoiceSetID(), helpPrompt, timeoutPrompt, interactionMode, timeout, correlationID);
+ }
+
+ /**
+ * Sends a PerformInteraction RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param initPrompt
+ * @param displayText
+ * @param syncChoiceSetList
+ * @param helpPrompt
+ * @param timeoutPrompt
+ * @param interactionMode
+ * @param timeout
+ * @throws SyncException
+ */
+ public void performInteraction(String initPrompt,
+ String displayText, Vector<SyncChoiceSet> syncChoiceSetList,
+ String helpPrompt, String timeoutPrompt,
+ InteractionMode interactionMode, Integer timeout, Object tag,
+ ISyncPerformInteractionResponseListener listener)
+ throws SyncException {
+
+ if (syncChoiceSetList == null) {
+ throw new SyncException("syncChoiceSetList must not be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyPerformInteractionResponseListener(listener, correlationID);
+ }
+
+ // Convert the vector of InteractionChoiceSets to a vecto of their IDs
+ Vector<Integer> interactionChoiceSetIDList = new Vector<Integer>();
+ Iterator<SyncChoiceSet> itr = syncChoiceSetList.iterator();
+ while (itr.hasNext()) {
+ SyncChoiceSet thisChoiceSet = itr.next();
+
+ if (thisChoiceSet != null) {
+ interactionChoiceSetIDList.add(thisChoiceSet.getChoiceSetID());
+ }
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base performInteraction
+ syncProxy.performInteraction(initPrompt, displayText, interactionChoiceSetIDList, helpPrompt,
+ timeoutPrompt, interactionMode, timeout, correlationID);
+ }
+
+ /**
+ * Sends a PerformInteraction RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param initChunks
+ * @param displayText
+ * @param syncChoiceSetList
+ * @param helpChunks
+ * @param timeoutChunks
+ * @param interactionMode
+ * @param timeout
+ * @throws SyncException
+ */
+ public void performInteraction(
+ Vector<TTSChunk> initChunks, String displayText,
+ Vector<SyncChoiceSet> syncChoiceSetList,
+ Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
+ InteractionMode interactionMode, Integer timeout, Object tag,
+ ISyncPerformInteractionResponseListener listener)
+ throws SyncException {
+
+ if (syncChoiceSetList == null) {
+ throw new SyncException("syncChoiceSetList must not be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyPerformInteractionResponseListener(listener, correlationID);
+ }
+
+ // Convert the vector of InteractionChoiceSets to a vecto of their IDs
+ Vector<Integer> interactionChoiceSetIDList = new Vector<Integer>();
+ Iterator<SyncChoiceSet> itr = syncChoiceSetList.iterator();
+ while (itr.hasNext()) {
+ SyncChoiceSet thisChoiceSet = itr.next();
+
+ if (thisChoiceSet != null) {
+ interactionChoiceSetIDList.add(itr.next().getChoiceSetID());
+ }
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base performInteracation
+ syncProxy.performInteraction(initChunks, displayText, interactionChoiceSetIDList,
+ helpChunks, timeoutChunks, interactionMode, timeout, correlationID);
+ }
+
+ /**
+ * Sends a SetGlobalProperties RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param helpPrompt
+ * @param timeoutPrompt
+ * @throws SyncException
+ */
+ public void setGlobalProperties(String helpPrompt, String timeoutPrompt,
+ Object tag, ISyncSetGlobalPropertiesResponseListener listener)
+ throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxySetGlobalPropertiesResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base setGlobalProperties
+ syncProxy.setGlobalProperties(helpPrompt, timeoutPrompt, correlationID);
+ }
+
+ /**
+ * Sends a SetGlobalProperties RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param helpChunks
+ * @param timeoutChunks
+ * @throws SyncException
+ */
+ public void setGlobalProperties(
+ Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
+ Object tag, ISyncSetGlobalPropertiesResponseListener listener)
+ throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxySetGlobalPropertiesResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base setGlobalProperties
+ syncProxy.setGlobalProperties(helpChunks, timeoutChunks, correlationID);
+ }
+
+ public void resetGlobalProperties(Vector<GlobalProperty> properties,
+ Object tag, ISyncResetGlobalPropertiesListener listener)
+ throws SyncException{
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyResetGlobalPropertiesListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base resetGlobalProperties
+ syncProxy.resetGlobalProperties(properties, correlationID);
+ }
+
+ /**
+ * Sends a SetMediaClockTimer RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param hours
+ * @param minutes
+ * @param seconds
+ * @param updateMode
+ * @throws SyncException
+ */
+ public void setMediaClockTimer(Integer hours,
+ Integer minutes, Integer seconds, UpdateMode updateMode,
+ Object tag, ISyncSetMediaClockTimerResponseListener listener)
+ throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxySetMediaClockTimerResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base setMediaClockTimer
+ syncProxy.setMediaClockTimer(hours, minutes, seconds, updateMode, correlationID);
+ }
+
+ /**
+ * Pauses the media clock. Responses are captured through callback on IProxyListener.
+ *
+ * @throws SyncException
+ */
+ public void pauseMediaClockTimer(Object tag, ISyncSetMediaClockTimerResponseListener listener)
+ throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxySetMediaClockTimerResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base pauseMediaClockTimer
+ syncProxy.pauseMediaClockTimer(correlationID);
+ }
+
+ /**
+ * Resumes the media clock. Responses are captured through callback on IProxyListener.
+ *
+ * @param listener
+ * @throws SyncException
+ */
+ public void resumeMediaClockTimer(Object tag, ISyncSetMediaClockTimerResponseListener listener)
+ throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxySetMediaClockTimerResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base pauseMediaClockTimer
+ syncProxy.resumeMediaClockTimer(correlationID);
+ }
+
+ /**
+ * Clears the media clock. Responses are captured through the ISyncShowResponseListener
+ *
+ * @param listener
+ * @throws SyncException
+ */
+ public void clearMediaClockTimer(Object tag, ISyncShowResponseListener listener) throws SyncException{
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyShowResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ syncProxy.clearMediaClockTimer(correlationID);
+ }
+
+ /**
+ * Sends a Show RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param mainText1
+ * @param mainText2
+ * @param statusBar
+ * @param mediaClock
+ * @param mediaTrack
+ * @param alignment
+ * @throws SyncException
+ */
+ public void show(String mainText1, String mainText2,
+ String statusBar, String mediaClock, String mediaTrack,
+ TextAlignment alignment, Object tag,
+ ISyncShowResponseListener listener)
+ throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyShowResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base show
+ syncProxy.show(mainText1, mainText2, statusBar, mediaClock, mediaTrack, alignment, correlationID);
+ }
+
+ /**
+ * Sends a Show RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param mainText1
+ * @param mainText2
+ * @param alignment
+ * @throws SyncException
+ */
+ public void show(String mainText1, String mainText2,
+ TextAlignment alignment, Object tag,
+ ISyncShowResponseListener listener)
+ throws SyncException {
+
+ show(mainText1, mainText2, null, null, null, alignment, tag, listener);
+ }
+
+ /**
+ * Sends a Speak RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsText
+ * @throws SyncException
+ */
+ public void speak(String ttsText, Object tag,
+ ISyncSpeakResponseListener listener)
+ throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxySpeakResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base speak
+ syncProxy.speak(ttsText, correlationID);
+ }
+
+ /**
+ * Sends a Speak RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param ttsChunks
+ * @throws SyncException
+ */
+ public void speak(Vector<TTSChunk> ttsChunks, Object tag,
+ ISyncSpeakResponseListener listener) throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxySpeakResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base speak
+ syncProxy.speak(ttsChunks, correlationID);
+ }
+
+ public void longSpeak(String ttsText, Object tag, ISyncSpeakResponseListener listener) throws SyncException{
+
+ SpeakTextParser speakParser = new SpeakTextParser(ttsText, tag, listener);
+ speakParser.speakFromQueue();
+ }
+
+ // TODO create a longSpeak using TTSChunks
+
+ /**
+ * Sends a SubscribeButton RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param buttonName
+ * @throws SyncException
+ */
+ public void subscribeButton(ButtonName buttonName, Object tag,
+ ISyncButtonListener listener) throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ // Listener required for addCommand
+ if (listener == null) {
+ throw new SyncException("IProxySyncButtonListener cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ addIProxySyncButtonListener(listener, correlationID, buttonName);
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base subscribeButton
+ syncProxy.subscribeButton(buttonName, correlationID);
+ }
+
+ /**
+ * Sends an UnsubscribeButton RPCRequest to SYNC. Responses are captured through callback on IProxyListener.
+ *
+ * @param buttonName
+ * @throws SyncException
+ */
+ public void unsubscribeButton(ButtonName buttonName, Object tag,
+ ISyncUnsubscribeButtonResponseListener listener)
+ throws SyncException {
+
+ Integer correlationID = getNextAlmCorrelationId();
+
+ removeAddIProxySyncButtonListener(buttonName);
+
+ // Add listener if listener is given
+ if (listener != null) {
+ addIProxyUnsubscribeButtonResponseListener(listener, correlationID);
+ }
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByCorrelationID(tag, correlationID);
+ }
+
+ // Base unsubscribeButton
+ syncProxy.unsubscribeButton(buttonName, correlationID);
+ }
+
+ /**
+ * Subscribes to notifications concerning the TBTClient State
+ *
+ * @param listener
+ * @throws SyncException
+ */
+ public void subscribeToTBTClientState(ISyncTBTClientStateListener listener) throws SyncException{
+
+ if (listener == null) {
+ throw new SyncException("ISyncTBTClientStateListener cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ addIProxyTBTClientStateListener(listener);
+ }
+
+ /**
+ * Unsubscribes from notifications concerning the TBTClient State
+ *
+ * @param listener
+ * @throws SyncException
+ */
+ public void unsubscribeFromTBTClientState(ISyncTBTClientStateListener listener) throws SyncException{
+
+ if (listener == null) {
+ throw new SyncException("ISyncTBTClientStateListener cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ removeIProxyTBTClientStateListener(listener);
+ }
+
+ /**
+ * Subscribes to notifications concerning the DriverDistraction State
+ *
+ * @param listener
+ * @throws SyncException
+ */
+ public void subscribeToDriverDistractionState(ISyncDriverDistractionListener listener) throws SyncException{
+
+ if (listener == null) {
+ throw new SyncException("ISyncDriverDistractionListener cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ addIProxyDriverDistractionListener(listener);
+ }
+
+ /**
+ * Unsubscribes from notifications concerning the DriverDistraction State
+ *
+ * @param listener
+ * @throws SyncException
+ */
+ public void unsubscribeFromDriverDistractionState(ISyncDriverDistractionListener listener) throws SyncException{
+
+ if (listener == null) {
+ throw new SyncException("ISyncDriverDistractionListener cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ removeIProxyDriverDistractionListener(listener);
+ }
+
+ /**
+ * Subscribes to notifications concerning EncodedSyncPData
+ *
+ * @param listener
+ * @throws SyncException
+ */
+ public void subscribeToEncodedSyncPData(ISyncEncodedSyncPDataListener listener) throws SyncException{
+
+ if (listener == null) {
+ throw new SyncException("ISyncEncodedSyncPDataListener cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ addIProxyEncodedSyncPDataListener(listener);
+ }
+
+ /**
+ * Unsubscribes from notifications concerning EncodedSyncPData
+ *
+ * @param listener
+ * @throws SyncException
+ */
+ public void unsubscribeFromEncodedSyncPData(ISyncEncodedSyncPDataListener listener) throws SyncException{
+
+ if (listener == null) {
+ throw new SyncException("ISyncEncodedSyncPDataListener cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ removeIProxyEncodedSyncPDataListener(listener);
+ }
+
+ /**
+ * Subscribes to notifications concerning SyncPData
+ *
+ * @param listener
+ * @throws SyncException
+ */
+ public void subscribeToSyncPData(ISyncSyncPDataListener listener) throws SyncException{
+
+ if (listener == null) {
+ throw new SyncException("ISyncSyncPDataListener cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ addIProxySyncPDataListener(listener);
+ }
+
+ /**
+ * Unsubscribes from notifications concerning SyncPData
+ *
+ * @param listener
+ * @throws SyncException
+ */
+ public void unsubscribeFromSyncPData(ISyncSyncPDataListener listener) throws SyncException{
+
+ if (listener == null) {
+ throw new SyncException("ISyncSyncPDataListener cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ removeIProxySyncPDataListener(listener);
+ }
+
+ /**
+ * Creates a choice to be added to a choiceset. Choice has both a voice and a visual menu component.
+ *
+ * @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.
+ * @throws SyncException
+ */
+ public SyncChoice createChoiceSetChoice(String choiceMenuName,
+ Vector<String> choiceVrCommands, Object tag,
+ ISyncChoiceListener listener) throws SyncException
+ {
+ Integer choiceID = getNextInteractionChoiceID();
+
+ // Listener required for addCommand
+ if (listener == null) {
+ throw new SyncException("ISyncChoiceListener cannot be null.", SyncExceptionCause.INVALID_ARGUMENT);
+ }
+
+ SyncChoice syncChoice = new SyncChoice(syncProxy.createChoiceSetChoice(choiceID, choiceMenuName, choiceVrCommands));
+
+ addIProxySyncInteractionChoiceListener(listener, choiceID);
+
+ // Add SyncChoice
+ addSyncChoice(syncChoice);
+
+ // Add tag, if given
+ if (tag != null) {
+ addGenericObjectTagByChoiceID(tag, choiceID);
+ }
+
+ // Base createChoiceSetChoice
+ return syncChoice;
+ }
+ /********************* End Public Helper Methods ******************/
+
+
+
+
+
+ /************************ Callbacks ************************/
+ // A class which handles all IProxyListenerALM callbacks for the manager
+ private class ALMInterfaceBroker implements IProxyListenerALM{
+
+ @Override
+ public void onAddSubMenuResponse(AddSubMenuResponse response) {
+ final ISyncAddSubMenuResponseListener listener = _addSubMenuResponseListeners.get(response.getCorrelationID());
+ SyncSubMenu syncSubMenuToReturn = null;
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // If adding command was successful, find the command that was added
+ if (response.getSuccess()) {
+ syncSubMenuToReturn = _syncSubMenusByCorrelationID.get(response.getCorrelationID());
+ removeSyncSubMenuByCorrelationID(response.getCorrelationID());
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onAddSubMenuResponse(response, syncSubMenuToReturn, tagToReturn);
+
+ removeIProxyAddSubMenuResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onAlertResponse(AlertResponse response) {
+ final ISyncAlertResponseListener listener = _alertResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onAlertResponse(response, tagToReturn);
+
+ removeIProxyAlertResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onCreateInteractionChoiceSetResponse(
+ CreateInteractionChoiceSetResponse response) {
+ final ISyncCreateInteractionChoiceSetResponseListener listener = _createInteractionChoiceSetResponseListeners.get(response.getCorrelationID());
+ SyncChoiceSet syncChoiceSetToReturn = null;
+ Object tagToReturn = null;
+
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // If adding choiceset was successful, find the choiceset that was added
+ if (response.getSuccess()) {
+ syncChoiceSetToReturn = _syncChoiceSetByCorrelationID.get(response.getCorrelationID());
+ removeSyncChoiceSetByCorrelationID(response.getCorrelationID());
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onCreateInteractionChoiceSetResponse(response, syncChoiceSetToReturn, tagToReturn);
+
+ removeIProxyCreateInteractionChoiceSetResponse(response.getCorrelationID());
+ }
+
+ @Override
+ public void onDeleteCommandResponse(DeleteCommandResponse response) {
+ final ISyncDeleteCommandResponseListener listener = _createDeleteCommandResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onDeleteCommandResponse(response, tagToReturn);
+
+ removeIProxyDeleteCommandResponse(response.getCorrelationID());
+ }
+
+ @Override
+ public void onDeleteInteractionChoiceSetResponse(
+ DeleteInteractionChoiceSetResponse response) {
+ final ISyncDeleteInteractionChoiceSetResponseListener listener = _deleteInteractionchoiceSetResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onDeleteInteractionChoiceSetResponse(response, tagToReturn);
+
+ removeIProxyDeleteInteractionChoiceSetResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onDeleteSubMenuResponse(DeleteSubMenuResponse response) {
+ final ISyncDeleteSubMenuResponseListener listener = _deleteSubMenuResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onDeleteSubMenuResponse(response, tagToReturn);
+
+ removeIProxyDeleteSubMenuResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onOnDriverDistraction(OnDriverDistraction notification) {
+ for (Iterator<ISyncDriverDistractionListener> i = _driverDistractionListeners.iterator(); i.hasNext();) {
+ final ISyncDriverDistractionListener listener = i.next();
+
+ listener.onOnDriverDistraction(notification);
+ }
+ }
+
+ @Override
+ public void onOnEncodedSyncPData(OnEncodedSyncPData notification) {
+ for (Iterator<ISyncEncodedSyncPDataListener> i = _encodedSyncPDataListeners.iterator(); i.hasNext();) {
+ final ISyncEncodedSyncPDataListener listener = i.next();
+
+ listener.onOnEncodedSyncPData(notification);
+ }
+ }
+
+ @Override
+ public void onOnSyncPData(OnSyncPData notification) {
+ for (Iterator<ISyncSyncPDataListener> i = _syncPDataListeners.iterator(); i.hasNext();) {
+ final ISyncSyncPDataListener listener = i.next();
+
+ listener.onOnSyncPData(notification);
+ }
+ }
+
+ @Override
+ public void onEncodedSyncPDataResponse(EncodedSyncPDataResponse response) {
+ final ISyncEncodedSyncPDataResponseListener listener = _encodedSyncPDataResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onEncodedSyncPDataResponse(response, tagToReturn);
+
+ removeIProxyEncodedSyncPDataResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onSyncPDataResponse(SyncPDataResponse response) {
+ final ISyncSyncPDataResponseListener listener = _syncPDataResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onSyncPDataResponse(response, tagToReturn);
+
+ removeIProxySyncPDataResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onError(String info, Throwable e) {
+ _lifecycleListener.onError(info, e);
+ }
+
+ @Override
+ public void onPerformInteractionResponse(PerformInteractionResponse response) {
+ final ISyncPerformInteractionResponseListener listener = _performInteractionResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Notify Choice listener that choice was chosen
+ if (response.getChoiceID() != null) {
+ final ISyncChoiceListener choiceListener = _interactionChoiceListeners.get(response.getChoiceID());
+ final SyncChoice syncChoiceChosen = _syncChoicesByChoiceID.get(response.getChoiceID());
+
+ // Return if listener is null
+ if (choiceListener != null) {
+ Object optionTagToReturn = null;
+ optionTagToReturn = _genericTagsByChoiceID.get(response.getChoiceID());
+
+ // Only preform callback if one had been added
+ OnSyncChoiceChosen choiceChosenMsg = new OnSyncChoiceChosen();
+
+ if (syncChoiceChosen != null) {
+ choiceChosenMsg.setSyncChoice(syncChoiceChosen);
+ }
+ choiceChosenMsg.setTriggerSource(response.getTriggerSource());
+
+ choiceListener.onSyncChoiceChosen(choiceChosenMsg, optionTagToReturn);
+ }
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onPerformInteractionResponse(response, tagToReturn);
+
+ removeIProxyPerformInteractionResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onResetGlobalPropertiesResponse(
+ ResetGlobalPropertiesResponse response) {
+ final ISyncResetGlobalPropertiesListener listener = _resetGlobalPropertiesResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onResetGlobalPropertiesResponse(response, tagToReturn);
+
+ removeIProxyResetGlobalPropertiesResponse(response.getCorrelationID());
+ }
+
+ @Override
+ public void onSetGlobalPropertiesResponse(
+ SetGlobalPropertiesResponse response) {
+ final ISyncSetGlobalPropertiesResponseListener listener = _setGlobalPropertiesResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onSetGlobalPropertiesResponse(response, tagToReturn);
+
+ removeIProxySetGlobalPropertiesResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onSetMediaClockTimerResponse(SetMediaClockTimerResponse response) {
+ final ISyncSetMediaClockTimerResponseListener listener = _setMediaClockTimerResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onSetMediaClockTimerResponse(response, tagToReturn);
+
+ removeIProxySetMediaClockTimerResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onShowResponse(ShowResponse response) {
+ final ISyncShowResponseListener listener = _showResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onShowResponse(response, tagToReturn);
+
+ removeIProxyShowResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onSpeakResponse(SpeakResponse response) {
+ final ISyncSpeakResponseListener listener = _speakResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onSpeakResponse(response, tagToReturn);
+
+ removeIProxySpeakResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onOnButtonEvent(OnButtonEvent notification) {
+ final ISyncButtonListener listener = _buttonListeners.get(notification.getButtonName());
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ listener.onOnButtonEvent(notification);
+ }
+
+ @Override
+ public void onOnButtonPress(OnButtonPress notification) {
+ final ISyncButtonListener listener = _buttonListeners.get(notification.getButtonName());
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ listener.onOnButtonPress(notification);
+ }
+
+ @Override
+ public void onSubscribeButtonResponse(SubscribeButtonResponse response) {
+ final ISyncButtonListener listener = _buttonResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onSubscribeButtonResponse(response, tagToReturn);
+
+ removeAddIProxySyncButtonResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onOnCommand(OnCommand notification) {
+ final ISyncCommandListener listener = _commandListeners.get(notification.getCmdID());
+ final SyncCommand syncCommand = _syncCommandsByCommandID.get(notification.getCmdID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener != null) {
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCommandID.get(notification.getCmdID());
+
+ listener.onSyncCommand(notification, syncCommand, tagToReturn);
+ }
+ }
+
+ @Override
+ public void onAddCommandResponse(AddCommandResponse response) {
+ final ISyncCommandListener listener = _commandResponseListeners.get(response.getCorrelationID());
+ SyncCommand syncCommandToReturn = null;
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // If adding command was successful, find the command that was added
+ if (response.getSuccess()) {
+ syncCommandToReturn = _syncCommandsByCorrelationID.get(response.getCorrelationID());
+ removeSyncCommandByCorrelationID(response.getCorrelationID());
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onAddCommandResponse(response, syncCommandToReturn, tagToReturn);
+
+ removeAddCommandResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onOnTBTClientState(OnTBTClientState notification) {
+ for (Iterator<ISyncTBTClientStateListener> i = _tbtClientStateListeners.iterator(); i.hasNext();) {
+ final ISyncTBTClientStateListener listener = i.next();
+
+ listener.onOnTBTClientState(notification);
+ }
+ }
+
+ @Override
+ public void onUnsubscribeButtonResponse(UnsubscribeButtonResponse response) {
+ final ISyncUnsubscribeButtonResponseListener listener = _unsubscribeButtonResponseListeners.get(response.getCorrelationID());
+ Object tagToReturn = null;
+
+ // Return if listener is null
+ if (listener == null) {
+ return;
+ }
+
+ // Set tag, null if none exists
+ tagToReturn = _genericTagsByCorrelationID.get(response.getCorrelationID());
+ // Remove any tag tied to this correlationID
+ removeGenericObjectTagByCorrelationID(response.getCorrelationID());
+
+ listener.onUnsubscribeButtonResponse(response, tagToReturn);
+
+ removeIProxyUnsubscribeButtonResponseListener(response.getCorrelationID());
+ }
+
+ @Override
+ public void onGenericResponse(GenericResponse response) {
+ _lifecycleListener.onGenericResponse(response);
+ }
+
+ @Override
+ public void onOnPermissionsChange(OnPermissionsChange notification) {
+ _lifecycleListener.onOnPermissionsChange(notification);
+ }
+
+ @Override
+ public void onOnHMIStatus(OnHMIStatus notification) {
+ _lifecycleListener.onOnHMIStatus(notification);
+ }
+
+ @Override
+ public void onProxyClosed(String info, Exception e) {
+ // Remove all manager copies of resources corresponding to copies no longer
+ // present in SYNC
+ _syncCommandsByCommandID.clear();
+ _syncChoicesByChoiceID.clear();
+ _syncChoicesBySyncChoiceSetID.clear();
+
+ // Notify the listener that SYNC has been disconnected
+ _lifecycleListener.onProxyClosed(info, e);
+ }
+
+ @Override
+ public void onSubscribeVehicleDataResponse(SubscribeVehicleDataResponse response) {
+ _lifecycleListener.onSubscribeVehicleDataResponse(response);
+ }
+
+ @Override
+ public void onUnsubscribeVehicleDataResponse(UnsubscribeVehicleDataResponse response) {
+ _lifecycleListener.onUnsubscribeVehicleDataResponse(response);
+ }
+
+ @Override
+ public void onGetVehicleDataResponse(GetVehicleDataResponse response) {
+ _lifecycleListener.onGetVehicleDataResponse(response);
+ }
+
+ @Override
+ public void onReadDIDResponse(ReadDIDResponse response) {
+ _lifecycleListener.onReadDIDResponse(response);
+ }
+
+ @Override
+ public void onGetDTCsResponse(GetDTCsResponse response) {
+ _lifecycleListener.onGetDTCsResponse(response);
+ }
+
+ @Override
+ public void onOnVehicleData(OnVehicleData notification) {
+ _lifecycleListener.onOnVehicleData(notification);
+ }
+
+ @Override
+ public void onPerformAudioPassThruResponse(PerformAudioPassThruResponse response) {
+ _lifecycleListener.onPerformAudioPassThruResponse(response);
+ }
+
+ @Override
+ public void onEndAudioPassThruResponse(EndAudioPassThruResponse response) {
+ _lifecycleListener.onEndAudioPassThruResponse(response);
+ }
+
+ @Override
+ public void onOnAudioPassThru(OnAudioPassThru notification) {
+ _lifecycleListener.onOnAudioPassThru(notification);
+ }
+
+ @Override
+ public void onPutFileResponse(PutFileResponse response) {
+ _lifecycleListener.onPutFileResponse(response);
+ }
+
+ @Override
+ public void onDeleteFileResponse(DeleteFileResponse response) {
+ _lifecycleListener.onDeleteFileResponse(response);
+ }
+
+ @Override
+ public void onListFilesResponse(ListFilesResponse response) {
+ _lifecycleListener.onListFilesResponse(response);
+ }
+
+ @Override
+ public void onSetAppIconResponse(SetAppIconResponse response) {
+ _lifecycleListener.onSetAppIconResponse(response);
+ }
+
+ @Override
+ public void onScrollableMessageResponse(ScrollableMessageResponse response) {
+ _lifecycleListener.onScrollableMessageResponse(response);
+ }
+
+ @Override
+ public void onChangeRegistrationResponse(ChangeRegistrationResponse response) {
+ _lifecycleListener.onChangeRegistrationResponse(response);
+ }
+
+ @Override
+ public void onSetDisplayLayoutResponse(SetDisplayLayoutResponse response) {
+ _lifecycleListener.onSetDisplayLayoutResponse(response);
+ }
+
+ @Override
+ public void onOnLanguageChange(OnLanguageChange notification) {
+ _lifecycleListener.onOnLanguageChange(notification);
+ }
+ public void onSliderResponse(SliderResponse response) {
+ _lifecycleListener.onSliderResponse(response);
+ }
+
+ @Override
+ public void onAlertManeuverResponse(AlertManeuverResponse response) {
+ _lifecycleListener.onAlertManeuverResponse(response);
+ }
+
+ @Override
+ public void onShowConstantTBTResponse(ShowConstantTBTResponse response) {
+ _lifecycleListener.onShowConstantTBTResponse(response);
+ }
+
+ @Override
+ public void onUpdateTurnListResponse(UpdateTurnListResponse response) {
+ _lifecycleListener.onUpdateTurnListResponse(response);
+ }
+
+ @Override
+ public void onSystemRequestResponse(SystemRequestResponse response) {
+
+ }
+
+ @Override
+ public void onMobileNaviStart() {
+
+ }
+
+ @Override
+ public void onMobileNavAckReceived(int frameReceivedNumber) {
+
+ }
+
+ @Override
+ public void onOnTouchEvent(OnTouchEvent notification) {
+
+ }
+
+ @Override
+ public void onKeyboardInput(OnKeyboardInput msg) {
+
+ }
+
+ @Override
+ public void onOnSystemRequest(OnSystemRequest notification) {
+ }
+
+ @Override
+ public void onRegisterAppRequest(RegisterAppInterface msg) {
+
+ }
+
+ @Override
+ public void onAppUnregisteredAfterLanguageChange(OnLanguageChange msg) {
+
+ }
+
+ @Override
+ public void onAppUnregisteredReason(AppInterfaceUnregisteredReason reason) {
+
+ }
+
+ @Override
+ public void onProtocolServiceEnded(ServiceType serviceType, Byte version, String correlationID) {
+
+ }
+
+ @Override
+ public void onSessionStarted(byte sessionID, String correlationID) {
+
+ }
+
+ @Override
+ public void onAudioServiceStart() {
+
+ }
+
+ @Override
+ public void onUSBNoSuchDeviceException() {
+
+ }
+
+ @Override
+ public void onStartServiceNackReceived(ServiceType serviceType) {
+
+ }
+
+ @Override
+ public void onHashChange(OnHashChange onHashChange) {
+
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyBase.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyBase.java new file mode 100644 index 000000000..ad5b0a713 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyBase.java @@ -0,0 +1,3208 @@ +package com.ford.syncV4.proxy; + +import android.os.Handler; +import android.os.Looper; +import android.telephony.TelephonyManager; +import android.util.Log; + +import com.ford.syncV4.exception.SyncException; +import com.ford.syncV4.exception.SyncExceptionCause; +import com.ford.syncV4.marshal.IJsonRPCMarshaller; +import com.ford.syncV4.marshal.JsonRPCMarshaller; +import com.ford.syncV4.messageDispatcher.IDispatchingStrategy; +import com.ford.syncV4.messageDispatcher.IncomingProtocolMessageComparitor; +import com.ford.syncV4.messageDispatcher.InternalProxyMessageComparitor; +import com.ford.syncV4.messageDispatcher.OutgoingProtocolMessageComparitor; +import com.ford.syncV4.messageDispatcher.ProxyMessageDispatcher; +import com.ford.syncV4.protocol.ProtocolMessage; +import com.ford.syncV4.protocol.WiProProtocol; +import com.ford.syncV4.protocol.enums.FunctionID; +import com.ford.syncV4.protocol.enums.ServiceType; +import com.ford.syncV4.protocol.heartbeat.HeartbeatMonitor; +import com.ford.syncV4.proxy.callbacks.InternalProxyMessage; +import com.ford.syncV4.proxy.callbacks.OnError; +import com.ford.syncV4.proxy.callbacks.OnProxyClosed; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.converter.IRPCRequestConverter; +import com.ford.syncV4.proxy.converter.IRPCRequestConverterFactory; +import com.ford.syncV4.proxy.converter.SyncRPCRequestConverterFactory; +import com.ford.syncV4.proxy.interfaces.IProxyListenerALMTesting; +import com.ford.syncV4.proxy.interfaces.IProxyListenerBase; +import com.ford.syncV4.proxy.rpc.AddCommand; +import com.ford.syncV4.proxy.rpc.AddSubMenu; +import com.ford.syncV4.proxy.rpc.Alert; +import com.ford.syncV4.proxy.rpc.ButtonCapabilities; +import com.ford.syncV4.proxy.rpc.Choice; +import com.ford.syncV4.proxy.rpc.CreateInteractionChoiceSet; +import com.ford.syncV4.proxy.rpc.DeleteCommand; +import com.ford.syncV4.proxy.rpc.DeleteInteractionChoiceSet; +import com.ford.syncV4.proxy.rpc.DeleteSubMenu; +import com.ford.syncV4.proxy.rpc.DisplayCapabilities; +import com.ford.syncV4.proxy.rpc.EncodedSyncPData; +import com.ford.syncV4.proxy.rpc.ListFiles; +import com.ford.syncV4.proxy.rpc.OnAppInterfaceUnregistered; +import com.ford.syncV4.proxy.rpc.OnLanguageChange; +import com.ford.syncV4.proxy.rpc.OnSystemRequest; +import com.ford.syncV4.proxy.rpc.PerformInteraction; +import com.ford.syncV4.proxy.rpc.PresetBankCapabilities; +import com.ford.syncV4.proxy.rpc.PutFile; +import com.ford.syncV4.proxy.rpc.RegisterAppInterface; +import com.ford.syncV4.proxy.rpc.RegisterAppInterfaceResponse; +import com.ford.syncV4.proxy.rpc.ResetGlobalProperties; +import com.ford.syncV4.proxy.rpc.SetAppIcon; +import com.ford.syncV4.proxy.rpc.SetGlobalProperties; +import com.ford.syncV4.proxy.rpc.SetMediaClockTimer; +import com.ford.syncV4.proxy.rpc.Show; +import com.ford.syncV4.proxy.rpc.SoftButtonCapabilities; +import com.ford.syncV4.proxy.rpc.Speak; +import com.ford.syncV4.proxy.rpc.SubscribeButton; +import com.ford.syncV4.proxy.rpc.SyncMsgVersion; +import com.ford.syncV4.proxy.rpc.SyncPData; +import com.ford.syncV4.proxy.rpc.TTSChunk; +import com.ford.syncV4.proxy.rpc.UnregisterAppInterface; +import com.ford.syncV4.proxy.rpc.UnregisterAppInterfaceResponse; +import com.ford.syncV4.proxy.rpc.UnsubscribeButton; +import com.ford.syncV4.proxy.rpc.VehicleType; +import com.ford.syncV4.proxy.rpc.enums.AppHMIType; +import com.ford.syncV4.proxy.rpc.enums.AppInterfaceUnregisteredReason; +import com.ford.syncV4.proxy.rpc.enums.AudioStreamingState; +import com.ford.syncV4.proxy.rpc.enums.ButtonName; +import com.ford.syncV4.proxy.rpc.enums.FileType; +import com.ford.syncV4.proxy.rpc.enums.GlobalProperty; +import com.ford.syncV4.proxy.rpc.enums.HMILevel; +import com.ford.syncV4.proxy.rpc.enums.HmiZoneCapabilities; +import com.ford.syncV4.proxy.rpc.enums.InteractionMode; +import com.ford.syncV4.proxy.rpc.enums.Language; +import com.ford.syncV4.proxy.rpc.enums.RequestType; +import com.ford.syncV4.proxy.rpc.enums.Result; +import com.ford.syncV4.proxy.rpc.enums.SpeechCapabilities; +import com.ford.syncV4.proxy.rpc.enums.SyncConnectionState; +import com.ford.syncV4.proxy.rpc.enums.SyncDisconnectedReason; +import com.ford.syncV4.proxy.rpc.enums.SyncInterfaceAvailability; +import com.ford.syncV4.proxy.rpc.enums.SystemContext; +import com.ford.syncV4.proxy.rpc.enums.TextAlignment; +import com.ford.syncV4.proxy.rpc.enums.UpdateMode; +import com.ford.syncV4.proxy.rpc.enums.VrCapabilities; +import com.ford.syncV4.proxy.systemrequest.IOnSystemRequestHandler; +import com.ford.syncV4.proxy.systemrequest.ISystemRequestProxy; +import com.ford.syncV4.service.Service; +import com.ford.syncV4.session.Session; +import com.ford.syncV4.syncConnection.ISyncConnectionListener; +import com.ford.syncV4.syncConnection.SyncConnection; +import com.ford.syncV4.trace.SyncTrace; +import com.ford.syncV4.trace.TraceDeviceInfo; +import com.ford.syncV4.trace.enums.InterfaceActivityDirection; +import com.ford.syncV4.transport.BaseTransportConfig; +import com.ford.syncV4.transport.SiphonServer; +import com.ford.syncV4.transport.TransportType; +import com.ford.syncV4.util.Base64; +import com.ford.syncV4.util.CommonUtils; +import com.ford.syncV4.util.DebugTool; +import com.ford.syncV4.util.TestConfig; + +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.params.BasicHttpParams; +import org.apache.http.params.HttpConnectionParams; +import org.apache.http.params.HttpParams; +import org.apache.http.util.EntityUtils; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.ProtocolException; +import java.util.HashSet; +import java.util.Hashtable; +import java.util.List; +import java.util.Set; +import java.util.Timer; +import java.util.TimerTask; +import java.util.Vector; + +public abstract class SyncProxyBase<proxyListenerType extends IProxyListenerBase> implements + ISystemRequestProxy { + // Used for calls to Android Log class. + public static final String TAG = "SyncProxy"; + // Synchronization Objects + 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(), + APP_INTERFACE_REGISTERED_LOCK = new Object(); + /** + * Interval between heartbeat messages, in milliseconds. + * NOTE: this value is not specified in the protocol, and thus must be + * negotiated with the Sync. + */ + static final int HEARTBEAT_INTERVAL = 5000; + protected static final String SYNC_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66"; + /** + * Delay between proxy disconnect (e.g., transport error) and another proxy + * reconnect attempt. + */ + private static final int PROXY_RECONNECT_DELAY = 5000; + /** + * Lock to access the _currentReconnectTimerTask member. + */ + private static final Object RECONNECT_TIMER_TASK_LOCK = new Object(); + final int HEARTBEAT_CORRELATION_ID = 65531; // TODO: remove + // Protected Correlation IDs + public final int REGISTER_APP_INTERFACE_CORRELATION_ID = 65529, + UNREGISTER_APP_INTERFACE_CORRELATION_ID = 65530, + POLICIES_CORRELATION_ID = 65535; + private IRPCMessageHandler rpcMessageHandler; + + public Boolean getAdvancedLifecycleManagementEnabled() { + return _advancedLifecycleManagementEnabled; + } + + // SyncProxy Advanced Lifecycle Management + protected Boolean _advancedLifecycleManagementEnabled = false; + + + // Proxy State Variables + protected Boolean _appInterfaceRegisterd = false; + protected Boolean _haveReceivedFirstFocusLevel = false; + protected Boolean _haveReceivedFirstFocusLevelFull = false; + protected Boolean _proxyDisposed = false; + + public SyncConnectionState getSyncConnectionState() { + return _syncConnectionState; + } + + public void setSyncConnectionState(SyncConnectionState syncConnectionState) { + this._syncConnectionState = syncConnectionState; + } + + protected SyncConnectionState _syncConnectionState = null; + protected SyncInterfaceAvailability _syncIntefaceAvailablity = null; + protected HMILevel _hmiLevel = null; + protected AudioStreamingState _audioStreamingState = null; + protected SystemContext _systemContext = null; + + public SyncMsgVersion getSyncMsgVersion() throws SyncException { + return _syncMsgVersion; + } + + public void setSyncMsgVersion(SyncMsgVersion syncMsgVersion) { + this._syncMsgVersion = syncMsgVersion; + } + + // Variables set by RegisterAppInterfaceResponse + protected SyncMsgVersion _syncMsgVersion = null; + protected String _autoActivateIdReturned = null; + + public Language getSyncLanguage() throws SyncException { + return _syncLanguage; + } + + public void setSyncLanguage(Language syncLanguage) { + this._syncLanguage = syncLanguage; + } + + protected Language _syncLanguage = null; + + public Language getHmiDisplayLanguage() throws SyncException { + return _hmiDisplayLanguage; + } + + public void setHmiDisplayLanguage(Language hmiDisplayLanguage) { + this._hmiDisplayLanguage = hmiDisplayLanguage; + } + + protected Language _hmiDisplayLanguage = null; + + public DisplayCapabilities getDisplayCapabilities() throws SyncException { + return _displayCapabilities; + } + + public void setDisplayCapabilities(DisplayCapabilities displayCapabilities) { + this._displayCapabilities = displayCapabilities; + } + + protected DisplayCapabilities _displayCapabilities = null; + + public Vector<ButtonCapabilities> getButtonCapabilities() throws SyncException { + return _buttonCapabilities; + } + + public void setButtonCapabilities(Vector<ButtonCapabilities> buttonCapabilities) { + this._buttonCapabilities = buttonCapabilities; + } + + protected Vector<ButtonCapabilities> _buttonCapabilities = null; + + public Vector<SoftButtonCapabilities> getSoftButtonCapabilities() throws SyncException { + return _softButtonCapabilities; + } + + public void setSoftButtonCapabilities(Vector<SoftButtonCapabilities> softButtonCapabilities) { + this._softButtonCapabilities = softButtonCapabilities; + } + + protected Vector<SoftButtonCapabilities> _softButtonCapabilities = null; + + public PresetBankCapabilities getPresetBankCapabilities() throws SyncException { + return _presetBankCapabilities; + } + + public void setPresetBankCapabilities(PresetBankCapabilities presetBankCapabilities) { + this._presetBankCapabilities = presetBankCapabilities; + } + + protected PresetBankCapabilities _presetBankCapabilities = null; + + public Vector<HmiZoneCapabilities> getHmiZoneCapabilities() throws SyncException { + return _hmiZoneCapabilities; + } + + public void setHmiZoneCapabilities(Vector<HmiZoneCapabilities> hmiZoneCapabilities) { + this._hmiZoneCapabilities = hmiZoneCapabilities; + } + + protected Vector<HmiZoneCapabilities> _hmiZoneCapabilities = null; + + public Vector<SpeechCapabilities> getSpeechCapabilities() throws SyncException { + return _speechCapabilities; + } + + public void setSpeechCapabilities(Vector<SpeechCapabilities> speechCapabilities) { + this._speechCapabilities = speechCapabilities; + } + + protected Vector<SpeechCapabilities> _speechCapabilities = null; + + public Vector<VrCapabilities> getVrCapabilities() throws SyncException { + return _vrCapabilities; + } + + public void setVrCapabilities(Vector<VrCapabilities> vrCapabilities) { + this._vrCapabilities = vrCapabilities; + } + + protected Vector<VrCapabilities> _vrCapabilities = null; + + public VehicleType getVehicleType() throws SyncException { + return _vehicleType; + } + + public void setVehicleType(VehicleType vehicleType) { + this._vehicleType = vehicleType; + } + + protected VehicleType _vehicleType = null; + + public Boolean getFirstTimeFull() { + return firstTimeFull; + } + + public void setFirstTimeFull(Boolean firstTimeFull) { + this.firstTimeFull = firstTimeFull; + } + + protected Boolean firstTimeFull = true; + protected byte _wiproVersion = 1; + + SyncConnection mSyncConnection; + + // RPC Session ID + protected Session currentSession = Session.createSession(ServiceType.RPC, Session.DEFAULT_SESSION_ID); + Boolean _haveReceivedFirstNonNoneHMILevel = false; + + public proxyListenerType getProxyListener() { + return _proxyListener; + } + + private proxyListenerType _proxyListener = null; + // Device Info for logging + private TraceDeviceInfo _traceDeviceInterrogator = null; + // Declare Queuing Threads + private ProxyMessageDispatcher<ProtocolMessage> _incomingProxyMessageDispatcher; + private ProxyMessageDispatcher<ProtocolMessage> _outgoingProxyMessageDispatcher; + private ProxyMessageDispatcher<InternalProxyMessage> _internalProxyMessageDispatcher; + + public Boolean getCallbackToUIThread() { + return _callbackToUIThread; + } + + public void setCallbackToUIThread(Boolean callbackToUIThread) { + this._callbackToUIThread = callbackToUIThread; + } + + // Flag indicating if callbacks should be called from UIThread + private Boolean _callbackToUIThread = false; + + public Handler getMainUIHandler() { + return _mainUIHandler; + } + + public void setMainUIHandler(Handler mainUIHandler) { + this._mainUIHandler = mainUIHandler; + } + + // UI Handler + private Handler _mainUIHandler = null; + // Parameters passed to the constructor from the app to register an app interface + private String _applicationName = null; + private Vector<TTSChunk> _ttsName = null; + private String _ngnMediaScreenAppName = null; + private Boolean _isMediaApp = null; + private Language _syncLanguageDesired = null; + private Language _hmiDisplayLanguageDesired = null; + private Vector<AppHMIType> _appHMIType = null; + private String _appID = null; + private String _autoActivateIdDesired = null; + private SyncMsgVersion _syncMsgVersionRequest = null; + private Vector<String> _vrSynonyms = null; + // Updated hashID which can be used over connection cycles + // (i.e. loss of connection, ignition cycles, etc.) + private String mHashId = null; + // This Config object stores all the necessary data for SDK testing + private TestConfig mTestConfig; + + /** + * Set hashID which can be used over connection cycles + * + * @return value of the hashId + */ + public String getHashId() { + // For the Test Cases + if (mTestConfig != null) { + if (!mTestConfig.isUseHashId()) { + return null; + } + if (mTestConfig.isUseCustomHashId()) { + return mTestConfig.getCustomHashId(); + } + } + + return mHashId; + } + + /** + * Get hashID which can be used over connection cycles + * + * @param mHashId value of the hashId + */ + public void setHashId(String mHashId) { + this.mHashId = mHashId; + } + + public OnLanguageChange getLastLanguageChange() { + return _lastLanguageChange; + } + + public void setLastLanguageChange(OnLanguageChange lastLanguageChange) { + this._lastLanguageChange = lastLanguageChange; + } + + private OnLanguageChange _lastLanguageChange = null; + // JSON RPC Marshaller + private IJsonRPCMarshaller _jsonRPCMarshaller = new JsonRPCMarshaller(); + /** + * Contains current configuration for the transport that was selected during + * construction of this object + */ + private BaseTransportConfig _transportConfig = null; + + public HMILevel getPriorHmiLevel() { + return _priorHmiLevel; + } + + public void setPriorHmiLevel(HMILevel priorHmiLevel) { + this._priorHmiLevel = priorHmiLevel; + } + + private HMILevel _priorHmiLevel = null; + + public AudioStreamingState getPriorAudioStreamingState() { + return _priorAudioStreamingState; + } + + public void setPriorAudioStreamingState(AudioStreamingState priorAudioStreamingState) { + this._priorAudioStreamingState = priorAudioStreamingState; + } + + private AudioStreamingState _priorAudioStreamingState = null; + // Interface broker + private SyncInterfaceBroker _interfaceBroker = null; + /** + * Timer that is used to schedule proxy reconnect tasks. + */ + private Timer _reconnectTimer = null; + /** + * Currently scheduled proxy reconnect task, if any. + */ + private TimerTask _currentReconnectTimerTask = null; + private static int heartBeatInterval = HEARTBEAT_INTERVAL; + private IRPCRequestConverterFactory rpcRequestConverterFactory = + new SyncRPCRequestConverterFactory(); + private IProtocolMessageHolder protocolMessageHolder = + new ProtocolMessageHolder(); + + /** + * Handler for OnSystemRequest notifications. + */ + private IOnSystemRequestHandler onSystemRequestHandler; + + /** + * A set of internal requests' correlation IDs that are currently in + * progress. + */ + private Set<Integer> internalRequestCorrelationIDs; + + /** + * Correlation ID that was last used for messages created internally. + */ + private int lastCorrelationId = 40000; + + public void setSyncConnection(SyncConnection syncConnection) { + this.mSyncConnection = syncConnection; + } + + /** + * Constructor. + * + * @param listener Type of listener for this proxy base. + * @param syncProxyConfigurationResources 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 syncMsgVersion Version of Sync Message. + * @param languageDesired Desired language. + * @param hmiDisplayLanguageDesired Desired language for HMI. + * @param appHMIType 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 SyncException + */ + protected SyncProxyBase(proxyListenerType listener, SyncProxyConfigurationResources syncProxyConfigurationResources, + boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName, + String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SyncMsgVersion syncMsgVersion, + Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appHMIType, String appID, + String autoActivateID, boolean callbackToUIThread, BaseTransportConfig transportConfig, TestConfig testConfig) + throws SyncException { + + mTestConfig = testConfig; + + setupSyncProxyBaseComponents(callbackToUIThread); + // Set variables for Advanced Lifecycle Management + setAdvancedLifecycleManagementEnabled(enableAdvancedLifecycleManagement); + updateRegisterAppInterfaceParameters(appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, hmiDisplayLanguageDesired, appHMIType, appID, autoActivateID); + setTransportConfig(transportConfig); + checkConditionsInvalidateProxy(listener); + setProxyListener(listener); + // Get information from syncProxyConfigurationResources + setupTelephoneManager(syncProxyConfigurationResources); + setupMessageDispatchers(); + tryInitialiseProxy(); + // Trace that ctor has fired + SyncTrace.logProxyEvent("SyncProxy Created, instanceID=" + this.toString(), SYNC_LIB_TRACE_KEY); + } + + /** + * Constructor. + * + * @param listener Type of listener for this proxy base. + * @param syncProxyConfigurationResources 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 syncMsgVersion Version of Sync Message. + * @param languageDesired Desired language. + * @param hmiDisplayLanguageDesired Desired language for HMI. + * @param appHMIType 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 version Version of Sync protocol to be used by the underlying connection. + * @param transportConfig Configuration of transport to be used by underlying connection. + * @throws SyncException + */ + protected SyncProxyBase(proxyListenerType listener, SyncProxyConfigurationResources syncProxyConfigurationResources, + boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName, + String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SyncMsgVersion syncMsgVersion, + Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appHMIType, String appID, + String autoActivateID, boolean callbackToUIThread, boolean preRegister, int version, + BaseTransportConfig transportConfig, SyncConnection connection, TestConfig testConfig) + throws SyncException { + + mTestConfig = testConfig; + + setWiProVersion((byte) version); + setAppInterfacePreRegisterd(preRegister); + + setupSyncProxyBaseComponents(callbackToUIThread); + + // Set variables for Advanced Lifecycle Management + setAdvancedLifecycleManagementEnabled(enableAdvancedLifecycleManagement); + updateRegisterAppInterfaceParameters(appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, syncMsgVersion, languageDesired, hmiDisplayLanguageDesired, appHMIType, appID, autoActivateID); + setTransportConfig(transportConfig); + + // Test conditions to invalidate the proxy + checkConditionsInvalidateProxy(listener); + + setProxyListener(listener); + setSyncConnection(connection); + + setupTelephoneManager(syncProxyConfigurationResources); + + + setupMessageDispatchers(); + tryInitialiseProxy(); + + + // Trace that ctor has fired + SyncTrace.logProxyEvent("SyncProxy Created, instanceID=" + this.toString(), SYNC_LIB_TRACE_KEY); + } + + private void updateRegisterAppInterfaceParameters(String appName, Vector<TTSChunk> ttsName, String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, SyncMsgVersion syncMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appHMIType, String appID, String autoActivateID) { + _applicationName = appName; + _ttsName = ttsName; + _ngnMediaScreenAppName = ngnMediaScreenAppName; + _isMediaApp = isMediaApp; + _syncMsgVersionRequest = syncMsgVersion; + _vrSynonyms = vrSynonyms; + _syncLanguageDesired = languageDesired; + _hmiDisplayLanguageDesired = hmiDisplayLanguageDesired; + _appHMIType = appHMIType; + _appID = appID; + _autoActivateIdDesired = autoActivateID; + } + + private void setupMessageDispatchers() { + setupInternalProxyMessageDispatcher(); + setupIncomingProxyMessageDispatcher(); + setupOutgoingMessageDispatcher(); + } + + private void setTransportConfig(BaseTransportConfig transportConfig) { + _transportConfig = transportConfig; + } + + private void setAdvancedLifecycleManagementEnabled(boolean enableAdvancedLifecycleManagement) { + _advancedLifecycleManagementEnabled = enableAdvancedLifecycleManagement; + } + + private void setProxyListener(proxyListenerType listener) { + _proxyListener = listener; + } + + protected void setAppInterfacePreRegisterd(boolean preRegister) { + if (preRegister) _appInterfaceRegisterd = preRegister; + } + + protected void setAppInterfaceRegisterd(boolean registerd) { + _appInterfaceRegisterd = registerd; + } + + private void setupSyncProxyBaseComponents(boolean callbackToUIThread) { + _interfaceBroker = new SyncInterfaceBroker(); + + _callbackToUIThread = callbackToUIThread; + + if (_callbackToUIThread) { + _mainUIHandler = new Handler(Looper.getMainLooper()); + } + + rpcMessageHandler = new RPCMessageHandler(this); + + } + + private void checkConditionsInvalidateProxy(proxyListenerType listener) { + // Test conditions to invalidate the proxy + if (listener == null) { + throw new IllegalArgumentException("IProxyListener listener must be provided to instantiate SyncProxy object."); + } + if (_advancedLifecycleManagementEnabled) { + if (_applicationName == null) { + throw new IllegalArgumentException("To use SyncProxyALM, 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 SyncProxyALM."); + } + } + } + + private void setupOutgoingMessageDispatcher() { + // 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 OutgoingProtocolMessageComparitor(), + 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); + } + }); + } + } + + private void setupInternalProxyMessageDispatcher() { + // 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 InternalProxyMessageComparitor(), + 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); + } + }); + } + } + + private void setupTelephoneManager(SyncProxyConfigurationResources syncProxyConfigurationResources) { + // Get information from syncProxyConfigurationResources + TelephonyManager telephonyManager = null; + if (syncProxyConfigurationResources != null) { + telephonyManager = syncProxyConfigurationResources.getTelephonyManager(); + } + + // Use the telephonyManager to get and log phone info + if (telephonyManager != null) { + // Following is not quite thread-safe (because m_traceLogger could notifyOnAppInterfaceUnregistered 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(syncProxyConfigurationResources.getTelephonyManager()); + } // end-if + } // end-if + } + + private void tryInitialiseProxy() throws SyncException { + // Initialize the proxy + try { + initializeProxy(); + } catch (SyncException 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; + } + } + + private void setupIncomingProxyMessageDispatcher() { + // 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 IncomingProtocolMessageComparitor(), + new IDispatchingStrategy<ProtocolMessage>() { + @Override + public void dispatch(ProtocolMessage message) { + dispatchIncomingMessage((ProtocolMessage) message); + } + + @Override + public void handleDispatchingError(String info, Exception ex) { + handleErrorsFromIncomingMessageDispatcher(info, ex); + } + + @Override + public void handleQueueingError(String info, Exception ex) { + handleErrorsFromIncomingMessageDispatcher(info, ex); + } + }); + } + } + + // Public method to enable the siphon transport + public static void enableSiphonDebug() { + SiphonServer.enableSiphonServer(); + } + + // Public method to disable the Siphon Trace Server + public static void disableSiphonDebug() { + SiphonServer.disableSiphonServer(); + } + + // 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 static void setHeartBeatInterval(int heartBeatInterval) { + SyncProxyBase.heartBeatInterval = heartBeatInterval; + } + + public static int getHeartBeatInterval() { + return heartBeatInterval; + } + + public SyncConnection getSyncConnection() { + return mSyncConnection; + } + + public ProxyMessageDispatcher<ProtocolMessage> getIncomingProxyMessageDispatcher() { + return _incomingProxyMessageDispatcher; + } + + public SyncInterfaceBroker getInterfaceBroker() { + return _interfaceBroker; + } + + public byte getMobileNavSessionID() { + return currentSession.getSessionId(); + } + + public void sendEncodedSyncPDataToUrl(String urlString, Vector<String> encodedSyncPData, Integer timeout) { + try { + final int CONNECTION_TIMEOUT = timeout * 1000; // in ms + Log.i("sendEncodedSyncPDataToUrl", "sendEncodedSyncPDataToUrl() go! "); + //Log.i("sendEncodedSyncPDataToUrl", "CONNECTION_TIMEOUT: " + CONNECTION_TIMEOUT); + //Log.i("sendEncodedSyncPDataToUrl", "urlString: " + urlString); + //Log.i("sendEncodedSyncPDataToUrl", "timeout: " + timeout); + //Log.i("sendEncodedSyncPDataToUrl", "encodedSyncPData.firstElement(): " + encodedSyncPData.firstElement()); + + // Form the JSON message to send to the cloud + JSONArray jsonArrayOfSyncPPackets = new JSONArray(encodedSyncPData); + JSONObject jsonObjectToSendToServer = new JSONObject(); + jsonObjectToSendToServer.put("data", jsonArrayOfSyncPPackets); + String valid_json = jsonObjectToSendToServer.toString().replace("\\", ""); + byte[] bytesToSend = valid_json.getBytes("UTF-8"); + + // Send the Bytes to the Cloud and get the Response + HttpParams httpParams = new BasicHttpParams(); + + // Set the timeout in milliseconds until a connection is established. + // The default value is zero, that means the timeout is not used. + HttpConnectionParams.setConnectionTimeout(httpParams, CONNECTION_TIMEOUT); + + // Set the default socket timeout (SO_TIMEOUT) + // in milliseconds which is the timeout for waiting for data. + HttpConnectionParams.setSoTimeout(httpParams, CONNECTION_TIMEOUT); + + HttpClient client = new DefaultHttpClient(httpParams); + HttpPost request = new HttpPost(urlString); + request.setHeader("Content-type", "application/json"); + request.setEntity(new ByteArrayEntity(bytesToSend)); + HttpResponse response = client.execute(request); + Log.i("sendEncodedSyncPDataToUrl", "sent and received"); + + // If response is null, then return + if (response == null) { + DebugTool.logError("Response from server returned null: "); + Log.i("sendEncodedSyncPDataToUrl", "Response from server returned null: "); + return; + } + + Vector<String> encodedSyncPDataReceived = new Vector<String>(); + if (response.getStatusLine().getStatusCode() == 200) { + + // Convert the response to JSON + JSONObject jsonResponse = new JSONObject(EntityUtils.toString(response.getEntity(), "UTF-8")); + + if (jsonResponse.get("data") instanceof JSONArray) { + JSONArray jsonArray = jsonResponse.getJSONArray("data"); + for (int i = 0; i < jsonArray.length(); i++) { + if (jsonArray.get(i) instanceof String) { + encodedSyncPDataReceived.add(jsonArray.getString(i)); + } + } + } else if (jsonResponse.get("data") instanceof String) { + encodedSyncPDataReceived.add(jsonResponse.getString("data")); + } else { + DebugTool.logError("sendEncodedSyncPDataToUrl: Data in JSON Object neither an array nor a string."); + //Log.i("sendEncodedSyncPDataToUrl", "sendEncodedSyncPDataToUrl: Data in JSON Object neither an array nor a string."); + return; + } + + // Send new encodedSyncPDataRequest to SYNC + EncodedSyncPData encodedSyncPDataRequest = RPCRequestFactory.buildEncodedSyncPData(encodedSyncPDataReceived, getPoliciesReservedCorrelationID()); + + if (getIsConnected()) { + sendRPCRequestPrivate(encodedSyncPDataRequest); + Log.i("sendEncodedSyncPDataToUrl", "sent to sync"); + } + } else if (response.getStatusLine().getStatusCode() == 500) { + Log.i("sendEncodedSyncPDataToUrl", "Status 500"); + //returnVal = "Status 500"; + } + + } catch (SyncException e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: Could not get data from JSONObject received.", e); + } catch (JSONException e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: JSONException: ", e); + } catch (UnsupportedEncodingException e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: Could not encode string.", e); + } catch (ProtocolException e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: Could not set request method to post.", e); + } catch (MalformedURLException e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: URL Exception when sending EncodedSyncPData to an external server.", e); + } catch (IOException e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: IOException: ", e); + } catch (Exception e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: Unexpected Exception: ", e); + } + } + + public void sendSyncPDataToUrl(String urlString, byte[] bs, Integer timeout) { + try { + final int CONNECTION_TIMEOUT = timeout * 1000; // in ms + Log.i("sendEncodedSyncPDataToUrl", "sendEncodedSyncPDataToUrl() go! "); + //Log.i("sendEncodedSyncPDataToUrl", "CONNECTION_TIMEOUT: " + CONNECTION_TIMEOUT); + //Log.i("sendEncodedSyncPDataToUrl", "urlString: " + urlString); + //Log.i("sendEncodedSyncPDataToUrl", "timeout: " + timeout); + //Log.i("sendEncodedSyncPDataToUrl", "encodedSyncPData.firstElement(): " + encodedSyncPData.firstElement()); + + //base64 encode the binary syncp packet before sending to cloud + String base64SyncP = Base64.encodeBytes(bs); + //Log.i("text", "base64 encoded syncP: " + base64SyncP); + + // Form the JSON message to send to the cloud + JSONArray jsonArrayOfSyncPPackets = new JSONArray(base64SyncP); + JSONObject jsonObjectToSendToServer = new JSONObject(); + jsonObjectToSendToServer.put("data", jsonArrayOfSyncPPackets); + String valid_json = jsonObjectToSendToServer.toString().replace("\\", ""); + byte[] bytesToSend = valid_json.getBytes("UTF-8"); + + // Send the Bytes to the Cloud and get the Response + HttpParams httpParams = new BasicHttpParams(); + + // Set the timeout in milliseconds until a connection is established. + // The default value is zero, that means the timeout is not used. + HttpConnectionParams.setConnectionTimeout(httpParams, CONNECTION_TIMEOUT); + + // Set the default socket timeout (SO_TIMEOUT) + // in milliseconds which is the timeout for waiting for data. + HttpConnectionParams.setSoTimeout(httpParams, CONNECTION_TIMEOUT); + HttpClient client = new DefaultHttpClient(httpParams); + HttpPost request = new HttpPost(urlString); + request.setHeader("Content-type", "application/json"); + request.setEntity(new ByteArrayEntity(bytesToSend)); + HttpResponse response = client.execute(request); + + Log.i("sendEncodedSyncPDataToUrl", "sent and received"); + + // If response is null, then return + if (response == null) { + DebugTool.logError("Response from server returned null: "); + Log.i("sendEncodedSyncPDataToUrl", "Response from server returned null: "); + return; + } + + Vector<String> encodedSyncPDataReceived = new Vector<String>(); + if (response.getStatusLine().getStatusCode() == 200) { + // Convert the response to JSON + JSONObject jsonResponse = new JSONObject(EntityUtils.toString(response.getEntity(), "UTF-8")); + + if (jsonResponse.get("data") instanceof JSONArray) { + JSONArray jsonArray = jsonResponse.getJSONArray("data"); + for (int i = 0; i < jsonArray.length(); i++) { + if (jsonArray.get(i) instanceof String) { + encodedSyncPDataReceived.add(jsonArray.getString(i)); + //Log.i("sendEncodedSyncPDataToUrl", "jsonArray.getString(i): " + jsonArray.getString(i)); + } + } + } else if (jsonResponse.get("data") instanceof String) { + encodedSyncPDataReceived.add(jsonResponse.getString("data")); + //Log.i("sendEncodedSyncPDataToUrl", "jsonResponse.getString(data): " + jsonResponse.getString("data")); + } else { + DebugTool.logError("sendEncodedSyncPDataToUrl: Data in JSON Object neither an array nor a string."); + //Log.i("sendEncodedSyncPDataToUrl", "sendEncodedSyncPDataToUrl: Data in JSON Object neither an array nor a string."); + return; + } + + //convert encodedsyncp packet to binary + byte[] syncppacket = encodedSyncPDataReceived.firstElement().getBytes(); + + // Send new binary syncp data to SYNC + SyncPData syncPDataRequest = RPCRequestFactory.buildSyncPData(syncppacket, getPoliciesReservedCorrelationID()); + + if (getIsConnected()) { + sendRPCRequestPrivate(syncPDataRequest); + Log.i("sendEncodedSyncPDataToUrl", "sent to sync"); + } + } else if (response.getStatusLine().getStatusCode() == 500) { + Log.i("sendEncodedSyncPDataToUrl", "Status 500"); + //returnVal = "Status 500"; + } + + } catch (SyncException e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: Could not get data from JSONObject received.", e); + } catch (JSONException e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: JSONException: ", e); + } catch (UnsupportedEncodingException e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: Could not encode string.", e); + } catch (ProtocolException e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: Could not set request method to post.", e); + } catch (MalformedURLException e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: URL Exception when sending EncodedSyncPData to an external server.", e); + } catch (IOException e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: IOException: ", e); + } catch (Exception e) { + DebugTool.logError("sendEncodedSyncPDataToUrl: Unexpected Exception: ", e); + } + } + + private int getPoliciesReservedCorrelationID() { + return POLICIES_CORRELATION_ID; + } + + // Test correlationID + protected boolean isCorrelationIDProtected(Integer correlationID) { + if (correlationID != null && + (HEARTBEAT_CORRELATION_ID == correlationID + || REGISTER_APP_INTERFACE_CORRELATION_ID == correlationID + || UNREGISTER_APP_INTERFACE_CORRELATION_ID == correlationID + || POLICIES_CORRELATION_ID == correlationID)) { + return true; + } + + return false; + } + + // Protected isConnected method to allow legacy proxy to poll isConnected state + public Boolean getIsConnected() { + if (mSyncConnection == null) { + return false; + } + return mSyncConnection.getIsConnected(); + } + + /** + * Returns whether the application is registered in SYNC. 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 SYNC + */ + public Boolean getAppInterfaceRegistered() { + return _appInterfaceRegisterd; + } + + private void initState() throws SyncException { + // Reset all of the flags and state variables + _haveReceivedFirstNonNoneHMILevel = false; + _haveReceivedFirstFocusLevel = false; + _haveReceivedFirstFocusLevelFull = false; + _syncIntefaceAvailablity = SyncInterfaceAvailability.SYNC_INTERFACE_UNAVAILABLE; + } + + // Function to initialize new proxy connection + public void initializeProxy() throws SyncException { + initState(); + + internalRequestCorrelationIDs = new HashSet<Integer>(); + + // Setup SyncConnection + synchronized (CONNECTION_REFERENCE_LOCK) { + if (mSyncConnection == null) { + mSyncConnection = new SyncConnection(_interfaceBroker); + final HeartbeatMonitor heartbeatMonitor = + new HeartbeatMonitor(); + heartbeatMonitor.setInterval(heartBeatInterval); + mSyncConnection.setHeartbeatMonitor(heartbeatMonitor); + + currentSession.setSessionId((byte) 0); + mSyncConnection.setSessionId(currentSession.getSessionId()); + + //mSyncConnection.setSessionId(currentSession.getSessionId()); + + mSyncConnection.init(_transportConfig); + } + + WiProProtocol protocol = (WiProProtocol) mSyncConnection.getWiProProtocol(); + protocol.setVersion(_wiproVersion); + + mSyncConnection.startTransport(); + } + } + + private synchronized void closeSyncConnection(boolean keepConnection) { + if (mSyncConnection != null) { + mSyncConnection.closeConnection(currentSession.getSessionId(), keepConnection); + mSyncConnection.setSessionId((byte) 0); + if (!keepConnection) { + setSyncConnection(null); + } + } + } + + private void stopSession() { + currentSession.stopSession(); + } + + @Deprecated + public void close() throws SyncException { + dispose(); + } + + private void cleanProxy(SyncDisconnectedReason disconnectedReason, + boolean keepConnection, boolean keepSession) throws SyncException { + try { + + // ALM Specific Cleanup + if (_advancedLifecycleManagementEnabled) { + _syncConnectionState = SyncConnectionState.SYNC_DISCONNECTED; + + firstTimeFull = true; + exitSession(keepConnection, keepSession); + } + } catch (SyncException e) { + throw e; + } finally { + SyncTrace.logProxyEvent("SyncProxy cleaned.", SYNC_LIB_TRACE_KEY); + } + } + + private void exitSession(boolean keepConnection, boolean keepSession) throws SyncException { + // Should we wait for the interface to be unregistered? + Boolean waitForInterfaceUnregistered = false; + synchronized (CONNECTION_REFERENCE_LOCK) { + if (_appInterfaceRegisterd == true && mSyncConnection != null && mSyncConnection.getIsConnected()) { + 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(1000); + } catch (InterruptedException e) { + // Do nothing + } + } + } + + // Clean up SYNC Connection + + if (!keepSession) { + stopAllServices(); + } + closeSyncConnection(keepConnection); + if (!keepSession) { + stopSession(); + } + } + } + + private void stopAllServices() { + if (getServicePool().size() > 0) { + stopMobileNaviService(); + stopAudioService(); + } + } + + /** + * Terminates the App's Interface Registration, closes the transport connection, ends the protocol currentSession, and frees any resources used by the proxy. + */ + public void dispose() throws SyncException { + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + _proxyDisposed = true; + + SyncTrace.logProxyEvent("Application called dispose() method.", SYNC_LIB_TRACE_KEY); + + try { + // Clean the proxy + cleanProxy(SyncDisconnectedReason.APPLICATION_REQUESTED_DISCONNECT, false, false); + + clearReconnectTimer(); + + // 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; + } catch (SyncException e) { + throw e; + } finally { + SyncTrace.logProxyEvent("SyncProxy disposed.", SYNC_LIB_TRACE_KEY); + } + } // end-method + + // Method to cycle the proxy, only called in ALM + protected void cycleProxy(SyncDisconnectedReason disconnectedReason) { + Log.d(TAG, "CycleProxy, disconnectedReason:" + disconnectedReason); + try { + cleanProxy(disconnectedReason, false, true); + scheduleInitializeProxy(); + notifyProxyClosed("Sync Proxy Cycled", new SyncException("Sync Proxy Cycled", SyncExceptionCause.SYNC_PROXY_CYCLED)); + } catch (SyncException e) { + handleCyclingSyncException(e); + } catch (Exception e) { + notifyProxyClosed("Cycling the proxy failed.", e); + } + } + + /** + * Unregisters the application from SYNC, and closes the currentSession. + * Optionally, closes the transport connection. + */ + public void closeSession(boolean keepConnection) { + Log.d(TAG, "Close Session, keepConnection:" + keepConnection); + try { + cleanProxy( + SyncDisconnectedReason.APPLICATION_REQUESTED_DISCONNECT, keepConnection, false); + notifyProxyClosed("Sync Proxy Cycled", + new SyncException("Sync Proxy Cycled", SyncExceptionCause.SYNC_PROXY_CYCLED)); + } catch (SyncException e) { + handleCyclingSyncException(e); + } catch (Exception e) { + notifyProxyClosed("Cycling the proxy failed.", e); + } + } + + private void handleCyclingSyncException(SyncException e) { + switch (e.getSyncExceptionCause()) { + case BLUETOOTH_DISABLED: + notifyProxyClosed("Bluetooth is disabled. Bluetooth must be enabled to connect to SYNC. Reattempt a connection once Bluetooth is enabled.", + new SyncException("Bluetooth is disabled. Bluetooth must be enabled to connect to SYNC. Reattempt a connection once Bluetooth is enabled.", SyncExceptionCause.BLUETOOTH_DISABLED)); + break; + case BLUETOOTH_ADAPTER_NULL: + notifyProxyClosed("Cannot locate a Bluetooth adapater. A SYNC connection is impossible on this device until a Bluetooth adapter is added.", + new SyncException("Cannot locate a Bluetooth adapater. A SYNC connection is impossible on this device until a Bluetooth adapter is added.", SyncExceptionCause.HEARTBEAT_PAST_DUE)); + break; + default: + notifyProxyClosed("Cycling the proxy failed.", e); + break; + } + } + + protected void scheduleInitializeProxy() { + Log.d(TAG, "Scheduling proxy initialization"); + if (currentSession.isServicesEmpty()) { + Log.d(TAG, "Service list is empty. Scheduling proxy initialization canceled"); + return; + } + + if (getCurrentReconnectTimerTask() != null) { + Log.d(TAG, "Current reconnect task is already scheduled, canceling it first"); + clearCurrentReconnectTimerTask(); + } + + TimerTask reconnectTask = new TimerTask() { + @Override + public void run() { + try { + Log.d(TAG, "Reconnect task is running, clearing reference"); + setCurrentReconnectTimerTask(null); + initializeProxy(); + } catch (SyncException e) { + Log.e(TAG, "Cycling the proxy failed with SyncException.", e); + handleCyclingSyncException(e); + } catch (Exception e) { + notifyProxyClosed("Cycling the proxy failed with Exception.", e); + } + } + }; + setCurrentReconnectTimerTask(reconnectTask); + + Timer timer = getReconnectTimer(); + timer.schedule(reconnectTask, PROXY_RECONNECT_DELAY); + + } + + /** + * Opens a currentSession, and registers the application. The connection must be + * already opened. + * + * @throws SyncException if a transport connection is not opened + */ + public void openSession() throws SyncException { + if (!getIsConnected()) { + throw new SyncException("Transport connection must be opened", + SyncExceptionCause.SYNC_CONNECTION_FAILED); + } + + initState(); + mSyncConnection.onTransportConnected(); + } + + /** + * ********** Functions used by the Message Dispatching Queues *************** + */ + protected void dispatchIncomingMessage(ProtocolMessage message) { + try { + + if (message.getSessionID() != currentSession.getSessionId()) { + DebugTool.logWarning("Message is not from current session"); + Log.w(TAG, "Message is not from current session"); + return; + } + + // Dispatching logic + if (message.getServiceType().equals(ServiceType.RPC)) { + try { + if (_wiproVersion == 1) { + if (message.getVersion() == 2) setWiProVersion(message.getVersion()); + } + + Hashtable hash = new Hashtable(); + if (_wiproVersion == 2) { + Hashtable hashTemp = new Hashtable(); + hashTemp.put(Names.correlationID, message.getCorrID()); + + if (message.getJsonSize() > 0) { + final Hashtable<String, Object> mhash = _jsonRPCMarshaller.unmarshall(message.getData()); + if (mhash != null) { + hashTemp.put(Names.parameters, mhash); + } else { + String err = "Can't parse JSON: " + new String(message.getData()); + DebugTool.logError(err); + Log.e(TAG, err); + } + } + FunctionID functionID = new FunctionID(); + hashTemp.put(Names.function_name, functionID.getFunctionName(message.getFunctionID())); + if (message.getRPCType() == ProtocolMessage.RPCTYPE_REQUEST) { + hash.put(Names.request, hashTemp); + } else if (message.getRPCType() == ProtocolMessage.RPCTYPE_RESPONSE) { + hash.put(Names.response, hashTemp); + } else if (message.getRPCType() == ProtocolMessage.RPCTYPE_NOTIFICATION) { + hash.put(Names.notification, hashTemp); + } + if (message.getBulkData() != null) + hash.put(Names.bulkData, message.getBulkData()); + } else { + final Hashtable<String, Object> mhash = _jsonRPCMarshaller.unmarshall(message.getData()); + hash = mhash; + } + handleRPCMessage(hash); + } catch (final Exception excp) { + DebugTool.logError("Failure handling protocol message: " + excp.toString(), excp); + passErrorToProxyListener("Error handing incoming protocol message.", excp); + } // end-catch + } else { + // Handle other protocol message types here + } + } catch (final Exception e) { + // Pass error to application through listener + DebugTool.logError("Error handing proxy event.", e); + passErrorToProxyListener("Error handing incoming protocol message.", e); + } + } + + protected void handleMobileNavMessage(ProtocolMessage message) { + Log.i(TAG, "Mobile Nav Session message received" + message.toString()); + // TODO handle incoming mobile nav sessions + } + + public byte getWiProVersion() { + return this._wiproVersion; + } + + private void setWiProVersion(byte version) { + Log.i(TAG, "Setting WiPro version from " + (int) this._wiproVersion + " to " + (int) version); + //Log.i(TAG, "setter called from: " + Log.getStackTraceString(new Exception())); + this._wiproVersion = version; + } + + private void handleErrorsFromIncomingMessageDispatcher(String info, Exception e) { + passErrorToProxyListener(info, e); + } + + private void dispatchOutgoingMessage(ProtocolMessage message) { + if (mSyncConnection.getIsConnected()) { + mSyncConnection.sendMessage(message); + } + /*synchronized (CONNECTION_REFERENCE_LOCK) { + if (mSyncConnection != null) { + + } + }*/ + SyncTrace.logProxyEvent("SyncProxy sending Protocol Message: " + message.toString(), SYNC_LIB_TRACE_KEY); + } + + private void handleErrorsFromOutgoingMessageDispatcher(String info, Exception e) { + passErrorToProxyListener(info, e); + } + + void dispatchInternalMessage(final InternalProxyMessage message) { + try { + if (message.getFunctionName().equals(Names.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.getThrowable()); + } + }); + } else { + _proxyListener.onError(msg.getInfo(), msg.getThrowable()); + } + /**************Start Legacy Specific Call-backs************/ + } else if (message.getFunctionName().equals(Names.OnProxyOpened)) { + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + ((IProxyListener) _proxyListener).onProxyOpened(); + } + }); + } else { + ((IProxyListener) _proxyListener).onProxyOpened(); + } + } else if (message.getFunctionName().equals(Names.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()); + } + }); + } else { + _proxyListener.onProxyClosed(msg.getInfo(), msg.getException()); + } + /****************End Legacy Specific Call-backs************/ + } else { + // Diagnostics + SyncTrace.logProxyEvent("Unknown RPC Message encountered. Check for an updated version of the SYNC Proxy.", SYNC_LIB_TRACE_KEY); + DebugTool.logError("Unknown RPC Message encountered. Check for an updated version of the SYNC Proxy."); + } + + SyncTrace.logProxyEvent("Proxy fired callback: " + message.getFunctionName(), SYNC_LIB_TRACE_KEY); + } catch (final Exception e) { + // Pass error to application through listener + DebugTool.logError("Error handing proxy event.", e); + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + _proxyListener.onError("Error handing proxy event.", e); + } + }); + } else { + _proxyListener.onError("Error handing proxy event.", e); + } + } + } + + private void handleErrorsFromInternalMessageDispatcher(String info, Exception e) { + DebugTool.logError(info, e); + // This error cannot be passed to the user, as it indicates an error + // in the communication between the proxy and the application. + + DebugTool.logError("InternalMessageDispatcher failed.", e); + + // Note, this is the only place where the _proxyListener should be referenced asynchronously, + // 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); + _proxyListener.onError( + "Proxy callback dispatcher is down. Proxy instance is invalid.", + e); + } + + /** + * ********** END Functions used by the Message Dispatching Queues *************** + */ + + // Private sendPRCRequest method. All RPCRequests are funneled through this method after + // error checking. + // FIXME: return to private? + void sendRPCRequestPrivate(RPCRequest request) throws SyncException { + try { + SyncTrace.logRPCEvent(InterfaceActivityDirection.Transmit, request, SYNC_LIB_TRACE_KEY); + + final IRPCRequestConverter converter = + rpcRequestConverterFactory.getConverterForRequest(request); + List<ProtocolMessage> protocolMessages = + converter.getProtocolMessages(request, + currentSession.getSessionId(), _jsonRPCMarshaller, + _wiproVersion); + + if (protocolMessages.size() > 0) { + queueOutgoingMessage(protocolMessages.get(0)); + protocolMessages.remove(0); + + if (protocolMessages.size() > 0) { + protocolMessageHolder.saveMessages(protocolMessages); + } + } + } catch (OutOfMemoryError e) { + SyncTrace.logProxyEvent("OutOfMemory exception while sending request " + request.getFunctionName(), SYNC_LIB_TRACE_KEY); + throw new SyncException("OutOfMemory exception while sending request " + request.getFunctionName(), e, SyncExceptionCause.INVALID_ARGUMENT); + } + } + + private void queueOutgoingMessage(ProtocolMessage message) { + synchronized (OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) { + if (_outgoingProxyMessageDispatcher != null) { + _outgoingProxyMessageDispatcher.queueMessage(message); + } + } + } + + /** + * Handles a response that is a part of partial request (i.e., split into + * multiple protocol messages) if it is. + * + * @param response response from the SDL + * @return true if the response has been handled; false when the + * corresponding request is not partial or in case of an error + */ + protected boolean handlePartialRPCResponse(RPCResponse response) { + boolean success = false; + final Integer responseCorrelationID = response.getCorrelationID(); + if (protocolMessageHolder.hasMessages(responseCorrelationID)) { + if (Result.SUCCESS == response.getResultCode()) { + final ProtocolMessage pm = + protocolMessageHolder.peekNextMessage( + responseCorrelationID); + if (pm.getFunctionID() == + FunctionID.getFunctionID(response.getFunctionName())) { + protocolMessageHolder.popNextMessage(responseCorrelationID); + queueOutgoingMessage(pm); + + success = true; + } + } else { + protocolMessageHolder.clearMessages(responseCorrelationID); + } + } + + return success; + } + + /** + * Handles an internal response, if it is, that is last in sequence. Such a + * response shouldn't be exposed to the user. For example, a PutFile + * responded for OnSystemRequest. + * + * @param response response from the SDL + * @return true if the response has been handled; false when the + * corresponding request is not internal or in case of an error + */ + protected boolean handleLastInternalResponse(RPCResponse response) { + final Integer correlationID = response.getCorrelationID(); + final boolean contains = internalRequestCorrelationIDs.contains( + correlationID); + if (contains) { + internalRequestCorrelationIDs.remove(correlationID); + } + + return contains; + } + + private void handleRPCMessage(Hashtable hash){ + getRPCMessageHandler().handleRPCMessage(hash); + } + + protected void handleOnSystemRequest(Hashtable hash) { + final OnSystemRequest msg = new OnSystemRequest(hash); + if (RequestType.HTTP == msg.getRequestType()) { + if (msg.getFileType() == FileType.JSON) { + Runnable request = new Runnable() { + @Override + public void run() { + onSystemRequestHandler.onPolicyTableSnapshotRequest(SyncProxyBase.this, + msg.getBulkData()); + } + }; + if (_callbackToUIThread) { + _mainUIHandler.post(request); + } else { + request.run(); + } + } else { + final Vector<String> urls = msg.getUrl(); + if (urls != null) { + Runnable request = new Runnable() { + @Override + public void run() { + onSystemRequestHandler.onFilesDownloadRequest( + SyncProxyBase.this, urls, msg.getFileType()); + } + }; + if (_callbackToUIThread) { + _mainUIHandler.post(request); + } else { + request.run(); + } + } else { + Log.w(TAG, "OnSystemRequest HTTP: no urls set"); + } + } + } else if (RequestType.FILE_RESUME == msg.getRequestType()) { + final Vector<String> urls = msg.getUrl(); + final Integer offset = msg.getOffset(); + final Integer length = msg.getLength(); + final boolean allRequiredParamsSet = + (urls != null) && (offset != null) && (length != null); + if (allRequiredParamsSet) { + Runnable request = new Runnable() { + @Override + public void run() { + onSystemRequestHandler.onFileResumeRequest( + SyncProxyBase.this, urls.get(0), offset, length, + msg.getFileType()); + } + }; + + if (_callbackToUIThread) { + _mainUIHandler.post(request); + } else { + request.run(); + } + } else { + Log.w(TAG, + "OnSystemRequest FILE_RESUME: a required parameter is missing"); + } + } else { + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + _proxyListener.onOnSystemRequest(msg); + } + }); + } else { + _proxyListener.onOnSystemRequest(msg); + } + } + } + + protected void notifyOnAppInterfaceUnregistered(final OnAppInterfaceUnregistered msg) { + notifyProxyClosed("OnAppInterfaceUnregistered", null); + + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + ((IProxyListener) _proxyListener).onOnAppInterfaceUnregistered(msg); + } + }); + } else { + ((IProxyListener) _proxyListener).onOnAppInterfaceUnregistered(msg); + } + } + + protected void onAppUnregisteredReason(final AppInterfaceUnregisteredReason reason) { + if (reason == AppInterfaceUnregisteredReason.IGNITION_OFF || + reason == AppInterfaceUnregisteredReason.MASTER_RESET) { + cycleProxy(SyncDisconnectedReason.convertAppInterfaceUnregisteredReason(reason)); + } + + if (getCallbackToUIThread()) { + // Run in UI thread + getMainUIHandler().post(new Runnable() { + @Override + public void run() { + getProxyListener().onAppUnregisteredReason(reason); + } + }); + } else { + getProxyListener().onAppUnregisteredReason(reason); + } + } + + protected void onUnregisterAppInterfaceResponse(Hashtable hash) { + stopAllServices(); + closeSyncConnection(true); + stopSession(); + + // UnregisterAppInterface + _appInterfaceRegisterd = false; + synchronized (APP_INTERFACE_REGISTERED_LOCK) { + APP_INTERFACE_REGISTERED_LOCK.notify(); + } + final UnregisterAppInterfaceResponse msg = new UnregisterAppInterfaceResponse(hash); + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + if (_proxyListener instanceof IProxyListener) { + ((IProxyListener) _proxyListener).onUnregisterAppInterfaceResponse(msg); + } else if (_proxyListener instanceof IProxyListenerALMTesting) { + ((IProxyListenerALMTesting) _proxyListener).onUnregisterAppInterfaceResponse(msg); + } + } + }); + } else { + if (_proxyListener instanceof IProxyListener) { + ((IProxyListener) _proxyListener).onUnregisterAppInterfaceResponse(msg); + } else if (_proxyListener instanceof IProxyListenerALMTesting) { + ((IProxyListenerALMTesting) _proxyListener).onUnregisterAppInterfaceResponse(msg); + } + } + + notifyProxyClosed("UnregisterAppInterfaceResponse", null); + } + + /** + * Takes an RPCRequest and sends it to SYNC. Responses are captured through callback on IProxyListener. + * + * @throws SyncException + */ + public void sendRPCRequest(RPCRequest request) throws SyncException { + if (_proxyDisposed) { + throw new SyncException("This object has been disposed, it is no long capable of executing methods.", SyncExceptionCause.SYNC_PROXY_DISPOSED); + } + + // Test if request is null + if (request == null) { + SyncTrace.logProxyEvent("Application called sendRPCRequest method with a null RPCRequest.", SYNC_LIB_TRACE_KEY); + throw new IllegalArgumentException("sendRPCRequest cannot be called with a null request."); + } + + SyncTrace.logProxyEvent("Application called sendRPCRequest method for RPCRequest: ." + request.getFunctionName(), SYNC_LIB_TRACE_KEY); + + checkSyncConnection(); + + // Test for illegal correlation ID + if (isCorrelationIDProtected(request.getCorrelationID())) { + + SyncTrace.logProxyEvent("Application attempted to use the reserved correlation ID, " + request.getCorrelationID(), SYNC_LIB_TRACE_KEY); + throw new SyncException("Invalid correlation ID. The correlation ID, " + request.getCorrelationID() + + " , is a reserved correlation ID.", SyncExceptionCause.RESERVED_CORRELATION_ID); + } + + // Throw exception if RPCRequest is sent when SYNC is unavailable + if (!_appInterfaceRegisterd && !request.getFunctionName().equals(Names.RegisterAppInterface)) { + if (!allowExtraTesting()) { + SyncTrace.logProxyEvent("Application attempted to send an RPCRequest (non-registerAppInterface), before the interface was registerd.", SYNC_LIB_TRACE_KEY); + throw new SyncException("SYNC is currently unavailable. RPC Requests cannot be sent.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + } + + if (_advancedLifecycleManagementEnabled) { + if (request.getFunctionName().equals(Names.RegisterAppInterface) + || request.getFunctionName().equals(Names.UnregisterAppInterface)) { + if (!allowExtraTesting()) { + SyncTrace.logProxyEvent("Application attempted to send a RegisterAppInterface or UnregisterAppInterface while using ALM.", SYNC_LIB_TRACE_KEY); + throw new SyncException("The RPCRequest, " + request.getFunctionName() + + ", is unnallowed using the Advanced Lifecycle Management Model.", SyncExceptionCause.INCORRECT_LIFECYCLE_MODEL); + } + } + } + sendRPCRequestPrivate(request); + } // end-method + + private void checkSyncConnection() throws SyncException { + // Test if SyncConnection is null + synchronized (CONNECTION_REFERENCE_LOCK) { + if (mSyncConnection == null || !mSyncConnection.getIsConnected()) { + SyncTrace.logProxyEvent("Application attempted to send and RPCRequest without a connected transport.", SYNC_LIB_TRACE_KEY); + throw new SyncException("There is no valid connection to SYNC. sendRPCRequest cannot be called until SYNC has been connected.", SyncExceptionCause.SYNC_UNAVAILALBE); + } + } + } + + /** + * Returns whether the class allows some extra testing features. For this, + * the _proxyListener must be an instance of the IProxyListenerALMTesting + * class. + * + * @return true if the extra testing features are enabled + */ + private boolean allowExtraTesting() { + return _proxyListener instanceof IProxyListenerALMTesting; + } + + public void sendRPCRequest(RPCMessage request) throws SyncException { + sendRPCRequest(request); + } + + protected void notifyProxyClosed(final String info, final Exception e) { + SyncTrace.logProxyEvent("NotifyProxyClose", SYNC_LIB_TRACE_KEY); + + OnProxyClosed message = new OnProxyClosed(info, e); + queueInternalMessage(message); + } + + private void passErrorToProxyListener(final String info, final Throwable e) { + OnError message = new OnError(info, e); + queueInternalMessage(message); + } + + private void startRPCProtocolService(final byte sessionID, final String correlationID) { + currentSession.setSessionId(sessionID); + addIfNotExsistRpcServiceToSession(); + mSyncConnection.setSessionId(sessionID); + Log.i(TAG, "RPC Session started, sessionId:" + sessionID + ", correlationID:" + correlationID); + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + _proxyListener.onSessionStarted(sessionID, correlationID); + } + }); + } else { + _proxyListener.onSessionStarted(sessionID, correlationID); + } + + restartRPCProtocolSession(); + } + + private void addIfNotExsistRpcServiceToSession() { + if (!currentSession.hasService(ServiceType.RPC)) { + Service service = new Service(); + service.setServiceType(ServiceType.RPC); + service.setSession(currentSession); + currentSession.addService(service); + } + } + + private void restartRPCProtocolSession() { + // Set Proxy Lifecycle Available + if (_advancedLifecycleManagementEnabled) { + + try { + registerAppInterfacePrivate( + _syncMsgVersionRequest, + _applicationName, + _ttsName, + _ngnMediaScreenAppName, + _vrSynonyms, + _isMediaApp, + _syncLanguageDesired, + _hmiDisplayLanguageDesired, _appHMIType, + _appID, + _autoActivateIdDesired, + REGISTER_APP_INTERFACE_CORRELATION_ID, + getHashId()); + + } catch (Exception e) { + notifyProxyClosed("Failed to register application interface with SYNC. Check parameter values given to SyncProxy constructor.", e); + } + } else { + InternalProxyMessage message = new InternalProxyMessage(Names.OnProxyOpened); + queueInternalMessage(message); + } + } + + protected void handleEndServiceAck(final ServiceType serviceType, final byte sessionId, final String correlationID) { + Log.i(TAG, "EndService Ack received; Session Type " + serviceType.getName() + "; Session ID " + sessionId + "; Correlation ID " + correlationID); + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + _proxyListener.onProtocolServiceEnded(serviceType, sessionId, correlationID); + } + }); + } else { + _proxyListener.onProtocolServiceEnded(serviceType, sessionId, correlationID); + } + } + + protected void handleMobileNavAck(int frameNumberReceived) { + Log.i(TAG, "Mobile Nav Ack received = " + frameNumberReceived); + final int fNumber = frameNumberReceived; + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + _proxyListener.onMobileNavAckReceived(fNumber); + } + }); + } else { + _proxyListener.onMobileNavAckReceived(fNumber); + } + } + + protected void handleStartServiceNack(final ServiceType serviceType) { + Log.i(TAG, "Service Nack received for " + serviceType); + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + _proxyListener.onStartServiceNackReceived(serviceType); + } + }); + } else { + _proxyListener.onStartServiceNackReceived(serviceType); + } + } + + protected void startMobileNaviService(byte sessionID, String correlationID) { + Log.i(TAG, "Mobile Navi service started " + correlationID); + createService(sessionID, ServiceType.Mobile_Nav); + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + _proxyListener.onMobileNaviStart(); + } + }); + } else { + _proxyListener.onMobileNaviStart(); + } + } + + protected void startAudioService(byte sessionID, String correlationID) { + Log.i(TAG, "Mobile Audio service started " + sessionID); + createService(sessionID, ServiceType.Audio_Service); + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + _proxyListener.onAudioServiceStart(); + } + }); + } else { + _proxyListener.onAudioServiceStart(); + } + } + + private void createService(byte sessionID, ServiceType serviceType) { + if (sessionID != currentSession.getSessionId()) { + throw new IllegalArgumentException("can't create service with sessionID " + sessionID); + } + Service service = currentSession.createService(serviceType); + currentSession.addService(service); + } + + public void stopMobileNaviService() { + if (removeServiceFromSession(currentSession.getSessionId(), ServiceType.Mobile_Nav)) { + Log.i(TAG, "Mobile Navi Service is going to stop, " + + "sesId:" + currentSession.getSessionId()); + try { + getSyncConnection().closeMobileNaviService(currentSession.getSessionId()); + } catch (NullPointerException e) { + Log.e(TAG, e.toString()); + } + } + } + + public void stopAudioService() { + if (removeServiceFromSession(currentSession.getSessionId(), ServiceType.Audio_Service)) { + Log.i(TAG, "Mobile Audio service is going to stop, " + + "sesId:" + currentSession.getSessionId()); + try { + getSyncConnection().closeAudioService(currentSession.getSessionId()); + } catch (NullPointerException e) { + Log.e(TAG, e.toString()); + } + } + } + + private boolean removeServiceFromSession(byte sessionID, ServiceType serviceType) { + List<Service> servicePool = getServicePool(); + for (Service service : servicePool) { + if ((service.getSession().getSessionId() == sessionID) && (serviceType.equals(service.getServiceType()))) { + currentSession.removeService(service); + return true; + } + } + return false; + } + + // 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); + } + } + } + + public OutputStream startH264() { + OutputStream stream = null; + if (mSyncConnection != null) { + stream = mSyncConnection.startH264(currentSession.getSessionId()); + } + return stream; + } + + public void stopH264() { + if (mSyncConnection != null) { + mSyncConnection.stopH264(); + } + } + + public OutputStream startAudioDataTransfer() { + OutputStream stream = null; + if (mSyncConnection != null) { + stream = mSyncConnection.startAudioDataTransfer(currentSession.getSessionId()); + } + return stream; + } + + public void stopAudioDataTransfer() { + if (mSyncConnection != null) { + mSyncConnection.stopAudioDataTransfer(); + } + } + + /** + * Sends an AddCommand RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param commandID command Id + * @param menuText menu text + * @param parentID parent Id + * @param position position + * @param vrCommands VR Commands vector + * @param correlationID correlation Id + * @throws SyncException + */ + public void addCommand(Integer commandID, String menuText, Integer parentID, Integer position, + Vector<String> vrCommands, Integer correlationID) + throws SyncException { + + AddCommand addCommand = RPCRequestFactory.buildAddCommand(commandID, menuText, parentID, position, + vrCommands, correlationID); + + sendRPCRequest(addCommand); + } + + /** + * Sends an AddCommand RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param commandID command Id + * @param menuText + * @param position + * @param vrCommands + * @param correlationID + * @throws SyncException + */ + public void addCommand(Integer commandID, String menuText, Integer position, + Vector<String> vrCommands, Integer correlationID) + throws SyncException { + + addCommand(commandID, menuText, null, position, vrCommands, correlationID); + } + + /** + * Sends an AddCommand RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param commandID command Id + * @param menuText + * @param position + * @param correlationID + * @throws SyncException + */ + public void addCommand(Integer commandID, String menuText, Integer position, + Integer correlationID) + throws SyncException { + + addCommand(commandID, menuText, null, position, null, correlationID); + } + + /** + * Sends an AddCommand RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param commandID command Id + * @param menuText + * @param correlationID + * @throws SyncException + */ + public void addCommand(Integer commandID, String menuText, Integer correlationID) + throws SyncException { + + addCommand(commandID, menuText, null, null, null, correlationID); + } + + /** + * Sends an AddCommand RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param commandID command Id + * @param menuText menu text + * @param vrCommands VR Commands vector + * @param correlationID correlation Id + * @throws SyncException + */ + public void addCommand(Integer commandID, String menuText, Vector<String> vrCommands, + Integer correlationID) + throws SyncException { + addCommand(commandID, menuText, null, null, vrCommands, correlationID); + } + + /** + * Sends an AddCommand RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param commandID command Id + * @param vrCommands + * @param correlationID + * @throws SyncException + */ + public void addCommand(Integer commandID, Vector<String> vrCommands, Integer correlationID) + throws SyncException { + + addCommand(commandID, null, null, null, vrCommands, correlationID); + } + + /** + * Sends an AddSubMenu RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param menuID + * @param menuName + * @param position + * @param correlationID + * @throws SyncException + */ + public void addSubMenu(Integer menuID, String menuName, Integer position, Integer correlationID) + throws SyncException { + + AddSubMenu msg = RPCRequestFactory.buildAddSubMenu(menuID, menuName, + position, correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends an AddSubMenu RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param menuID + * @param menuName + * @param correlationID + * @throws SyncException + */ + public void addSubMenu(Integer menuID, String menuName, Integer correlationID) + throws SyncException { + + addSubMenu(menuID, menuName, null, correlationID); + } + + /** + * Send a ListFiles RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param correlationID correlation Id + * @throws SyncException + */ + public void listFiles(Integer correlationID) throws SyncException { + ListFiles listFiles = new ListFiles(); + listFiles.setCorrelationID(correlationID); + sendRPCRequest(listFiles); + } + + /** + * Send a SetAppIcon RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param fileName a name of the file + * @param correlationID correlation Id + * @throws SyncException + */ + public void setAppIcon(String fileName, Integer correlationID) throws SyncException { + SetAppIcon setAppIcon = new SetAppIcon(); + setAppIcon.setSyncFileName(fileName); + setAppIcon.setCorrelationID(correlationID); + sendRPCRequest(setAppIcon); + } + + /** + * Send PutFile RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param putFile PutFile object to be send + */ + public void putFile(PutFile putFile) throws SyncException { + if (putFile != null) { + sendRPCRequest(putFile); + } else { + // TODO : Process null object here + } + } + + /** + * Sends an EncodedData RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param data + * @param correlationID + * @throws SyncException + */ + public void encodedSyncPData(Vector<String> data, Integer correlationID) + throws SyncException { + + Log.i("pt", "encodedSyncPData() giving to sync"); + EncodedSyncPData msg = RPCRequestFactory.buildEncodedSyncPData(data, correlationID); + sendRPCRequest(msg); + } + + /** + * Sends a Data RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param data + * @param correlationID + * @throws SyncException + */ + public void syncPData(byte[] data, Integer correlationID) + throws SyncException { + + Log.i("pt", "syncPData() giving to sync"); + SyncPData msg = RPCRequestFactory.buildSyncPData(data, correlationID); + sendRPCRequest(msg); + } + + /** + * Sends an Alert RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param ttsText + * @param alertText1 + * @param alertText2 + * @param playTone + * @param duration + * @param correlationID + * @throws SyncException + */ + public void alert(String ttsText, String alertText1, + String alertText2, Boolean playTone, Integer duration, + Integer correlationID) throws SyncException { + + Alert msg = RPCRequestFactory.buildAlert(ttsText, alertText1, alertText2, + playTone, duration, correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends an Alert RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param ttsChunks + * @param alertText1 + * @param alertText2 + * @param playTone + * @param duration + * @param correlationID + * @throws SyncException + */ + public void alert(Vector<TTSChunk> ttsChunks, + String alertText1, String alertText2, Boolean playTone, + Integer duration, Integer correlationID) throws SyncException { + + Alert msg = RPCRequestFactory.buildAlert(ttsChunks, alertText1, alertText2, playTone, + duration, correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends an Alert RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param ttsText + * @param playTone + * @param correlationID + * @throws SyncException + */ + public void alert(String ttsText, Boolean playTone, + Integer correlationID) throws SyncException { + + alert(ttsText, null, null, playTone, null, correlationID); + } + + /** + * Sends an Alert RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param chunks + * @param playTone + * @param correlationID + * @throws SyncException + */ + public void alert(Vector<TTSChunk> chunks, Boolean playTone, + Integer correlationID) throws SyncException { + + alert(chunks, null, null, playTone, null, correlationID); + } + + /** + * Sends an Alert RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param alertText1 + * @param alertText2 + * @param playTone + * @param duration + * @param correlationID + * @throws SyncException + */ + public void alert(String alertText1, String alertText2, + Boolean playTone, Integer duration, Integer correlationID) + throws SyncException { + + alert((Vector<TTSChunk>) null, alertText1, alertText2, playTone, duration, correlationID); + } + + /** + * Sends a CreateInteractionChoiceSet RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param choiceSet Set of {@link com.ford.syncV4.proxy.rpc.Choice} objects + * @param interactionChoiceSetID Id of the interaction Choice set + * @param correlationID correlation Id + * @throws SyncException + */ + public void createInteractionChoiceSet(Vector<Choice> choiceSet, Integer interactionChoiceSetID, + Integer correlationID) throws SyncException { + + CreateInteractionChoiceSet createInteractionChoiceSet = + RPCRequestFactory.buildCreateInteractionChoiceSet(choiceSet, + interactionChoiceSetID, correlationID); + + sendRPCRequest(createInteractionChoiceSet); + } + + /** + * Sends a DeleteCommand RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param commandID + * @param correlationID + * @throws SyncException + */ + public void deleteCommand(Integer commandID, + Integer correlationID) throws SyncException { + + DeleteCommand msg = RPCRequestFactory.buildDeleteCommand(commandID, correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends a DeleteInteractionChoiceSet RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param interactionChoiceSetID + * @param correlationID + * @throws SyncException + */ + public void deleteInteractionChoiceSet( + Integer interactionChoiceSetID, Integer correlationID) + throws SyncException { + + DeleteInteractionChoiceSet msg = RPCRequestFactory.buildDeleteInteractionChoiceSet( + interactionChoiceSetID, correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends a DeleteSubMenu RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param menuID + * @param correlationID + * @throws SyncException + */ + public void deleteSubMenu(Integer menuID, + Integer correlationID) throws SyncException { + + DeleteSubMenu msg = RPCRequestFactory.buildDeleteSubMenu(menuID, correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends a PerformInteraction RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param initPrompt + * @param displayText + * @param interactionChoiceSetID + * @param correlationID + * @throws SyncException + */ + public void performInteraction(String initPrompt, + String displayText, Integer interactionChoiceSetID, + Integer correlationID) throws SyncException { + + PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(initPrompt, + displayText, interactionChoiceSetID, correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends a PerformInteraction RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param initPrompt + * @param displayText + * @param interactionChoiceSetID + * @param correlationID + * @throws SyncException + */ + public void performInteraction(String initPrompt, + String displayText, Integer interactionChoiceSetID, + String helpPrompt, String timeoutPrompt, + InteractionMode interactionMode, Integer timeout, + Integer correlationID) throws SyncException { + + PerformInteraction msg = RPCRequestFactory.buildPerformInteraction( + initPrompt, displayText, interactionChoiceSetID, + helpPrompt, timeoutPrompt, interactionMode, + timeout, correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends a PerformInteraction RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param initPrompt + * @param displayText + * @param interactionChoiceSetIDList + * @param helpPrompt + * @param timeoutPrompt + * @param interactionMode + * @param timeout + * @param correlationID + * @throws SyncException + */ + public void performInteraction(String initPrompt, + String displayText, Vector<Integer> interactionChoiceSetIDList, + String helpPrompt, String timeoutPrompt, + InteractionMode interactionMode, Integer timeout, + Integer correlationID) throws SyncException { + + PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(initPrompt, + displayText, interactionChoiceSetIDList, + helpPrompt, timeoutPrompt, interactionMode, timeout, + correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends a PerformInteraction RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param initChunks + * @param displayText + * @param interactionChoiceSetIDList + * @param helpChunks + * @param timeoutChunks + * @param interactionMode + * @param timeout + * @param correlationID + * @throws SyncException + */ + public void performInteraction( + Vector<TTSChunk> initChunks, String displayText, + Vector<Integer> interactionChoiceSetIDList, + Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, + InteractionMode interactionMode, Integer timeout, + Integer correlationID) throws SyncException { + + PerformInteraction msg = RPCRequestFactory.buildPerformInteraction( + initChunks, displayText, interactionChoiceSetIDList, + helpChunks, timeoutChunks, interactionMode, timeout, + correlationID); + + sendRPCRequest(msg); + } + + // Protected registerAppInterface used to ensure only non-ALM applications call + // ReqisterAppInterface + protected void registerAppInterfacePrivate( + SyncMsgVersion syncMsgVersion, String appName, Vector<TTSChunk> ttsName, + String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, + Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appHMIType, + String appID, String autoActivateID, Integer correlationID, String hashId) + throws SyncException { + + final RegisterAppInterface msg = RPCRequestFactory.buildRegisterAppInterface( + syncMsgVersion, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, + languageDesired, hmiDisplayLanguageDesired, appHMIType, appID, correlationID, hashId); + + sendRPCRequestPrivate(msg); + + logOnRegisterAppRequest(msg); + } + + private void logOnRegisterAppRequest(final RegisterAppInterface msg) { + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + _proxyListener.onRegisterAppRequest(msg); + } + }); + } else { + _proxyListener.onRegisterAppRequest(msg); + } + } + + /** + * Sends a SetGlobalProperties RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param helpPrompt + * @param timeoutPrompt + * @param correlationID + * @throws SyncException + */ + public void setGlobalProperties( + String helpPrompt, String timeoutPrompt, Integer correlationID) + throws SyncException { + + SetGlobalProperties req = RPCRequestFactory.buildSetGlobalProperties(helpPrompt, + timeoutPrompt, correlationID); + + sendRPCRequest(req); + } + + /** + * Sends a SetGlobalProperties RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param helpChunks + * @param timeoutChunks + * @param correlationID + * @throws SyncException + */ + public void setGlobalProperties( + Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, + Integer correlationID) throws SyncException { + + SetGlobalProperties req = RPCRequestFactory.buildSetGlobalProperties( + helpChunks, timeoutChunks, correlationID); + + sendRPCRequest(req); + } + + public void resetGlobalProperties(Vector<GlobalProperty> properties, + Integer correlationID) throws SyncException { + + ResetGlobalProperties req = new ResetGlobalProperties(); + + req.setCorrelationID(correlationID); + req.setProperties(properties); + + sendRPCRequest(req); + } + + /** + * Sends a SetMediaClockTimer RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param hours + * @param minutes + * @param seconds + * @param updateMode + * @param correlationID + * @throws SyncException + */ + public void setMediaClockTimer(Integer hours, + Integer minutes, Integer seconds, UpdateMode updateMode, + Integer correlationID) throws SyncException { + + SetMediaClockTimer msg = RPCRequestFactory.buildSetMediaClockTimer(hours, + minutes, seconds, updateMode, correlationID); + + sendRPCRequest(msg); + } + + /** + * Pauses the media clock. Responses are captured through callback on IProxyListener. + * + * @param correlationID + * @throws SyncException + */ + public void pauseMediaClockTimer(Integer correlationID) + throws SyncException { + + SetMediaClockTimer msg = RPCRequestFactory.buildSetMediaClockTimer(0, + 0, 0, UpdateMode.PAUSE, correlationID); + + sendRPCRequest(msg); + } + + /** + * Resumes the media clock. Responses are captured through callback on IProxyListener. + * + * @param correlationID + * @throws SyncException + */ + public void resumeMediaClockTimer(Integer correlationID) + throws SyncException { + + SetMediaClockTimer msg = RPCRequestFactory.buildSetMediaClockTimer(0, + 0, 0, UpdateMode.RESUME, correlationID); + + sendRPCRequest(msg); + } + + /** + * Clears the media clock. Responses are captured through callback on IProxyListener. + * + * @param correlationID + * @throws SyncException + */ + public void clearMediaClockTimer(Integer correlationID) + throws SyncException { + + Show msg = RPCRequestFactory.buildShow(null, null, null, " ", null, null, correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends a Show RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param mainText1 + * @param mainText2 + * @param statusBar + * @param mediaClock + * @param mediaTrack + * @param alignment + * @param correlationID + * @throws SyncException + */ + public void show(String mainText1, String mainText2, + String statusBar, String mediaClock, String mediaTrack, + TextAlignment alignment, Integer correlationID) + throws SyncException { + + Show msg = RPCRequestFactory.buildShow(mainText1, mainText2, + statusBar, mediaClock, mediaTrack, + alignment, correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends a Show RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param mainText1 + * @param mainText2 + * @param alignment + * @param correlationID + * @throws SyncException + */ + public void show(String mainText1, String mainText2, + TextAlignment alignment, Integer correlationID) + throws SyncException { + + show(mainText1, mainText2, null, null, null, alignment, correlationID); + } + + /** + * Sends a Speak RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param ttsText + * @param correlationID + * @throws SyncException + */ + public void speak(String ttsText, Integer correlationID) + throws SyncException { + + Speak msg = RPCRequestFactory.buildSpeak(TTSChunkFactory.createSimpleTTSChunks(ttsText), + correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends a Speak RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param ttsChunks + * @param correlationID + * @throws SyncException + */ + public void speak(Vector<TTSChunk> ttsChunks, + Integer correlationID) throws SyncException { + + Speak msg = RPCRequestFactory.buildSpeak(ttsChunks, correlationID); + + sendRPCRequest(msg); + } + + /** + * Sends a SubscribeButton RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param buttonName + * @param correlationID + * @throws SyncException + */ + public void subscribeButton(ButtonName buttonName, + Integer correlationID) throws SyncException { + + SubscribeButton msg = RPCRequestFactory.buildSubscribeButton(buttonName, + correlationID); + + sendRPCRequest(msg); + } + + // Protected unregisterAppInterface used to ensure no non-ALM app calls + // unregisterAppInterface. + protected void unregisterAppInterfacePrivate(Integer correlationID) + throws SyncException { + + UnregisterAppInterface msg = + RPCRequestFactory.buildUnregisterAppInterface(correlationID); + + sendRPCRequestPrivate(msg); + } + + /** + * Sends an UnsubscribeButton RPCRequest to SYNC. Responses are captured through callback on IProxyListener. + * + * @param buttonName + * @param correlationID + * @throws SyncException + */ + public void unsubscribeButton(ButtonName buttonName, + Integer correlationID) throws SyncException { + + UnsubscribeButton msg = RPCRequestFactory.buildUnsubscribeButton( + buttonName, 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. + * @throws SyncException + */ + 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; + } + + /** + * Gets type of transport currently used by this SyncProxy. + * + * @return One of TransportType enumeration values. + * @see TransportType + */ + public TransportType getCurrentTransportType() throws IllegalStateException { + if (mSyncConnection == null) { + throw new IllegalStateException("Incorrect state of SyncProxyBase: Calling for getCurrentTransportType() while connection is not initialized"); + } + + return mSyncConnection.getCurrentTransportType(); + } + + /** + * ***************** END Public Helper Methods ************************ + */ + + public IJsonRPCMarshaller getJsonRPCMarshaller() { + return this._jsonRPCMarshaller; + } + + /** + * @param jsonRPCMarshaller the jsonRPCMarshaller to set + */ + public void setJsonRPCMarshaller(IJsonRPCMarshaller jsonRPCMarshaller) throws IllegalArgumentException { + if (jsonRPCMarshaller == null) { + throw new IllegalArgumentException("jsonRPCMarshaller must not be null"); + } + + this._jsonRPCMarshaller = jsonRPCMarshaller; + } + + protected TimerTask getCurrentReconnectTimerTask() { + TimerTask task; + synchronized (RECONNECT_TIMER_TASK_LOCK) { + task = _currentReconnectTimerTask; + } + return task; + } + + private void setCurrentReconnectTimerTask(TimerTask currentReconnectTimerTask) { + synchronized (RECONNECT_TIMER_TASK_LOCK) { + if (currentReconnectTimerTask == null) { + _currentReconnectTimerTask.cancel(); + } + _currentReconnectTimerTask = currentReconnectTimerTask; + } + } + + private boolean clearCurrentReconnectTimerTask() { + TimerTask task = getCurrentReconnectTimerTask(); + if (task != null) { + Log.d(TAG, "Clearing reconnect timer task"); + boolean success = task.cancel(); + setCurrentReconnectTimerTask(null); + if (!success) { + Log.i(TAG, "Can't cancel scheduled reconnect task"); + } + return success; + } + + return true; + } + + private Timer getReconnectTimer() { + if (_reconnectTimer == null) { + Log.d(TAG, "Reconnect timer is null, creating a new one"); + _reconnectTimer = new Timer("ReconnectTimer", true); + } + + return _reconnectTimer; + } + + private void clearReconnectTimer() { + if (_reconnectTimer != null) { + Log.d(TAG, "Clearing reconnect timer"); + _reconnectTimer.cancel(); + _reconnectTimer = null; + } else { + Log.d(TAG, "Reconnect timer is already null"); + } + } + + /** + * Sets the desired SYNC and HMI display languages, and re-registers the + * application. + */ + public void resetLanguagesDesired(Language syncLanguageDesired, + Language hmiDisplayLanguageDesired) { + this._syncLanguageDesired = syncLanguageDesired; + this._hmiDisplayLanguageDesired = hmiDisplayLanguageDesired; + + restartRPCProtocolSession(); + } + + // TODO: Need to refactor it + public List<Service> getServicePool() { + return currentSession.getServiceList(); + } + + public boolean hasServiceInServicesPool(ServiceType serviceType) { + return !currentSession.isServicesEmpty() && currentSession.hasService(serviceType); + } + + /** + * Return number of Services in current Session + * + * @return number of Services in current Session + */ + public int getServicesNumber() { + return currentSession.getServicesNumber(); + } + + public void setSyncMsgVersionRequest(SyncMsgVersion syncMsgVersionRequest) { + _syncMsgVersionRequest = syncMsgVersionRequest; + } + + public SyncMsgVersion getSyncMsgVersionRequest() { + return _syncMsgVersionRequest; + } + + public void setApplicationName(String applicationName) { + _applicationName = applicationName; + } + + public String getApplicationName() { + return _applicationName; + } + + public void setTTSName(Vector<TTSChunk> TTSName) { + this._ttsName = TTSName; + } + + public Vector<TTSChunk> getTTSName() { + return _ttsName; + } + + public void setNgnMediaScreenAppName(String ngnMediaScreenAppName) { + this._ngnMediaScreenAppName = ngnMediaScreenAppName; + } + + public String getNgnMediaScreenAppName() { + return _ngnMediaScreenAppName; + } + + public void setVrSynonyms(Vector<String> vrSynonyms) { + this._vrSynonyms = vrSynonyms; + } + + public Vector<String> getVrSynonyms() { + return _vrSynonyms; + } + + public void setIsMediApp(Boolean isMediApp) { + this._isMediaApp = isMediApp; + } + + public Boolean getIsMediaApp() { + return _isMediaApp; + } + + public void setSyncLanguageDesired(Language syncLanguageDesired) { + this._syncLanguageDesired = syncLanguageDesired; + } + + public Language getSyncLanguageDesired() { + return _syncLanguageDesired; + } + + public void setHmiDisplayLanguageDesired(Language hmiDisplayLanguageDesired) { + this._hmiDisplayLanguageDesired = hmiDisplayLanguageDesired; + } + + public Language getHmiDisplayLanguageDesired() { + return _hmiDisplayLanguageDesired; + } + + public void setAppHMIType(Vector<AppHMIType> appHMIType) { + this._appHMIType = appHMIType; + } + + public Vector<AppHMIType> getAppHMIType() { + return _appHMIType; + } + + public void setAppID(String appID) { + this._appID = appID; + } + + public String getAppID() { + return _appID; + } + + public void setAutoActivateIdReturned(String autoActivateIdDesired) { + this._autoActivateIdReturned = autoActivateIdDesired; + } + + public String getAutoActivateIdReturned() { + return _autoActivateIdReturned; + } + + public void updateRegisterAppInterfaceParameters(RegisterAppInterface msg) { + _syncMsgVersionRequest = msg.getSyncMsgVersion(); + _applicationName = msg.getAppName(); + _ttsName = msg.getTtsName(); + _ngnMediaScreenAppName = msg.getNgnMediaScreenAppName(); + _vrSynonyms = msg.getVrSynonyms(); + _isMediaApp = msg.getIsMediaApplication(); + _syncLanguageDesired = msg.getLanguageDesired(); + _hmiDisplayLanguageDesired = msg.getHmiDisplayLanguageDesired(); + _appHMIType = msg.getAppType(); + _appID = msg.getAppID(); + } + + public IRPCMessageHandler getRPCMessageHandler() { + return rpcMessageHandler; + } + + public void setRPCMessageHandler(IRPCMessageHandler RPCMessageHandler) { + this.rpcMessageHandler = RPCMessageHandler; + } + + // Private Class to Interface with SyncConnection + public class SyncInterfaceBroker implements ISyncConnectionListener { + + @Override + public void onTransportDisconnected(String info) { + // proxyOnTransportDisconnect is called to alert the proxy that a requested + // disconnect has completed + +// if (_advancedLifecycleManagementEnabled) { +// // If ALM, nothing is required to be done here +// } else { + // If original model, notify app the proxy is closed so it will delete and reinstanciate + notifyProxyClosed(info, new SyncException("Transport disconnected.", SyncExceptionCause.SYNC_UNAVAILALBE)); +// } + } + + @Override + public void onTransportError(String info, Exception e) { + DebugTool.logError("Transport failure: " + info, e); + + if (_transportConfig != null && + _transportConfig.getTransportType() == TransportType.USB) { + if (CommonUtils.isUSBNoSuchDeviceError(e.toString())) { + + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + _proxyListener.onUSBNoSuchDeviceException(); + } + }); + } else { + _proxyListener.onUSBNoSuchDeviceException(); + } + + try { + dispose(); + } catch (SyncException e1) { + e1.printStackTrace(); + } + + return; + } + } + + if (_advancedLifecycleManagementEnabled) { + // Cycle the proxy + cycleProxy(SyncDisconnectedReason.TRANSPORT_ERROR); + } else { + notifyProxyClosed(info, e); + } + } + + @Override + public void onHeartbeatTimedOut() { + final String msg = "Heartbeat timeout"; + DebugTool.logInfo(msg); + notifyProxyClosed(msg, new SyncException(msg, SyncExceptionCause.HEARTBEAT_PAST_DUE)); + } + + @Override + public void onProtocolMessageReceived(ProtocolMessage msg) { + // AudioPathThrough is coming WITH BulkData but WITHOUT JSON Data + // Policy Snapshot is coming WITH BulkData and WITH JSON Data + if (msg.getData().length > 0 || msg.getBulkData().length > 0) { + queueIncomingMessage(msg); + } + } + + @Override + public void onProtocolSessionStarted(Session session, byte version, String correlationID) { + if (_wiproVersion == 1) { + if (version == 2) setWiProVersion(version); + } + if (session.hasService(ServiceType.RPC)) { + startRPCProtocolService(session.getSessionId(), correlationID); + } + } + + @Override + public void onProtocolServiceEnded(ServiceType serviceType, + byte sessionID, String correlationID) { + handleEndServiceAck(serviceType, sessionID, correlationID); + } + + @Override + public void onProtocolError(String info, Throwable e) { + passErrorToProxyListener(info, e); + } + + @Override + public void onMobileNavAckReceived(int frameReceivedNumber) { + handleMobileNavAck(frameReceivedNumber); + } + + @Override + public void onStartServiceNackReceived(ServiceType serviceType) { + handleStartServiceNack(serviceType); + } + + @Override + public void onProtocolServiceStarted(ServiceType serviceType, byte sessionID, byte version, + String correlationID) { + if (_wiproVersion == 2) { + if (serviceType.equals(ServiceType.Mobile_Nav)) { + startMobileNaviService(sessionID, correlationID); + } else if (serviceType.equals(ServiceType.Audio_Service)) { + startAudioService(sessionID, correlationID); + } + } + } + } + + public IRPCRequestConverterFactory getRpcRequestConverterFactory() { + return rpcRequestConverterFactory; + } + + public void setRpcRequestConverterFactory( + IRPCRequestConverterFactory rpcRequestConverterFactory) { + this.rpcRequestConverterFactory = rpcRequestConverterFactory; + } + + protected void processRegisterAppInterfaceResponse(final RegisterAppInterfaceResponse response) { + if (!response.getSuccess()) { + setHashId(null); + } + + if (response.getResultCode() == Result.RESUME_FAILED) { + setHashId(null); + } + + // Create callback + if (_callbackToUIThread) { + // Run in UI thread + _mainUIHandler.post(new Runnable() { + @Override + public void run() { + if (_proxyListener instanceof IProxyListener) { + ((IProxyListener) _proxyListener).onRegisterAppInterfaceResponse(response); + } else if (_proxyListener instanceof IProxyListenerALMTesting) { + ((IProxyListenerALMTesting) _proxyListener) + .onRegisterAppInterfaceResponse(response); + } + } + }); + } else { + if (_proxyListener instanceof IProxyListener) { + ((IProxyListener) _proxyListener).onRegisterAppInterfaceResponse(response); + } else if (_proxyListener instanceof IProxyListenerALMTesting) { + ((IProxyListenerALMTesting) _proxyListener).onRegisterAppInterfaceResponse(response); + } + } + } + + /** + * Restore interrupted Services + */ + public void restoreServices() { + if (!currentSession.isServicesEmpty() && mSyncConnection.getIsConnected()) { + if (currentSession.hasService(ServiceType.Mobile_Nav)) { + mSyncConnection.startMobileNavService(currentSession); + } + if (currentSession.hasService(ServiceType.Audio_Service)) { + mSyncConnection.startAudioService(currentSession); + } + } + } + + public IOnSystemRequestHandler getOnSystemRequestHandler() { + return onSystemRequestHandler; + } + + public void setOnSystemRequestHandler( + IOnSystemRequestHandler onSystemRequestHandler) { + this.onSystemRequestHandler = onSystemRequestHandler; + } + + /** + * Returns the next correlation ID used for internal messages. + * + * @return next correlation ID + */ + private int nextCorrelationId() { + return ++lastCorrelationId; + } + + @Override + public void putSystemFile(String filename, byte[] data, FileType fileType) + throws SyncException { + putSystemFile(filename, data, null, fileType); + } + + @Override + public void putSystemFile(String filename, byte[] data, Integer offset, + FileType fileType) throws SyncException { + final int correlationID = nextCorrelationId(); + + PutFile putFile = RPCRequestFactory.buildPutFile(filename, fileType, null, data, + correlationID); + putFile.setSystemFile(true); + if (offset != null) { + putFile.setOffset(offset); + putFile.setLength(data.length); + } + + sendRPCRequest(putFile); + internalRequestCorrelationIDs.add(correlationID); + } + + @Override + public void putPolicyTableUpdateFile(String filename, byte[] data) throws SyncException { + final int correlationID = nextCorrelationId(); + + PutFile putFile = RPCRequestFactory.buildPutFile(filename, FileType.JSON, null, data, + correlationID); + + sendRPCRequest(putFile); + internalRequestCorrelationIDs.add(correlationID); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyConfigurationResources.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyConfigurationResources.java new file mode 100644 index 000000000..c054b01e4 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyConfigurationResources.java @@ -0,0 +1,34 @@ +package com.ford.syncV4.proxy;
+
+import android.telephony.TelephonyManager;
+
+public class SyncProxyConfigurationResources {
+ private String _syncConfigurationFilePath;
+ private TelephonyManager _telephonyManager;
+
+ public SyncProxyConfigurationResources() {
+ this(null, null);
+ }
+
+ public SyncProxyConfigurationResources(String syncConfigurationFilePath,
+ TelephonyManager telephonyManager) {
+ _syncConfigurationFilePath = syncConfigurationFilePath;
+ _telephonyManager = telephonyManager;
+ }
+
+ public void setSyncConfigurationFilePath(String syncConfigurationFilePath) {
+ _syncConfigurationFilePath = syncConfigurationFilePath;
+ }
+
+ public String getSyncConfigurationFilePath() {
+ return _syncConfigurationFilePath;
+ }
+
+ public void setTelephonyManager(TelephonyManager telephonyManager) {
+ _telephonyManager = telephonyManager;
+ }
+
+ public TelephonyManager getTelephonyManager() {
+ return _telephonyManager;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyFactory.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyFactory.java new file mode 100644 index 000000000..76325addc --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/SyncProxyFactory.java @@ -0,0 +1,18 @@ +package com.ford.syncV4.proxy;
+
+import android.util.Log;
+
+import com.ford.syncV4.exception.SyncException;
+
+public class SyncProxyFactory {
+
+ public static SyncProxy buildSyncProxy(IProxyListener listener) {
+ SyncProxy ret = null;
+ try {
+ ret = new SyncProxy(listener);
+ } catch (SyncException e) {
+ Log.e("SyncProxyTester", e.toString());
+ }
+ return ret;
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/TTSChunkFactory.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/TTSChunkFactory.java new file mode 100644 index 000000000..cc56908e3 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/TTSChunkFactory.java @@ -0,0 +1,39 @@ +package com.ford.syncV4.proxy;
+
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.rpc.TTSChunk;
+import com.ford.syncV4.proxy.rpc.enums.SpeechCapabilities;
+
+public class TTSChunkFactory {
+
+ public static TTSChunk createChunk(SpeechCapabilities type, String text) {
+ TTSChunk ret = new TTSChunk();
+ ret.setType(type);
+ ret.setText(text);
+ return ret;
+ }
+
+ public static Vector<TTSChunk> createSimpleTTSChunks(String simple) {
+ if (simple == null) {
+ return null;
+ }
+
+ Vector<TTSChunk> chunks = new Vector<TTSChunk>();
+
+ TTSChunk chunk = createChunk(SpeechCapabilities.TEXT, simple);
+ chunks.add(chunk);
+ return chunks;
+ }
+
+ public static Vector<TTSChunk> createPrerecordedTTSChunks(String prerecorded) {
+ if (prerecorded == null) {
+ return null;
+ }
+
+ Vector<TTSChunk> chunks = new Vector<TTSChunk>();
+ TTSChunk chunk = createChunk(SpeechCapabilities.PRE_RECORDED, prerecorded);
+ chunks.add(chunk);
+ return chunks;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/Version.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/Version.java new file mode 100644 index 000000000..ec9dc332b --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/Version.java @@ -0,0 +1,5 @@ +package com.ford.syncV4.proxy;
+
+public class Version {
+ public static final String VERSION = "MAJOR.MINOR.YYMMDD.#_FOR_DAY";
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/callbacks/InternalProxyMessage.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/callbacks/InternalProxyMessage.java new file mode 100644 index 000000000..5995c3bf8 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/callbacks/InternalProxyMessage.java @@ -0,0 +1,14 @@ +package com.ford.syncV4.proxy.callbacks;
+
+public class InternalProxyMessage {
+ private String _functionName;
+
+ public InternalProxyMessage(String functionName) {
+ //this(functionName, null, null);
+ this._functionName = functionName;
+ }
+
+ public String getFunctionName() {
+ return _functionName;
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/callbacks/OnError.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/callbacks/OnError.java new file mode 100644 index 000000000..d9f703ddd --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/callbacks/OnError.java @@ -0,0 +1,27 @@ +package com.ford.syncV4.proxy.callbacks;
+
+import com.ford.syncV4.proxy.constants.Names;
+
+public class OnError extends InternalProxyMessage {
+
+ private String _info;
+ private Throwable _e;
+
+ public OnError() {
+ super(Names.OnProxyError);
+ }
+
+ public OnError(String info, Throwable e) {
+ super(Names.OnProxyError);
+ this._info = info;
+ this._e = e;
+ }
+
+ public String getInfo() {
+ return _info;
+ }
+
+ public Throwable getThrowable() {
+ return _e;
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/callbacks/OnProxyClosed.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/callbacks/OnProxyClosed.java new file mode 100644 index 000000000..6712e242f --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/callbacks/OnProxyClosed.java @@ -0,0 +1,27 @@ +package com.ford.syncV4.proxy.callbacks;
+
+import com.ford.syncV4.proxy.constants.Names;
+
+public class OnProxyClosed extends InternalProxyMessage {
+
+ private String _info;
+ private Exception _e;
+
+ public OnProxyClosed() {
+ super(Names.OnProxyClosed);
+ }
+
+ public OnProxyClosed(String info, Exception e) {
+ super(Names.OnProxyClosed);
+ this._info = info;
+ this._e = e;
+ }
+
+ public String getInfo() {
+ return _info;
+ }
+
+ public Exception getException() {
+ return _e;
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/callbacks/OnProxyOpened.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/callbacks/OnProxyOpened.java new file mode 100644 index 000000000..6e3c9cac0 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/callbacks/OnProxyOpened.java @@ -0,0 +1,10 @@ +package com.ford.syncV4.proxy.callbacks;
+
+import com.ford.syncV4.proxy.constants.Names;
+
+public class OnProxyOpened extends InternalProxyMessage {
+
+ public OnProxyOpened() {
+ super(Names.OnProxyOpened);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/constants/Jingles.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/constants/Jingles.java new file mode 100644 index 000000000..903dcdcf7 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/constants/Jingles.java @@ -0,0 +1,14 @@ +package com.ford.syncV4.proxy.constants;
+
+public class Jingles {
+ public static final String POSITIVE_JINGLE = "POSITIVE_JINGLE";
+
+ public static final String NEGATIVE_JINGLE = "NEGATIVE_JINGLE";
+
+ public static final String INITIAL_JINGLE = "INITIAL_JINGLE";
+
+ public static final String LISTEN_JINGLE = "LISTEN_JINGLE";
+
+ public static final String HELP_JINGLE = "HELP_JINGLE";
+
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/constants/Names.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/constants/Names.java new file mode 100644 index 000000000..b59d9561e --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/constants/Names.java @@ -0,0 +1,463 @@ +package com.ford.syncV4.proxy.constants;
+
+public class Names {
+ public static final String request = "request";
+ public static final String response = "response";
+ public static final String notification = "notification";
+ public static final String function_name = "name";
+ public static final String parameters = "parameters";
+ public static final String bulkData = "bulkData";
+
+ public static final String RegisterAppInterface = "RegisterAppInterface";
+ public static final String UnregisterAppInterface = "UnregisterAppInterface";
+ public static final String Alert = "Alert";
+ public static final String Show = "Show";
+ public static final String Speak = "Speak";
+ public static final String AddCommand = "AddCommand";
+ public static final String DeleteCommand = "DeleteCommand";
+ public static final String AddSubMenu = "AddSubMenu";
+ public static final String DeleteSubMenu = "DeleteSubMenu";
+ public static final String CreateInteractionChoiceSet = "CreateInteractionChoiceSet";
+ public static final String DeleteInteractionChoiceSet = "DeleteInteractionChoiceSet";
+ public static final String PerformInteraction = "PerformInteraction";
+ public static final String EncodedSyncPData = "EncodedSyncPData";
+ public static final String SyncPData = "SyncPData";
+ public static final String SubscribeButton = "SubscribeButton";
+ public static final String UnsubscribeButton = "UnsubscribeButton";
+ public static final String SubscribeVehicleData = "SubscribeVehicleData";
+ public static final String UnsubscribeVehicleData = "UnsubscribeVehicleData";
+ public static final String SetMediaClockTimer = "SetMediaClockTimer";
+ public static final String SetGlobalProperties = "SetGlobalProperties";
+ public static final String GenericResponse = "GenericResponse";
+ public static final String ScrollableMessage = "ScrollableMessage";
+ public static final String GetDID = "GetDID";
+ public static final String GetDTCs = "GetDTCs";
+ public static final String ReadDID = "ReadDID";
+ public static final String OnVehicleData = "OnVehicleData";
+ public static final String GetFile = "GetFile";
+ public static final String PutFile = "PutFile";
+ public static final String DeleteFile = "DeleteFile";
+ public static final String ListFiles = "ListFiles";
+ public static final String EndAudioCapture = "EndAudioCapture";
+ public static final String GetVehicleData = "GetVehicleData";
+ public static final String ResetGlobalProperties = "ResetGlobalProperties";
+ public static final String PerformAudioCapture = "PerformAudioCapture";
+ public static final String SetAppIcon = "SetAppIcon";
+ public static final String ChangeRegistration = "ChangeRegistration";
+ public static final String SetDisplayLayout = "SetDisplayLayout";
+ public static final String OnLanguageChange = "OnLanguageChange";
+ public static final String hmiDisplayLanguage = "hmiDisplayLanguage";
+ public static final String displayLayout = "displayLayout";
+ public static final String ttsName = "ttsName";
+ public static final String hmiDisplayLanguageDesired = "hmiDisplayLanguageDesired";
+ public static final String appHMIType = "appHMIType";
+ public static final String appID = "appID";
+ public static final String vrHelpTitle = "vrHelpTitle";
+ public static final String graphic = "graphic";
+ public static final String customPresets = "customPresets";
+ public static final String softButtonCapabilities = "softButtonCapabilities";
+ public static final String presetBankCapabilities = "presetBankCapabilities";
+ public static final String vehicleType = "vehicleType";
+ public static final String make = "make";
+ public static final String model = "model";
+ public static final String modelYear = "modelYear";
+ public static final String trim = "trim";
+ public static final String allowed = "allowed";
+ public static final String userDisallowed = "userDisallowed";
+ public static final String rpcName = "rpcName";
+ public static final String hmiPermissions = "hmiPermissions";
+ public static final String parameterPermissions = "parameterPermissions";
+ public static final String permissionItem = "permissionItem";
+ public static final String numTicks = "numTicks";
+ public static final String sliderHeader = "sliderHeader";
+ public static final String sliderFooter = "sliderFooter";
+ public static final String PerformAudioPassThru = "PerformAudioPassThru";
+ public static final String PerformAudioPassThruResponse = "PerformAudioPassThruResponse";
+ public static final String EndAudioPassThru = "EndAudioPassThru";
+ public static final String EndAudioPassThruResponse = "EndAudioPassThruResponse";
+ public static final String OnAudioPassThru = "OnAudioPassThru";
+ public static final String ShowConstantTBT = "ShowConstantTBT";
+ public static final String AlertManeuver = "AlertManeuver";
+ public static final String UpdateTurnList = "UpdateTurnList";
+
+ public static final String OnCommand = "OnCommand";
+ public static final String OnDataPublished = "OnDataPublished";
+ public static final String OnButtonPress = "OnButtonPress";
+ public static final String OnButtonEvent = "OnButtonEvent";
+ public static final String OnHMIStatus = "OnHMIStatus";
+ public static final String OnTBTClientState = "OnTBTClientState";
+ public static final String OnEncodedSyncPData = "OnEncodedSyncPData";
+ public static final String OnSyncPData = "OnSyncPData";
+ public static final String OnDriverDistraction = "OnDriverDistraction";
+ public static final String OnAppInterfaceUnregistered = "OnAppInterfaceUnregistered";
+ public static final String OnProxyClosed = "OnProxyClosed";
+ public static final String OnProxyError = "OnProxyError";
+ public static final String OnProxyOpened = "OnProxyOpened";
+ public static final String OnProxyUnusable = "OnProxyUnusable";
+ public static final String OnHMILevelChange = "OnHMILevelChange";
+ public static final String OnSyncChoiceChosen = "OnSyncChoiceChosen";
+ public static final String OnPermissionsChange = "OnPermissionsChange";
+ public static final String OnScreenPresetsAvailable = "OnScreenPresetsAvailable";
+ public static final String isHighlighted = "isHighlighted";
+ public static final String softButtonID = "softButtonID";
+ public static final String fileType = "fileType";
+ public static final String persistentFile = "persistentFile";
+ public static final String spaceAvailable = "spaceAvailable";
+ public static final String filenames = "filenames";
+ public static final String cmdIcon = "cmdIcon";
+ public static final String Slider = "Slider";
+ public static final String sliderPosition = "sliderPosition";
+ public static final String samplingRate = "samplingRate";
+ public static final String audioType = "audioType";
+ public static final String satRadioESN = "satRadioESN";
+ public static final String dtcList = "dtcList";
+ public static final String tryAgainTime = "tryAgainTime";
+
+ public static final String success = "success";
+ public static final String resultCode = "resultCode";
+ public static final String info = "info";
+ public static final String event = "event";
+
+ public static final String fordURL = "fordURL";
+ public static final String payload = "payload";
+ public static final String reason = "reason";
+ public static final String state = "state";
+ public static final String cmdID = "cmdID";
+ public static final String menuParams = "menuParams";
+ public static final String parentID = "parentID";
+ public static final String position = "position";
+ public static final String menuName = "menuName";
+ public static final String vrCommands = "vrCommands";
+ public static final String language = "language";
+ public static final String languageDesired = "languageDesired";
+ public static final String triggerSource = "triggerSource";
+ public static final String subscriptionType = "subscriptionType";
+ public static final String data = "data";
+ public static final String correlationID = "correlationID";
+ public static final String syncMsgVersion = "syncMsgVersion";
+ public static final String majorVersion = "majorVersion";
+ public static final String minorVersion = "minorVersion";
+ public static final String appName = "appName";
+ public static final String ngnMediaScreenAppName = "ngnMediaScreenAppName";
+ public static final String isMediaApplication = "isMediaApplication";
+ public static final String vrSynonyms = "vrSynonyms";
+ public static final String usesVehicleData = "usesVehicleData";
+ public static final String text = "text";
+ public static final String type = "type";
+ public static final String ttsChunks = "ttsChunks";
+ public static final String playTone = "playTone";
+ public static final String duration = "duration";
+ public static final String mainField1 = "mainField1";
+ public static final String mainField2 = "mainField2";
+ public static final String mainField3 = "mainField3";
+ public static final String mainField4 = "mainField4";
+ public static final String statusBar = "statusBar";
+ public static final String name = "name";
+ public static final String menuID = "menuID";
+ public static final String longPress = "longPress";
+ public static final String shortPress = "shortPress";
+ public static final String buttonName = "buttonName";
+ public static final String buttonPressMode = "buttonPressMode";
+ public static final String buttonEventMode = "buttonEventMode";
+ public static final String minutes = "minutes";
+ public static final String seconds = "seconds";
+ public static final String startTime = "startTime";
+ public static final String updateMode = "updateMode";
+ public static final String mediaClock = "mediaClock";
+ public static final String initialText = "initialText";
+ public static final String initialPrompt = "initialPrompt";
+ public static final String helpPrompt = "helpPrompt";
+ public static final String timeoutPrompt = "timeoutPrompt";
+ public static final String timeout = "timeout";
+ public static final String choiceSet = "choiceSet";
+ public static final String interactionMode = "interactionMode";
+ public static final String interactionLayout = "interactionLayout";
+ public static final String result = "result";
+ public static final String alertText1 = "alertText1";
+ public static final String alertText2 = "alertText2";
+ public static final String alertText3 = "alertText3";
+ public static final String shortPressAvailable = "shortPressAvailable";
+ public static final String longPressAvailable = "longPressAvailable";
+ public static final String upDownAvailable = "upDownAvailable";
+ public static final String width = "width";
+ public static final String height = "height";
+ public static final String characterSet = "characterSet";
+ public static final String displayType = "displayType";
+ public static final String mediaClockFormats = "mediaClockFormats";
+ public static final String textFields = "textFields";
+ public static final String autoActivateID = "autoActivateID";
+ public static final String vehicleDataCapabilities = "vehicleDataCapabilities";
+ public static final String speechCapabilities = "speechCapabilities";
+ public static final String vrCapabilities = "vrCapabilities";
+ public static final String buttonCapabilities = "buttonCapabilities";
+ public static final String displayCapabilities = "displayCapabilities";
+ public static final String hmiZoneCapabilities = "hmiZoneCapabilities";
+ public static final String interactionChoiceSetID = "interactionChoiceSetID";
+ public static final String interactionChoiceSetIDList = "interactionChoiceSetIDList";
+ public static final String audioFileName = "audioFileName";
+ public static final String gpsPositionValid = "gpsPositionValid";
+ public static final String longitudeDegrees = "longitudeDegrees";
+ public static final String latitudeDegrees = "latitudeDegrees";
+ public static final String utcYear = "utcYear";
+ public static final String utcMonth = "utcMonth";
+ public static final String utcDay = "utcDay";
+ public static final String utcHours = "utcHours";
+ public static final String utcMinutes = "utcMinutes";
+ public static final String utcSeconds = "utcSeconds";
+ public static final String compassDirection = "compassDirection";
+ public static final String pdop = "pdop";
+ public static final String vdop = "vdop";
+ public static final String hdop = "hdop";
+ public static final String actual = "actual";
+ public static final String satellites = "satellites";
+ public static final String dimension = "dimension";
+ public static final String altitude = "altitude";
+ public static final String heading = "heading";
+ public static final String speed = "speed";
+ public static final String syncFileName = "syncFileName";
+ public static final String localFileName = "localFileName";
+ public static final String maxDuration = "maxDuration";
+ public static final String timerMode = "timerMode";
+ public static final String status = "status";
+ public static final String pressure = "pressure";
+ public static final String hours = "hours";
+ public static final String rows = "rows";
+ public static final String pressureTelltale = "pressureTelltale";
+ public static final String leftFront = "leftFront";
+ public static final String rightFront = "rightFront";
+ public static final String leftRear = "leftRear";
+ public static final String rightRear = "rightRear";
+ public static final String innerLeftRear = "innerLeftRear";
+ public static final String innerRightRear = "innerRightRear";
+ public static final String VehicleData = "VehicleData";
+ public static final String alignment = "alignment";
+ public static final String mediaTrack = "mediaTrack";
+ public static final String properties = "properties";
+ public static final String choiceID = "choiceID";
+ public static final String bitsPerSample = "bitsPerSample";
+ public static final String hmiLevel = "hmiLevel";
+ public static final String audioStreamingState = "audioStreamingState";
+ public static final String systemContext = "systemContext";
+ public static final String syncChoice = "syncChoice";
+ public static final String syncCommand = "syncCommand";
+ public static final String URL = "URL";
+ public static final String Timeout = "Timeout";
+ public static final String PermissionGroupName = "PermissionGroupName";
+ public static final String PermissionGroupStatus = "PermissionGroupStatus";
+ public static final String PermissionGroupItems = "PermissionGroupItems";
+ public static final String audioPacket = "audioPacket";
+ public static final String audioPassThruDisplayText1 = "audioPassThruDisplayText1";
+ public static final String audioPassThruDisplayText2 = "audioPassThruDisplayText2";
+ public static final String bitRate = "bitRate";
+ public static final String rpm = "rpm";
+ public static final String fuelLevel = "fuelLevel";
+ public static final String avgFuelEconomy = "avgFuelEconomy";
+ public static final String batteryVoltage = "batteryVoltage";
+ public static final String externalTemperature = "externalTemperature";
+ public static final String vin = "vin";
+ public static final String prndl = "prndl";
+ public static final String tirePressure = "tirePressure";
+ public static final String batteryPackVoltage = "batteryPackVoltage";
+ public static final String batteryPackCurrent = "batteryPackCurrent";
+ public static final String batteryPackTemperature = "batteryPackTemperature";
+ public static final String engineTorque = "engineTorque";
+ public static final String odometer = "odometer";
+ public static final String tripOdometer = "tripOdometer";
+ public static final String genericbinary = "genericbinary";
+ public static final String GPSData = "GPSData";
+ public static final String gps = "gps";
+ public static final String fuelLevel_State = "fuelLevel_State";
+ public static final String instantFuelConsumption = "instantFuelConsumption";
+ public static final String beltStatus = "beltStatus";
+ public static final String bodyInformation = "bodyInformation";
+ public static final String deviceStatus = "deviceStatus";
+ public static final String driverBraking = "driverBraking";
+ public static final String wiperStatus = "wiperStatus";
+ public static final String fuelEconomy = "fuelEconomy";
+ public static final String engineOilLife = "engineOilLife";
+ public static final String headLampStatus = "headLampStatus";
+ public static final String brakeTorque = "brakeTorque";
+ public static final String turboBoost = "turboBoost";
+ public static final String coolantTemp = "coolantTemp";
+ public static final String airFuelRatio = "airFuelRatio";
+ public static final String coolingHeadTemp = "coolingHeadTemp";
+ public static final String oilTemp = "oilTemp";
+ public static final String intakeAirTemp = "intakeAirTemp";
+ public static final String gearShiftAdvice = "gearShiftAdvice";
+ public static final String acceleration = "acceleration";
+ public static final String accPedalPosition = "accPedalPosition";
+ public static final String steeringWheelAngle = "steeringWheelAngle";
+ public static final String clutchPedalPosition = "clutchPedalPosition";
+ public static final String reverseGearStatus = "reverseGearStatus";
+ public static final String accTorque = "accTorque";
+ public static final String evInfo = "evInfo";
+ public static final String ambientLightStatus = "ambientLightStatus";
+ public static final String eCallInfo = "eCallInfo";
+ public static final String airbagStatus = "airbagStatus";
+ public static final String emergencyEvent = "emergencyEvent";
+ public static final String clusterModeStatus = "clusterModeStatus";
+ public static final String myKey = "myKey";
+ public static final String dataType = "dataType";
+ public static final String identifier = "identifier";
+ public static final String statusByte = "statusByte";
+ public static final String dataResult = "dataResult";
+ public static final String ecuName = "ecuName";
+ public static final String didLocation = "didLocation";
+ public static final String value = "value";
+ public static final String softButtonName = "softButtonName";
+ public static final String imageSupported = "imageSupported";
+ public static final String systemAction = "systemAction";
+ public static final String image = "image";
+ public static final String imageType = "imageType";
+ public static final String fileData = "fileData";
+ public static final String scrollableMessageBody = "scrollableMessageBody";
+ public static final String softButtons = "softButtons";
+ public static final String customButtonID = "customButtonID";
+ public static final String vrHelp = "vrHelp";
+ public static final String customButtonName = "customButtonName";
+ public static final String navigationText = "navigationText";
+ public static final String turnIcon = "turnIcon";
+ public static final String nextTurnIcon = "nextTurnIcon";
+ public static final String navigationText1 = "navigationText1";
+ public static final String navigationText2 = "navigationText2";
+ public static final String eta = "eta";
+ public static final String timeToDestination = "timeToDestination";
+ public static final String totalDistance = "totalDistance";
+ public static final String distanceToManeuver = "distanceToManeuver";
+ public static final String distanceToManeuverScale = "distanceToManeuverScale";
+ public static final String maneuverComplete = "maneuverComplete";
+ public static final String turnList = "turnList";
+
+ public static final String driverBeltDeployed = "driverBeltDeployed";
+ public static final String passengerBeltDeployed = "passengerBeltDeployed";
+ public static final String passengerBuckleBelted = "passengerBuckleBelted";
+ public static final String driverBuckleBelted = "driverBuckleBelted";
+ public static final String leftRow2BuckleBelted = "leftRow2BuckleBelted";
+ public static final String passengerChildDetected = "passengerChildDetected";
+ public static final String rightRow2BuckleBelted = "rightRow2BuckleBelted";
+ public static final String middleRow2BuckleBelted = "middleRow2BuckleBelted";
+ public static final String middleRow3BuckleBelted = "middleRow3BuckleBelted";
+ public static final String leftRow3BuckleBelted = "leftRow3BuckleBelted";
+ public static final String rightRow3BuckleBelted = "rightRow3BuckleBelted";
+ public static final String rearInflatableBelted = "rearInflatableBelted";
+ public static final String leftRearInflatableBelted = "leftRearInflatableBelted";
+ public static final String rightRearInflatableBelted = "rightRearInflatableBelted";
+ public static final String middleRow1BeltDeployed = "middleRow1BeltDeployed";
+ public static final String middleRow1BuckleBelted = "middleRow1BuckleBelted";
+
+ public static final String eCallNotificationStatus = "eCallNotificationStatus";
+ public static final String auxECallNotificationStatus = "auxECallNotificationStatus";
+ public static final String eCallConfirmationStatus = "eCallConfirmationStatus";
+
+ public static final String driverAirbagDeployed = "driverAirbagDeployed";
+ public static final String driverSideAirbagDeployed = "driverSideAirbagDeployed";
+ public static final String driverCurtainAirbagDeployed = "driverCurtainAirbagDeployed";
+ public static final String passengerAirbagDeployed = "passengerAirbagDeployed";
+ public static final String passengerCurtainAirbagDeployed = "passengerCurtainAirbagDeployed";
+ public static final String driverKneeAirbagDeployed = "driverKneeAirbagDeployed";
+ public static final String passengerSideAirbagDeployed = "passengerSideAirbagDeployed";
+ public static final String passengerKneeAirbagDeployed = "passengerKneeAirbagDeployed";
+
+ public static final String emergencyEventType = "emergencyEventType";
+ public static final String fuelCutoffStatus = "fuelCutoffStatus";
+ public static final String rolloverEvent = "rolloverEvent";
+ public static final String maximumChangeVelocity = "maximumChangeVelocity";
+ public static final String multipleEvents = "multipleEvents";
+
+ public static final String powerModeActive = "powerModeActive";
+ public static final String powerModeQualificationStatus = "powerModeQualificationStatus";
+ public static final String carModeStatus = "carModeStatus";
+ public static final String powerModeStatus = "powerModeStatus";
+
+ public static final String muteAudio = "muteAudio";
+
+ public static final String parkBrakeActive = "parkBrakeActive";
+ public static final String ignitionStableStatus = "ignitionStableStatus";
+ public static final String ignitionStatus = "ignitionStatus";
+
+ public static final String e911Override = "e911Override";
+
+ public static final String dtcMask = "dtcMask";
+
+ public static final String voiceRecOn = "voiceRecOn";
+ public static final String btIconOn = "btIconOn";
+ public static final String callActive = "callActive";
+ public static final String phoneRoaming = "phoneRoaming";
+ public static final String textMsgAvailable = "textMsgAvailable";
+ public static final String battLevelStatus = "battLevelStatus";
+ public static final String stereoAudioOutputMuted = "stereoAudioOutputMuted";
+ public static final String monoAudioOutputMuted = "monoAudioOutputMuted";
+ public static final String signalLevelStatus = "signalLevelStatus";
+ public static final String primaryAudioSource = "primaryAudioSource";
+ public static final String eCallEventActive = "eCallEventActive";
+
+ public static final String fuelEconomySinceLastReset = "fuelEconomySinceLastReset";
+ public static final String currentTripFuelEconomy = "currentTripFuelEconomy";
+ public static final String averageTripFuelEconomy = "averageTripFuelEconomy";
+ public static final String currentCycleFuelEconomy = "currentCycleFuelEconomy";
+
+ public static final String ambientLightSensorStatus = "ambientLightSensorStatus";
+ public static final String highBeamsOn = "highBeamsOn";
+ public static final String lowBeamsOn = "lowBeamsOn";
+
+ public static final String electricFuelConsumption = "electricFuelConsumption";
+ public static final String stateOfCharge = "stateOfCharge";
+ public static final String fuelMaintenanceMode = "fuelMaintenanceMode";
+ public static final String distanceToEmpty = "distanceToEmpty";
+
+ public static final String id = "id";
+ public static final String c = "c";
+ public static final String ts = "ts";
+ public static final String x = "x";
+ public static final String y = "y";
+ public static final String pressAvailable = "pressAvailable";
+ public static final String multiTouchAvailable = "multiTouchAvailable";
+ public static final String doublePressAvailable = "doublePressAvailable";
+ public static final String resolution = "resolution";
+ public static final String touchEventAvailable = "touchEventAvailable";
+ public static final String templatesAvailable = "templatesAvailable";
+ public static final String screenParams = "screenParams";
+ public static final String OnTouchEvent = "OnTouchEvent";
+ public static final String secondaryImage = "secondaryImage";
+ public static final String resolutionWidth = "resolutionWidth";
+ public static final String resolutionHeight = "resolutionHeight";
+ public static final String keyboardEvent = "event";
+ public static final String OnKeyboardInput = "OnKeyboardInput";
+ public static final String manualTextEntry = "manualTextEntry";
+ public static final String keyboardLayout = "keyboardLayout";
+
+ public static final String limitedCharacterList = "limitedCharacterList";
+ public static final String autoCompleteText = "autoCompleteText";
+ public static final String menuTitle = "menuTitle";
+ public static final String menuIcon = "menuIcon";
+ public static final String keyboardProperties = "keyboardProperties";
+ public static final String secondaryText = "secondaryText";
+ public static String tertiaryText = "tertiaryText";
+ public static final String keypressMode = "keypressMode";
+ public static final String progressIndicator = "progressIndicator";
+ public static final String systemFile = "systemFile";
+ public static final String offset = "offset";
+ public static final String length = "length";
+ public static final String SystemRequest = "SystemRequest";
+ public static final String OnSystemRequest = "OnSystemRequest";
+ public static final String requestType = "requestType";
+ public static final String url = "url";
+ public static final String imageTypeSupported = "imageTypeSupported";
+ public static final String imageResolution = "imageResolution";
+ public static final String imageFields = "imageFields";
+ public static final String graphicSupported = "graphicSupported";
+ public static final String numCustomPresetsAvailable = "numCustomPresetsAvailable";
+ public static final String prerecordedSpeech = "prerecordedSpeech";
+ public static final String endTime = "endTime";
+ public static final String didResult = "didResult";
+ public static final String secondaryGraphic = "secondaryGraphic";
+ public static final String audioPassThruCapabilities = "audioPassThruCapabilities";
+ public static final String supportedDiagModes = "supportedDiagModes";
+ public static final String DiagnosticMessage = "DiagnosticMessage";
+ public static final String targetID = "targetID";
+ public static final String messageLength = "messageLength";
+ public static final String messageData = "messageData";
+ public static final String messageDataResult = "messageDataResult";
+ public static final String hashID = "hashID";
+ public static final String OnHashChange = "OnHashChange";
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/DefaultRPCRequestConverter.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/DefaultRPCRequestConverter.java new file mode 100644 index 000000000..91312c5ff --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/DefaultRPCRequestConverter.java @@ -0,0 +1,45 @@ +package com.ford.syncV4.proxy.converter; + +import com.ford.syncV4.marshal.IJsonRPCMarshaller; +import com.ford.syncV4.protocol.ProtocolMessage; +import com.ford.syncV4.protocol.enums.FunctionID; +import com.ford.syncV4.protocol.enums.MessageType; +import com.ford.syncV4.protocol.enums.ServiceType; +import com.ford.syncV4.proxy.RPCRequest; + +import java.util.ArrayList; +import java.util.List; + +/** + * A default converter that maps one RPCRequest into one ProtocolMessage. + * Extracted from SyncProxyBase. + * + * Created by enikolsky on 2014-01-20. + */ +public class DefaultRPCRequestConverter implements IRPCRequestConverter { + @Override + public List<ProtocolMessage> getProtocolMessages(RPCRequest request, + byte sessionID, + IJsonRPCMarshaller marshaller, + byte protocolVersion) { + byte[] msgBytes = marshaller.marshall(request, protocolVersion); + + ProtocolMessage pm = new ProtocolMessage(); + pm.setVersion(protocolVersion); + pm.setData(msgBytes); + pm.setSessionID(sessionID); + pm.setMessageType(MessageType.RPC); + pm.setSessionType(ServiceType.RPC); + pm.setFunctionID(FunctionID.getFunctionID(request.getFunctionName())); + pm.setCorrID(request.getCorrelationID()); + if (request.getBulkData() != null) { + pm.setBulkData(request.getBulkData()); + } + + List<ProtocolMessage> res = new ArrayList<ProtocolMessage>(1); + res.add(pm); + return res; + } + + +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/IRPCRequestConverter.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/IRPCRequestConverter.java new file mode 100644 index 000000000..3b18c3407 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/IRPCRequestConverter.java @@ -0,0 +1,31 @@ +package com.ford.syncV4.proxy.converter; + +import com.ford.syncV4.marshal.IJsonRPCMarshaller; +import com.ford.syncV4.protocol.ProtocolMessage; +import com.ford.syncV4.proxy.RPCRequest; + +import java.util.List; + +/** + * The interface for converters from an RPCRequest object into an appropriate + * number of ProtocolMessage objects. + * + * Created by enikolsky on 2014-01-20. + */ +public interface IRPCRequestConverter { + /** + * Converts a given RPCRequest object into a number of ProtocolMessage + * objects to send. The return list can be empty, and can't be null. + * + * @param request request to convert; must not be null + * @param sessionID RPC session ID + * @param marshaller is used to serialize the request's parameters; + * must not be null + * @param protocolVersion protocol version to serialize the parameters + * @return a list of protocol messages; can't be null + */ + public List<ProtocolMessage> getProtocolMessages(RPCRequest request, + byte sessionID, + IJsonRPCMarshaller marshaller, + byte protocolVersion); +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/IRPCRequestConverterFactory.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/IRPCRequestConverterFactory.java new file mode 100644 index 000000000..7131f55e9 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/IRPCRequestConverterFactory.java @@ -0,0 +1,20 @@ +package com.ford.syncV4.proxy.converter; + +import com.ford.syncV4.proxy.RPCRequest; + +/** + * The interface for factories that can create IRPCRequestConverter objects. + * + * Created by enikolsky on 2014-01-20. + */ +public interface IRPCRequestConverterFactory { + /** + * Returns a suitable converter for the given RPCRequest object. Since they + * should be stateless, the implementation caches them between calls. + * + * @param request RPCRequest to convert; must not be null + * @return a converter for the request, or a default one in case of an error + * (e.g., the request is invalid) + */ + public IRPCRequestConverter getConverterForRequest(RPCRequest request); +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/SyncRPCRequestConverterFactory.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/SyncRPCRequestConverterFactory.java new file mode 100644 index 000000000..df0abea18 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/SyncRPCRequestConverterFactory.java @@ -0,0 +1,49 @@ +package com.ford.syncV4.proxy.converter; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.PutFile; + +/** + * The default Sync factory. + * + * Created by enikolsky on 2014-01-20. + */ +public class SyncRPCRequestConverterFactory + implements IRPCRequestConverterFactory { + private IRPCRequestConverter defaultConverter; + private IRPCRequestConverter systemPutFileConverter; + + @Override + public IRPCRequestConverter getConverterForRequest(RPCRequest request) { + IRPCRequestConverter converter = getDefaultConverter(); + + final String functionName = request.getFunctionName(); + + if (Names.PutFile.equals(functionName)) { + PutFile putFile = (PutFile) request; + final Boolean isSystemFile = putFile.getSystemFile(); + if ((isSystemFile != null) && isSystemFile) { + converter = getSystemPutFileConverter(); + } + } + + return converter; + } + + private IRPCRequestConverter getDefaultConverter() { + if (defaultConverter == null) { + defaultConverter = new DefaultRPCRequestConverter(); + } + + return defaultConverter; + } + + private IRPCRequestConverter getSystemPutFileConverter() { + if (systemPutFileConverter == null) { + systemPutFileConverter = new SystemPutFileRPCRequestConverter(); + } + + return systemPutFileConverter; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/SystemPutFileRPCRequestConverter.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/SystemPutFileRPCRequestConverter.java new file mode 100644 index 000000000..8d27330b6 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/converter/SystemPutFileRPCRequestConverter.java @@ -0,0 +1,105 @@ +package com.ford.syncV4.proxy.converter; + +import com.ford.syncV4.marshal.IJsonRPCMarshaller; +import com.ford.syncV4.protocol.ProtocolMessage; +import com.ford.syncV4.protocol.enums.FunctionID; +import com.ford.syncV4.protocol.enums.MessageType; +import com.ford.syncV4.protocol.enums.ServiceType; +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.rpc.PutFile; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * A converter for the PutFile request for system files which splits it into + * ProtocolMessage objects by maximum size. This is done to allow the SDK to + * continue transferring big files after errors. + * + * Created by enikolsky on 2014-01-21. + */ +public class SystemPutFileRPCRequestConverter implements IRPCRequestConverter { + /** + * Maximum number of bulk data bytes to fit into each ProtocolMessage. + */ + private int maxDataSize = 100000; + + @Override + public List<ProtocolMessage> getProtocolMessages(RPCRequest request, + byte sessionID, + IJsonRPCMarshaller marshaller, + byte protocolVersion) { + List<ProtocolMessage> res = new ArrayList<ProtocolMessage>(); + + if (request instanceof PutFile) { + final byte[] bulkData = request.getBulkData(); + if (null != bulkData) { + final int frameCount = + (int) Math.ceil(bulkData.length * 1.0 / maxDataSize); + + final PutFile putFile = (PutFile) request; + final Integer offset = putFile.getOffset(); + final int baseOffset = (offset != null) ? offset : 0; + + PutFile tempMsg = copyRequest(putFile); + for (int i = 0; i < frameCount; ++i) { + final int start = i * maxDataSize; + final int end = + Math.min((i + 1) * maxDataSize, bulkData.length); + final byte[] bulkDataRange = + Arrays.copyOfRange(bulkData, start, end); + tempMsg.setOffset(baseOffset + start); + tempMsg.setLength(end - start); + tempMsg.setSystemFile(true); + ProtocolMessage pm = + createProtocolMessage(tempMsg, sessionID, + protocolVersion, bulkDataRange, marshaller); + + res.add(pm); + } + } else { + // create one message without bulk data + ProtocolMessage pm = createProtocolMessage(request, sessionID, + protocolVersion, null, marshaller); + + res.add(pm); + } + } + + return res; + } + + private PutFile copyRequest(PutFile request) { + return new PutFile(request); + } + + private ProtocolMessage createProtocolMessage(RPCRequest request, + byte sessionID, + byte protocolVersion, + byte[] bulkData, + IJsonRPCMarshaller marshaller) { + ProtocolMessage pm = new ProtocolMessage(); + pm.setVersion(protocolVersion); + byte[] msgBytes = marshaller.marshall(request, protocolVersion); + pm.setData(msgBytes); + pm.setSessionID(sessionID); + pm.setMessageType(MessageType.RPC); + pm.setSessionType(ServiceType.RPC); + pm.setFunctionID(FunctionID.getFunctionID(request.getFunctionName())); + pm.setCorrID(request.getCorrelationID()); + if (null != bulkData) { + pm.setBulkData(bulkData); + } + + return pm; + } + + public int getMaxDataSize() { + return maxDataSize; + } + + public void setMaxDataSize(int maxDataSize) { + this.maxDataSize = maxDataSize; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/IProxyListenerALM.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/IProxyListenerALM.java new file mode 100644 index 000000000..5bc0d8e5e --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/IProxyListenerALM.java @@ -0,0 +1,48 @@ +package com.ford.syncV4.proxy.interfaces;
+
+public interface IProxyListenerALM extends IProxyListenerBase {
+ // Adds Advanced Life-cycle Management call-backs to the IProxyListenerAbstract interface
+
+ /**
+ * **MOVED TO IProxyListenerBase** - onOnHMIStatus() being called indicates that the proxy has entered a state in which the
+ * application may create SYNC related resources (addCommands, ChoiceSets).
+ */
+ //public void onOnHMIStatus(OnHMIStatus notification);
+
+ /**
+ * **MOVED TO IProxyListenerBase** - onProxyClosed() being called indicates that the app is no longer registered with SYNC
+ * All resources on SYNC (addCommands and ChoiceSets) have been deleted and will have to be
+ * recreated upon the next onReadyForInitialization() call-back.
+ */
+ //public void onProxyClosed(String info, Exception e);
+
+ /**
+ * **MOVED TO IProxyListenerBase** - onError() being called indicates that the proxy has experienced an unrecoverable error.
+ * A new proxy object must be initiated to reestablish connection with SYNC.
+ *
+ * @param info - Any info present about the error that occurred.
+ * @param e - Any exception thrown by the error.
+ */
+ //public void onError(String info, Exception e);
+
+ /**
+ * **Deprecated** - onSyncInterfaceAvailable() being called indicates that the proxy now has access to SYNC's HMI.
+ * Monitor the onFocusChange call-back to determine which level of HMI is available to the proxy.
+ *
+ * @param isFirstAvailability - Indicates this is the first onSyncInterfaceAvailable in this lifecycle.
+ */
+ // HMI (Background, Limited, Full) from Unavailable = onSyncInterfaceAvailable(Boolean isFirstAvailability);
+
+ /**
+ * **Deprecated** - onSyncInterfaceUnavailable() being called indicates that the proxy does NOT have access to SYNC's HIM.
+ */
+ // HMI None onSyncInterfaceUnavailable();
+
+ /**
+ * **Deprecated** - ALM HMI states converted back to HMI Levels
+ *
+ * HMI Full = onSyncInFocus(Boolean isFirstSyncInFocus);
+ * HMI Limited = onSyncInFocusLimited();
+ * HMI Background = onSyncLostFocus();
+ */
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/IProxyListenerALMTesting.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/IProxyListenerALMTesting.java new file mode 100644 index 000000000..7eafcbc2a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/IProxyListenerALMTesting.java @@ -0,0 +1,14 @@ +package com.ford.syncV4.proxy.interfaces; + +import com.ford.syncV4.proxy.rpc.RegisterAppInterfaceResponse; +import com.ford.syncV4.proxy.rpc.UnregisterAppInterfaceResponse; + +/** + * IProxyListenerALM interface extended with two callbacks for receiving + * responses to RegisterAppInterface and UnregisterAppInterface requests. + */ +public interface IProxyListenerALMTesting extends IProxyListenerALM { + public void onRegisterAppInterfaceResponse(RegisterAppInterfaceResponse response); + + public void onUnregisterAppInterfaceResponse(UnregisterAppInterfaceResponse response); +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/IProxyListenerBase.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/IProxyListenerBase.java new file mode 100644 index 000000000..273aa9b87 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/IProxyListenerBase.java @@ -0,0 +1,346 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.protocol.enums.ServiceType;
+import com.ford.syncV4.proxy.rpc.AddCommandResponse;
+import com.ford.syncV4.proxy.rpc.AddSubMenuResponse;
+import com.ford.syncV4.proxy.rpc.AlertManeuverResponse;
+import com.ford.syncV4.proxy.rpc.AlertResponse;
+import com.ford.syncV4.proxy.rpc.ChangeRegistrationResponse;
+import com.ford.syncV4.proxy.rpc.CreateInteractionChoiceSetResponse;
+import com.ford.syncV4.proxy.rpc.DeleteCommandResponse;
+import com.ford.syncV4.proxy.rpc.DeleteFileResponse;
+import com.ford.syncV4.proxy.rpc.DeleteInteractionChoiceSetResponse;
+import com.ford.syncV4.proxy.rpc.DeleteSubMenuResponse;
+import com.ford.syncV4.proxy.rpc.EncodedSyncPDataResponse;
+import com.ford.syncV4.proxy.rpc.EndAudioPassThruResponse;
+import com.ford.syncV4.proxy.rpc.GenericResponse;
+import com.ford.syncV4.proxy.rpc.GetDTCsResponse;
+import com.ford.syncV4.proxy.rpc.GetVehicleDataResponse;
+import com.ford.syncV4.proxy.rpc.ListFilesResponse;
+import com.ford.syncV4.proxy.rpc.OnAudioPassThru;
+import com.ford.syncV4.proxy.rpc.OnButtonEvent;
+import com.ford.syncV4.proxy.rpc.OnButtonPress;
+import com.ford.syncV4.proxy.rpc.OnCommand;
+import com.ford.syncV4.proxy.rpc.OnHMIStatus;
+import com.ford.syncV4.proxy.rpc.OnHashChange;
+import com.ford.syncV4.proxy.rpc.OnKeyboardInput;
+import com.ford.syncV4.proxy.rpc.OnLanguageChange;
+import com.ford.syncV4.proxy.rpc.OnPermissionsChange;
+import com.ford.syncV4.proxy.rpc.OnSystemRequest;
+import com.ford.syncV4.proxy.rpc.OnTouchEvent;
+import com.ford.syncV4.proxy.rpc.OnVehicleData;
+import com.ford.syncV4.proxy.rpc.PerformAudioPassThruResponse;
+import com.ford.syncV4.proxy.rpc.PerformInteractionResponse;
+import com.ford.syncV4.proxy.rpc.PutFileResponse;
+import com.ford.syncV4.proxy.rpc.ReadDIDResponse;
+import com.ford.syncV4.proxy.rpc.RegisterAppInterface;
+import com.ford.syncV4.proxy.rpc.ResetGlobalPropertiesResponse;
+import com.ford.syncV4.proxy.rpc.ScrollableMessageResponse;
+import com.ford.syncV4.proxy.rpc.SetAppIconResponse;
+import com.ford.syncV4.proxy.rpc.SetDisplayLayoutResponse;
+import com.ford.syncV4.proxy.rpc.SetGlobalPropertiesResponse;
+import com.ford.syncV4.proxy.rpc.SetMediaClockTimerResponse;
+import com.ford.syncV4.proxy.rpc.ShowConstantTBTResponse;
+import com.ford.syncV4.proxy.rpc.ShowResponse;
+import com.ford.syncV4.proxy.rpc.SliderResponse;
+import com.ford.syncV4.proxy.rpc.SpeakResponse;
+import com.ford.syncV4.proxy.rpc.SubscribeButtonResponse;
+import com.ford.syncV4.proxy.rpc.SubscribeVehicleDataResponse;
+import com.ford.syncV4.proxy.rpc.SyncPDataResponse;
+import com.ford.syncV4.proxy.rpc.SystemRequestResponse;
+import com.ford.syncV4.proxy.rpc.UnsubscribeButtonResponse;
+import com.ford.syncV4.proxy.rpc.UnsubscribeVehicleDataResponse;
+import com.ford.syncV4.proxy.rpc.UpdateTurnListResponse;
+import com.ford.syncV4.proxy.rpc.enums.AppInterfaceUnregisteredReason;
+
+
+public interface IProxyListenerBase extends ISyncDriverDistractionListener,
+ ISyncEncodedSyncPDataListener,
+ ISyncSyncPDataListener,
+ ISyncTBTClientStateListener {
+
+ /**
+ * onOnHMIStatus being called indicates that there has been an HMI Level change,
+ * system context change or audio streaming state change.
+ *
+ * @param notification - Contains information about the HMI Level,
+ * system context and audio streaming state.
+ */
+ public void onOnHMIStatus(OnHMIStatus notification);
+
+ /**
+ * onProxyClosed has different functionality for the different models.
+ * In the non-ALM model this indicates that the proxy has experienced an unrecoverable error.
+ * A new proxy object must be initiated to reestablish connection with SYNC.
+ * In the ALM model this indicates that the app is no longer registered with SYNC
+ * All resources on SYNC (addCommands and ChoiceSets) have been deleted and will have to be
+ * recreated upon the next onReadyForInitialization() call-back.
+ *
+ * @param info - Includes information about the reason the proxy has been closed.
+ * @param e - The exception that occurred.
+ */
+ public void onProxyClosed(String info, Exception e);
+
+ /**
+ * onProxyError() being called indicates that the SYNC Proxy experenced an error.
+ *
+ * @param info - Includes information about the Exception that occurred.
+ * @param e - The exception that occurred.
+ */
+ public void onError(String info, Throwable e);
+
+
+ /**
+ * onGenericResponse() being called indicates that SYNC could not determine the
+ * type of request it is responding to. This is usually result of an unknown RPC Request
+ * being sent.
+ *
+ * @param response - Includes detailed information about the response.
+ */
+ public void onGenericResponse(GenericResponse response);
+
+ /**
+ * onOnCommand() being called indicates that the user selected a command on SYNC.
+ *
+ * @param notification - Contains information about the command chosen.
+ */
+ public void onOnCommand(OnCommand notification);
+
+ /**
+ * onAddCommandResponse() being called indicates that SYNC has responded to
+ * a request to add a command.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onAddCommandResponse(AddCommandResponse response);
+
+ /**
+ * onAddSubMenuResponse() being called indicates that SYNC has responded to
+ * a request to add a command.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onAddSubMenuResponse(AddSubMenuResponse response);
+
+ /**
+ * onCreateInteractionChoiceSetResponse() being called indicates that SYNC has
+ * responded to a request to add an interactionChoiceSet.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onCreateInteractionChoiceSetResponse(CreateInteractionChoiceSetResponse response);
+
+ /**
+ * onAlertResponse being called indicates that SYNC has
+ * responded to a request to alert the user.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onAlertResponse(AlertResponse response);
+
+ /**
+ * onDeleteCommandResponse being called indicates that SYNC has
+ * responded to a request to delete a command.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onDeleteCommandResponse(DeleteCommandResponse response);
+
+ /**
+ * onDeleteCommandResponse being called indicates that SYNC has
+ * responded to a request to delete an interaction choice set.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onDeleteInteractionChoiceSetResponse(DeleteInteractionChoiceSetResponse response);
+
+ /**
+ * onDeleteCommandResponse being called indicates that SYNC has
+ * responded to a request to delete a submenu.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onDeleteSubMenuResponse(DeleteSubMenuResponse response);
+
+ /**
+ * onEncodedSyncPDataResponse being called indicates that SYNC has
+ * responded to a request containing encodedSyncPData.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onEncodedSyncPDataResponse(EncodedSyncPDataResponse response);
+
+ public void onSyncPDataResponse(SyncPDataResponse response);
+
+ /**
+ * onPerformInteractionResponse being called indicates that SYNC has
+ * responded to a request to perform an interaction.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onPerformInteractionResponse(PerformInteractionResponse response);
+
+ /**
+ * onResetGlobalPropertiesResponse being called indicates that SYNC has
+ * responded to a request to reset global properties.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onResetGlobalPropertiesResponse(ResetGlobalPropertiesResponse response);
+
+ /**
+ * onSetGlobalPropertiesResponse being called indicates that SYNC has
+ * responded to a request to set global properties.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onSetGlobalPropertiesResponse(SetGlobalPropertiesResponse response);
+
+ /**
+ * onSetMediaClockTimerResponse being called indicates that SYNC has
+ * responded to a request to set the media clock timer.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onSetMediaClockTimerResponse(SetMediaClockTimerResponse response);
+
+ /**
+ * onShowResponse being called indicates that SYNC has
+ * responded to a request to display information to the user.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onShowResponse(ShowResponse response);
+
+ /**
+ * onSpeakResponse being called indicates that SYNC has
+ * responded to a request to speak information to the user.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onSpeakResponse(SpeakResponse response);
+
+ /**
+ * onButtonEvent being called indicates that a button event has occurred.
+ *
+ * @param notification - Contains information about the notification sent from SYNC.
+ */
+ public void onOnButtonEvent(OnButtonEvent notification);
+
+ /**
+ * onButtonPress being called indicates that SYNC has a button has
+ * been pressed by the user.
+ *
+ * @param notification - Contains information about the notification sent from SYNC.
+ */
+ public void onOnButtonPress(OnButtonPress notification);
+
+ /**
+ * onSubscribeButtonResponse being called indicates that SYNC has
+ * responded to a request to subscribe to button events and button presses.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onSubscribeButtonResponse(SubscribeButtonResponse response);
+
+ /**
+ * onUnsubscribeButtonResponse being called indicates that SYNC has
+ * responded to a request to unsubscribe from button events and button presses.
+ *
+ * @param response - Contains information about the response sent from SYNC.
+ */
+ public void onUnsubscribeButtonResponse(UnsubscribeButtonResponse response);
+
+ /**
+ * onOnPermissionsChange being called indicates that your app permissions have
+ * changed due to a policy table change. This can mean your app has received additional
+ * permissions OR lost permissions.
+ *
+ * @param notification - Contains information about the changed permissions.
+ */
+ public void onOnPermissionsChange(OnPermissionsChange notification);
+
+ public void onSubscribeVehicleDataResponse(SubscribeVehicleDataResponse response);
+
+ public void onUnsubscribeVehicleDataResponse(UnsubscribeVehicleDataResponse response);
+
+ public void onGetVehicleDataResponse(GetVehicleDataResponse response);
+
+ public void onReadDIDResponse(ReadDIDResponse response);
+
+ public void onGetDTCsResponse(GetDTCsResponse response);
+
+ public void onOnVehicleData(OnVehicleData notification);
+
+ public void onPerformAudioPassThruResponse(PerformAudioPassThruResponse response);
+
+ public void onEndAudioPassThruResponse(EndAudioPassThruResponse response);
+
+ public void onOnAudioPassThru(OnAudioPassThru notification);
+
+ public void onPutFileResponse(PutFileResponse response);
+
+ public void onDeleteFileResponse(DeleteFileResponse response);
+
+ public void onListFilesResponse(ListFilesResponse response);
+
+ public void onSetAppIconResponse(SetAppIconResponse response);
+
+ public void onScrollableMessageResponse(ScrollableMessageResponse response);
+
+ public void onChangeRegistrationResponse(ChangeRegistrationResponse response);
+
+ public void onSetDisplayLayoutResponse(SetDisplayLayoutResponse response);
+
+ public void onOnLanguageChange(OnLanguageChange notification);
+
+ public void onSliderResponse(SliderResponse response);
+
+ public void onAlertManeuverResponse(AlertManeuverResponse response);
+
+ public void onShowConstantTBTResponse(ShowConstantTBTResponse response);
+
+ public void onUpdateTurnListResponse(UpdateTurnListResponse response);
+
+ public void onSystemRequestResponse(SystemRequestResponse response);
+
+ public void onMobileNaviStart();
+
+ public void onMobileNavAckReceived(int frameReceivedNumber);
+
+ public void onOnTouchEvent(OnTouchEvent notification);
+
+ public void onKeyboardInput(OnKeyboardInput msg);
+
+ public void onOnSystemRequest(OnSystemRequest notification);
+
+ void onRegisterAppRequest(RegisterAppInterface msg);
+
+ public void onAppUnregisteredAfterLanguageChange(OnLanguageChange msg);
+
+ public void onAppUnregisteredReason(AppInterfaceUnregisteredReason reason);
+
+ public void onProtocolServiceEnded(ServiceType serviceType, Byte version, String correlationID);
+
+ public void onSessionStarted(byte sessionID, String correlationID);
+
+ public void onAudioServiceStart();
+
+ public void onStartServiceNackReceived(ServiceType serviceType);
+
+ /**
+ * 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.
+ *
+ * @param onHashChange {@link com.ford.syncV4.proxy.rpc.OnHashChange} notification
+ */
+ public void onHashChange(OnHashChange onHashChange);
+
+ /**
+ * Provide a callback to listener in case of USB problem
+ * https://code.google.com/p/android/issues/detail?id=20545
+ */
+ public void onUSBNoSuchDeviceException();
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncALMLifeCycleListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncALMLifeCycleListener.java new file mode 100644 index 000000000..8f6c5d597 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncALMLifeCycleListener.java @@ -0,0 +1,162 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.ChangeRegistrationResponse;
+import com.ford.syncV4.proxy.rpc.DeleteFileResponse;
+import com.ford.syncV4.proxy.rpc.EndAudioPassThruResponse;
+import com.ford.syncV4.proxy.rpc.AlertManeuverResponse;
+import com.ford.syncV4.proxy.rpc.GenericResponse;
+import com.ford.syncV4.proxy.rpc.GetDTCsResponse;
+import com.ford.syncV4.proxy.rpc.GetVehicleDataResponse;
+import com.ford.syncV4.proxy.rpc.OnAudioPassThru;
+import com.ford.syncV4.proxy.rpc.OnHMIStatus;
+import com.ford.syncV4.proxy.rpc.OnPermissionsChange;
+import com.ford.syncV4.proxy.rpc.OnVehicleData;
+import com.ford.syncV4.proxy.rpc.ReadDIDResponse;
+import com.ford.syncV4.proxy.rpc.SubscribeVehicleDataResponse;
+import com.ford.syncV4.proxy.rpc.ListFilesResponse;
+import com.ford.syncV4.proxy.rpc.OnLanguageChange;
+import com.ford.syncV4.proxy.rpc.PerformAudioPassThruResponse;
+import com.ford.syncV4.proxy.rpc.PutFileResponse;
+import com.ford.syncV4.proxy.rpc.ScrollableMessageResponse;
+import com.ford.syncV4.proxy.rpc.SetAppIconResponse;
+import com.ford.syncV4.proxy.rpc.SetDisplayLayoutResponse;
+import com.ford.syncV4.proxy.rpc.SliderResponse;
+import com.ford.syncV4.proxy.rpc.ShowConstantTBTResponse;
+import com.ford.syncV4.proxy.rpc.UnsubscribeVehicleDataResponse;
+import com.ford.syncV4.proxy.rpc.UpdateTurnListResponse;
+
+public interface ISyncALMLifeCycleListener {
+
+ /**
+ * onOnHMIStatus being called indicates that there has been an HMI Level change,
+ * system context change or audio streaming state change.
+ *
+ * @param notification - Contains information about the HMI Level,
+ * system context and audio streaming state.
+ */
+ public void onOnHMIStatus(OnHMIStatus notification);
+
+ /**
+ * onProxyClosed has different functionality for the different models.
+ * In the non-ALM model this indicates that the proxy has experienced an unrecoverable error.
+ * A new proxy object must be initiated to reestablish connection with SYNC.
+ * In the ALM model this indicates that the app is no longer registered with SYNC
+ * All resources on SYNC (addCommands and ChoiceSets) have been deleted and will have to be
+ * recreated upon the next onReadyForInitialization() call-back.
+ *
+ * @param info - Includes information about the reason the proxy has been closed.
+ * @param e - The exception that occurred.
+ */
+ public void onProxyClosed(String info, Exception e);
+
+ /**
+ * onError() being called indicates that the proxy has experienced an error.
+ *
+ * @param info - Any info present about the error that occurred.
+ * @param e - Any exception thrown by the error.
+ */
+ public void onError(String info, Throwable e);
+
+ /**
+ * onGenericResponse() being called indicates that the SYNC could not determine the
+ * type of request it is responding to. This is usually result of an unknown RPC Request
+ * being sent.
+ *
+ * @param response - Includes detailed information about the response.
+ */
+ public void onGenericResponse(GenericResponse response);
+
+ /**
+ * onOnPermissionsChange being called indicates that your app permissions have
+ * changed due to a policy table change. This can mean your app has received additional
+ * permissions OR lost permissions.
+ *
+ * @param notification - Contains information about the changed permissions.
+ */
+ public void onOnPermissionsChange(OnPermissionsChange notification);
+
+ public void onSubscribeVehicleDataResponse(SubscribeVehicleDataResponse response);
+
+ public void onUnsubscribeVehicleDataResponse(UnsubscribeVehicleDataResponse response);
+
+ public void onGetVehicleDataResponse(GetVehicleDataResponse response);
+
+ public void onReadDIDResponse(ReadDIDResponse response);
+
+ public void onGetDTCsResponse(GetDTCsResponse response);
+
+ public void onOnVehicleData(OnVehicleData notification);
+
+ public void onPutFileResponse(PutFileResponse response);
+
+ public void onPerformAudioPassThruResponse(PerformAudioPassThruResponse response);
+
+ public void onEndAudioPassThruResponse(EndAudioPassThruResponse response);
+
+ public void onOnAudioPassThru(OnAudioPassThru notification);
+
+ public void onDeleteFileResponse(DeleteFileResponse response);
+
+ public void onListFilesResponse(ListFilesResponse response);
+
+ public void onSetAppIconResponse(SetAppIconResponse response);
+
+ public void onScrollableMessageResponse(ScrollableMessageResponse response);
+
+ public void onChangeRegistrationResponse(ChangeRegistrationResponse response);
+
+ public void onSetDisplayLayoutResponse(SetDisplayLayoutResponse response);
+
+ public void onOnLanguageChange(OnLanguageChange notification);
+
+ public void onSliderResponse(SliderResponse response);
+
+ public void onAlertManeuverResponse(AlertManeuverResponse response);
+
+ public void onShowConstantTBTResponse(ShowConstantTBTResponse response);
+
+ public void onUpdateTurnListResponse(UpdateTurnListResponse response);
+
+ /**
+ * **Deprecated** - onSyncConntected() being called indicates that the proxy, for the first time in it's active
+ * life-cycle, has entered a state in which the application may create SYNC related resources (addCommands, ChoiceSets).
+ */
+ //public void onSyncConntected(RegisterAppInterfaceResponse response);
+
+ /**
+ * **Deprecated** - onSyncDisconnected() being called indicates that the app is no longer registered with SYNC
+ * All resources on SYNC (addCommands and ChoiceSets) have been deleted and will have to be
+ * recreated upon the next onReadyForInitialization() call-back.
+ */
+ //public void onSyncDisconnected(SyncDisconnectedReason syncDisconnectedReason);
+
+ /**
+ * **Deprecated** - onSyncInterfaceAvailable() being called indicates that the proxy now has access to SYNC's HMI.
+ * Monitor the onFocusChange call-back to determine which level of HMI is available to the proxy.
+ *
+ * @param isFirstAvailability - Indicates this is the first onSyncInterfaceAvailable in this lifecycle.
+ */
+ // HMI (Background, Limited, Full) from Unavailable = onSyncInterfaceAvailable(Boolean isFirstAvailability);
+
+ /**
+ * **Deprecated** - onSyncInterfaceUnavailable() being called indicates that the proxy does NOT have access to SYNC's HIM.
+ */
+ // HMI None onSyncInterfaceUnavailable();
+
+ /**
+ * **Deprecated** - onProxyUnusable() being called indicates that the proxy has experienced an unrecoverable error.
+ * A new proxy object must be initiated to reestablish connection with SYNC.
+ *
+ * @param info - Any info present about the error that occurred.
+ * @param e - Any exception thrown by the error.
+ */
+ //public void onProxyUnusable(String info, Exception e);
+
+ /**
+ * **Deprecated** - ALM HMI states converted back to HMI Levels
+ *
+ * HMI Full = onSyncInFocus(Boolean isFirstSyncInFocus);
+ * HMI Limited = onSyncInFocusLimited();
+ * HMI Background = onSyncLostFocus();
+ */
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncAddSubMenuResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncAddSubMenuResponseListener.java new file mode 100644 index 000000000..988485046 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncAddSubMenuResponseListener.java @@ -0,0 +1,8 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.SyncProxyALMManager.SyncSubMenu;
+import com.ford.syncV4.proxy.rpc.AddSubMenuResponse;
+
+public interface ISyncAddSubMenuResponseListener {
+ public void onAddSubMenuResponse(AddSubMenuResponse response, SyncSubMenu syncSubMenu, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncAlertResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncAlertResponseListener.java new file mode 100644 index 000000000..8f2517e7a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncAlertResponseListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.AlertResponse;
+
+public interface ISyncAlertResponseListener {
+ public void onAlertResponse(AlertResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncButtonListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncButtonListener.java new file mode 100644 index 000000000..c439570de --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncButtonListener.java @@ -0,0 +1,14 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.OnButtonEvent;
+import com.ford.syncV4.proxy.rpc.OnButtonPress;
+import com.ford.syncV4.proxy.rpc.SubscribeButtonResponse;
+
+public interface ISyncButtonListener {
+
+ public void onOnButtonEvent(OnButtonEvent notification);
+
+ public void onOnButtonPress(OnButtonPress notification);
+
+ public void onSubscribeButtonResponse(SubscribeButtonResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncChoiceListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncChoiceListener.java new file mode 100644 index 000000000..24534674b --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncChoiceListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.OnSyncChoiceChosen;
+
+public interface ISyncChoiceListener {
+ public void onSyncChoiceChosen(OnSyncChoiceChosen notification, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncCommandListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncCommandListener.java new file mode 100644 index 000000000..87db4fc31 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncCommandListener.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.SyncProxyALMManager.SyncCommand;
+import com.ford.syncV4.proxy.rpc.AddCommandResponse;
+import com.ford.syncV4.proxy.rpc.OnCommand;
+
+public interface ISyncCommandListener {
+ public void onSyncCommand(OnCommand notification, SyncCommand syncCommand, Object tag);
+
+ public void onAddCommandResponse(AddCommandResponse response, SyncCommand syncCommand, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncCreateInteractionChoiceSetResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncCreateInteractionChoiceSetResponseListener.java new file mode 100644 index 000000000..9376af60a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncCreateInteractionChoiceSetResponseListener.java @@ -0,0 +1,9 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.SyncProxyALMManager.SyncChoiceSet;
+import com.ford.syncV4.proxy.rpc.CreateInteractionChoiceSetResponse;
+
+public interface ISyncCreateInteractionChoiceSetResponseListener {
+ public void onCreateInteractionChoiceSetResponse(CreateInteractionChoiceSetResponse response,
+ SyncChoiceSet syncChoiceSet, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncDeleteCommandResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncDeleteCommandResponseListener.java new file mode 100644 index 000000000..89b0d8813 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncDeleteCommandResponseListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.DeleteCommandResponse;
+
+public interface ISyncDeleteCommandResponseListener {
+ public void onDeleteCommandResponse(DeleteCommandResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncDeleteInteractionChoiceSetResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncDeleteInteractionChoiceSetResponseListener.java new file mode 100644 index 000000000..222b17db0 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncDeleteInteractionChoiceSetResponseListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.DeleteInteractionChoiceSetResponse;
+
+public interface ISyncDeleteInteractionChoiceSetResponseListener {
+ public void onDeleteInteractionChoiceSetResponse(DeleteInteractionChoiceSetResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncDeleteSubMenuResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncDeleteSubMenuResponseListener.java new file mode 100644 index 000000000..570ab7032 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncDeleteSubMenuResponseListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.DeleteSubMenuResponse;
+
+public interface ISyncDeleteSubMenuResponseListener {
+ public void onDeleteSubMenuResponse(DeleteSubMenuResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncDriverDistractionListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncDriverDistractionListener.java new file mode 100644 index 000000000..09d2e787b --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncDriverDistractionListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.OnDriverDistraction;
+
+public interface ISyncDriverDistractionListener {
+ public void onOnDriverDistraction(OnDriverDistraction notification);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncEncodedSyncPDataListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncEncodedSyncPDataListener.java new file mode 100644 index 000000000..28bdb97a3 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncEncodedSyncPDataListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.OnEncodedSyncPData;
+
+public interface ISyncEncodedSyncPDataListener {
+ public void onOnEncodedSyncPData(OnEncodedSyncPData notification);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncEncodedSyncPDataResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncEncodedSyncPDataResponseListener.java new file mode 100644 index 000000000..c9a055aae --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncEncodedSyncPDataResponseListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.EncodedSyncPDataResponse;
+
+public interface ISyncEncodedSyncPDataResponseListener {
+ public void onEncodedSyncPDataResponse(EncodedSyncPDataResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncPerformInteractionResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncPerformInteractionResponseListener.java new file mode 100644 index 000000000..d16177ee4 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncPerformInteractionResponseListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.PerformInteractionResponse;
+
+public interface ISyncPerformInteractionResponseListener {
+ public void onPerformInteractionResponse(PerformInteractionResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncResetGlobalPropertiesListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncResetGlobalPropertiesListener.java new file mode 100644 index 000000000..99d25c006 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncResetGlobalPropertiesListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.ResetGlobalPropertiesResponse;
+
+public interface ISyncResetGlobalPropertiesListener {
+ public void onResetGlobalPropertiesResponse(ResetGlobalPropertiesResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSetGlobalPropertiesResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSetGlobalPropertiesResponseListener.java new file mode 100644 index 000000000..4997c67f8 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSetGlobalPropertiesResponseListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.SetGlobalPropertiesResponse;
+
+public interface ISyncSetGlobalPropertiesResponseListener {
+ public void onSetGlobalPropertiesResponse(SetGlobalPropertiesResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSetMediaClockTimerResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSetMediaClockTimerResponseListener.java new file mode 100644 index 000000000..13cd300f7 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSetMediaClockTimerResponseListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.SetMediaClockTimerResponse;
+
+public interface ISyncSetMediaClockTimerResponseListener {
+ public void onSetMediaClockTimerResponse(SetMediaClockTimerResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncShowResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncShowResponseListener.java new file mode 100644 index 000000000..ce9f18501 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncShowResponseListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.ShowResponse;
+
+public interface ISyncShowResponseListener {
+ public void onShowResponse(ShowResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSpeakResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSpeakResponseListener.java new file mode 100644 index 000000000..995527ddd --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSpeakResponseListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.SpeakResponse;
+
+public interface ISyncSpeakResponseListener {
+ public void onSpeakResponse(SpeakResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSyncPDataListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSyncPDataListener.java new file mode 100644 index 000000000..f9f8c5050 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSyncPDataListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces; + +import com.ford.syncV4.proxy.rpc.OnSyncPData; + +public interface ISyncSyncPDataListener { + public void onOnSyncPData(OnSyncPData notification); +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSyncPDataResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSyncPDataResponseListener.java new file mode 100644 index 000000000..bf52e7b23 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncSyncPDataResponseListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces; + +import com.ford.syncV4.proxy.rpc.SyncPDataResponse; + +public interface ISyncSyncPDataResponseListener { + public void onSyncPDataResponse(SyncPDataResponse response, Object tag); +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncTBTClientStateListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncTBTClientStateListener.java new file mode 100644 index 000000000..e21ffd276 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncTBTClientStateListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.OnTBTClientState;
+
+public interface ISyncTBTClientStateListener {
+ public void onOnTBTClientState(OnTBTClientState notification);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncUnsubscribeButtonResponseListener.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncUnsubscribeButtonResponseListener.java new file mode 100644 index 000000000..7743c5db2 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/interfaces/ISyncUnsubscribeButtonResponseListener.java @@ -0,0 +1,7 @@ +package com.ford.syncV4.proxy.interfaces;
+
+import com.ford.syncV4.proxy.rpc.UnsubscribeButtonResponse;
+
+public interface ISyncUnsubscribeButtonResponseListener {
+ public void onUnsubscribeButtonResponse(UnsubscribeButtonResponse response, Object tag);
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AddCommand.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AddCommand.java new file mode 100644 index 000000000..cb0764e75 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AddCommand.java @@ -0,0 +1,88 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.util.DebugTool;
+
+public class AddCommand extends RPCRequest {
+
+ public AddCommand() {
+ super("AddCommand");
+ }
+ public AddCommand(Hashtable hash) {
+ super(hash);
+ }
+ public Integer getCmdID() {
+ return (Integer) parameters.get(Names.cmdID);
+ }
+ public void setCmdID(Integer cmdID) {
+ if (cmdID != null) {
+ parameters.put(Names.cmdID, cmdID);
+ } else {
+ parameters.remove(Names.cmdID);
+ }
+ }
+ public MenuParams getMenuParams() {
+ Object obj = parameters.get(Names.menuParams);
+ if (obj instanceof MenuParams) {
+ return (MenuParams) obj;
+ }
+ else if (obj instanceof Hashtable) {
+ try {
+ return new MenuParams((Hashtable) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.menuParams, e);
+ }
+ }
+ return null;
+ }
+ public void setMenuParams(MenuParams menuParams) {
+ if (menuParams != null) {
+ parameters.put(Names.menuParams, menuParams);
+ } else {
+ parameters.remove(Names.menuParams);
+ }
+ }
+ public Vector<String> getVrCommands() {
+ if (parameters.get(Names.vrCommands) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.vrCommands);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof String) {
+ return (Vector<String>)list;
+ }
+ }
+ }
+ return null;
+ }
+ public void setVrCommands( Vector<String> vrCommands ) {
+ if (vrCommands != null) {
+ parameters.put(Names.vrCommands, vrCommands );
+ } else {
+ parameters.remove(Names.vrCommands);
+ }
+ }
+ public Image getCmdIcon() {
+ Object obj = parameters.get(Names.cmdIcon);
+ if (obj instanceof Image) {
+ return (Image) obj;
+ } else if (obj instanceof Hashtable) {
+ try {
+ return new Image((Hashtable) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.cmdIcon, e);
+ }
+ }
+ return null;
+ }
+ public void setCmdIcon(Image cmdIcon) {
+ if (cmdIcon != null) {
+ parameters.put(Names.cmdIcon, cmdIcon);
+ } else {
+ parameters.remove(Names.cmdIcon);
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AddCommandResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AddCommandResponse.java new file mode 100644 index 000000000..6084a4a1c --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AddCommandResponse.java @@ -0,0 +1,16 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class AddCommandResponse extends RPCResponse {
+
+ public AddCommandResponse() {
+ super("AddCommand");
+ }
+ public AddCommandResponse(Hashtable hash) {
+ super(hash);
+ }
+}
+
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AddSubMenu.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AddSubMenu.java new file mode 100644 index 000000000..b98f2c4f9 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AddSubMenu.java @@ -0,0 +1,40 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class AddSubMenu extends RPCRequest {
+
+ public AddSubMenu() {
+ super("AddSubMenu");
+ }
+ public AddSubMenu(Hashtable hash) {
+ super(hash);
+ }
+ public Integer getMenuID() {
+ return (Integer) parameters.get( Names.menuID );
+ }
+ public void setMenuID( Integer menuID ) {
+ if (menuID != null) {
+ parameters.put(Names.menuID, menuID );
+ }
+ }
+ public Integer getPosition() {
+ return (Integer) parameters.get( Names.position );
+ }
+ public void setPosition( Integer position ) {
+ if (position != null) {
+ parameters.put(Names.position, position );
+ }
+ }
+ public String getMenuName() {
+ return (String) parameters.get( Names.menuName );
+ }
+ public void setMenuName( String menuName ) {
+ if (menuName != null) {
+ parameters.put(Names.menuName, menuName );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AddSubMenuResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AddSubMenuResponse.java new file mode 100644 index 000000000..f8b183b20 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AddSubMenuResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class AddSubMenuResponse extends RPCResponse {
+
+ public AddSubMenuResponse() {
+ super("AddSubMenu");
+ }
+ public AddSubMenuResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AirbagStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AirbagStatus.java new file mode 100644 index 000000000..de38ee1e1 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AirbagStatus.java @@ -0,0 +1,193 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataEventStatus; +import com.ford.syncV4.util.DebugTool; + +public class AirbagStatus extends RPCStruct { + + public AirbagStatus() { } + public AirbagStatus(Hashtable hash) { + super(hash); + } + + public void setDriverAirbagDeployed(VehicleDataEventStatus driverAirbagDeployed) { + if (driverAirbagDeployed != null) { + store.put(Names.driverAirbagDeployed, driverAirbagDeployed); + } else { + store.remove(Names.driverAirbagDeployed); + } + } + public VehicleDataEventStatus getDriverAirbagDeployed() { + Object obj = store.get(Names.driverAirbagDeployed); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.driverAirbagDeployed, e); + } + return theCode; + } + return null; + } + public void setDriverSideAirbagDeployed(VehicleDataEventStatus driverSideAirbagDeployed) { + if (driverSideAirbagDeployed != null) { + store.put(Names.driverSideAirbagDeployed, driverSideAirbagDeployed); + } else { + store.remove(Names.driverSideAirbagDeployed); + } + } + public VehicleDataEventStatus getDriverSideAirbagDeployed() { + Object obj = store.get(Names.driverSideAirbagDeployed); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.driverSideAirbagDeployed, e); + } + return theCode; + } + return null; + } + public void setDriverCurtainAirbagDeployed(VehicleDataEventStatus driverCurtainAirbagDeployed) { + if (driverCurtainAirbagDeployed != null) { + store.put(Names.driverCurtainAirbagDeployed, driverCurtainAirbagDeployed); + } else { + store.remove(Names.driverCurtainAirbagDeployed); + } + } + public VehicleDataEventStatus getDriverCurtainAirbagDeployed() { + Object obj = store.get(Names.driverCurtainAirbagDeployed); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.driverCurtainAirbagDeployed, e); + } + return theCode; + } + return null; + } + public void setPassengerAirbagDeployed(VehicleDataEventStatus passengerAirbagDeployed) { + if (passengerAirbagDeployed != null) { + store.put(Names.passengerAirbagDeployed, passengerAirbagDeployed); + } else { + store.remove(Names.passengerAirbagDeployed); + } + } + public VehicleDataEventStatus getPassengerAirbagDeployed() { + Object obj = store.get(Names.passengerAirbagDeployed); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.passengerAirbagDeployed, e); + } + return theCode; + } + return null; + } + public void setPassengerCurtainAirbagDeployed(VehicleDataEventStatus passengerCurtainAirbagDeployed) { + if (passengerCurtainAirbagDeployed != null) { + store.put(Names.passengerCurtainAirbagDeployed, passengerCurtainAirbagDeployed); + } else { + store.remove(Names.passengerCurtainAirbagDeployed); + } + } + public VehicleDataEventStatus getPassengerCurtainAirbagDeployed() { + Object obj = store.get(Names.passengerCurtainAirbagDeployed); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.passengerCurtainAirbagDeployed, e); + } + return theCode; + } + return null; + } + public void setDriverKneeAirbagDeployed(VehicleDataEventStatus driverKneeAirbagDeployed) { + if (driverKneeAirbagDeployed != null) { + store.put(Names.driverKneeAirbagDeployed, driverKneeAirbagDeployed); + } else { + store.remove(Names.driverKneeAirbagDeployed); + } + } + public VehicleDataEventStatus getDriverKneeAirbagDeployed() { + Object obj = store.get(Names.driverKneeAirbagDeployed); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.driverKneeAirbagDeployed, e); + } + return theCode; + } + return null; + } + public void setPassengerSideAirbagDeployed(VehicleDataEventStatus passengerSideAirbagDeployed) { + if (passengerSideAirbagDeployed != null) { + store.put(Names.passengerSideAirbagDeployed, passengerSideAirbagDeployed); + } else { + store.remove(Names.passengerSideAirbagDeployed); + } + } + public VehicleDataEventStatus getPassengerSideAirbagDeployed() { + Object obj = store.get(Names.passengerSideAirbagDeployed); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.passengerSideAirbagDeployed, e); + } + return theCode; + } + return null; + } + public void setPassengerKneeAirbagDeployed(VehicleDataEventStatus passengerKneeAirbagDeployed) { + if (passengerKneeAirbagDeployed != null) { + store.put(Names.passengerKneeAirbagDeployed, passengerKneeAirbagDeployed); + } else { + store.remove(Names.passengerKneeAirbagDeployed); + } + } + public VehicleDataEventStatus getPassengerKneeAirbagDeployed() { + Object obj = store.get(Names.passengerKneeAirbagDeployed); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.passengerKneeAirbagDeployed, e); + } + return theCode; + } + return null; + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Alert.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Alert.java new file mode 100644 index 000000000..73ae1fdac --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Alert.java @@ -0,0 +1,131 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class Alert extends RPCRequest {
+
+ public Alert() {
+ super("Alert");
+ }
+ public Alert(Hashtable hash) {
+ super(hash);
+ }
+ public String getAlertText1() {
+ return (String) parameters.get(Names.alertText1);
+ }
+ public void setAlertText1(String alertText1) {
+ if (alertText1 != null) {
+ parameters.put(Names.alertText1, alertText1);
+ } else {
+ parameters.remove(Names.alertText1);
+ }
+ }
+ public String getAlertText2() {
+ return (String) parameters.get(Names.alertText2);
+ }
+ public void setAlertText2(String alertText2) {
+ if (alertText2 != null) {
+ parameters.put(Names.alertText2, alertText2);
+ } else {
+ parameters.remove(Names.alertText2);
+ }
+ }
+ public String getAlertText3() {
+ return (String) parameters.get(Names.alertText3);
+ }
+ public void setAlertText3(String alertText3) {
+ if (alertText3 != null) {
+ parameters.put(Names.alertText3, alertText3);
+ } else {
+ parameters.remove(Names.alertText3);
+ }
+ }
+ public Vector<TTSChunk> getTtsChunks() {
+ if (parameters.get(Names.ttsChunks) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.ttsChunks);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof TTSChunk) {
+ return (Vector<TTSChunk>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<TTSChunk> newList = new Vector<TTSChunk>();
+ for (Object hashObj : list) {
+ newList.add(new TTSChunk((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setTtsChunks(Vector<TTSChunk> ttsChunks) {
+ if (ttsChunks != null) {
+ parameters.put(Names.ttsChunks, ttsChunks);
+ } else {
+ parameters.remove(Names.ttsChunks);
+ }
+ }
+ public Integer getDuration() {
+ return (Integer) parameters.get(Names.duration);
+ }
+ public void setDuration(Integer duration) {
+ if (duration != null) {
+ parameters.put(Names.duration, duration);
+ } else {
+ parameters.remove(Names.duration);
+ }
+ }
+ public Boolean getPlayTone() {
+ return (Boolean) parameters.get(Names.playTone);
+ }
+ public void setPlayTone(Boolean playTone) {
+ if (playTone != null) {
+ parameters.put(Names.playTone, playTone);
+ } else {
+ parameters.remove(Names.playTone);
+ }
+ }
+ public Boolean getProgressIndicator() {
+ final Object obj = parameters.get(Names.progressIndicator);
+ if (obj instanceof Boolean) {
+ return (Boolean) obj;
+ }
+ return null;
+ }
+ public void setProgressIndicator(Boolean progressIndicator) {
+ if (progressIndicator != null) {
+ parameters.put(Names.progressIndicator, progressIndicator);
+ } else {
+ parameters.remove(Names.progressIndicator);
+ }
+ }
+ public Vector<SoftButton> getSoftButtons() {
+ if (parameters.get(Names.softButtons) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.softButtons);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof SoftButton) {
+ return (Vector<SoftButton>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<SoftButton> newList = new Vector<SoftButton>();
+ for (Object hashObj : list) {
+ newList.add(new SoftButton((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setSoftButtons(Vector<SoftButton> softButtons) {
+ if (softButtons != null) {
+ parameters.put(Names.softButtons, softButtons);
+ } else {
+ parameters.remove(Names.softButtons);
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AlertManeuver.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AlertManeuver.java new file mode 100644 index 000000000..21b350922 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AlertManeuver.java @@ -0,0 +1,67 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; + +public class AlertManeuver extends RPCRequest { + + public AlertManeuver() { + super("AlertManeuver"); + } + public AlertManeuver(Hashtable hash) { + super(hash); + } + public void setTtsChunks(Vector<TTSChunk> ttsChunks) { + if (ttsChunks != null) { + parameters.put(Names.ttsChunks, ttsChunks); + } else { + parameters.remove(Names.ttsChunks); + } + } + public Vector<TTSChunk> getTtsChunks() { + if (parameters.get(Names.ttsChunks) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)parameters.get(Names.ttsChunks); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof TTSChunk) { + return (Vector<TTSChunk>) list; + } else if (obj instanceof Hashtable) { + Vector<TTSChunk> newList = new Vector<TTSChunk>(); + for (Object hashObj : list) { + newList.add(new TTSChunk((Hashtable)hashObj)); + } + return newList; + } + } + } + return null; + } + public void setSoftButtons(Vector<SoftButton> softButtons) { + if (softButtons != null) { + parameters.put(Names.softButtons, softButtons); + } else { + parameters.remove(Names.softButtons); + } + } + public Vector<SoftButton> getSoftButtons() { + if (parameters.get(Names.softButtons) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)parameters.get(Names.softButtons); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof SoftButton) { + return (Vector<SoftButton>) list; + } else if (obj instanceof Hashtable) { + Vector<SoftButton> newList = new Vector<SoftButton>(); + for (Object hashObj : list) { + newList.add(new SoftButton((Hashtable)hashObj)); + } + return newList; + } + } + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AlertManeuverResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AlertManeuverResponse.java new file mode 100644 index 000000000..c980db849 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AlertManeuverResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCResponse; + +public class AlertManeuverResponse extends RPCResponse { + + public AlertManeuverResponse() { + super("AlertManeuver"); + } + public AlertManeuverResponse(Hashtable hash) { + super(hash); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AlertResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AlertResponse.java new file mode 100644 index 000000000..ce8154866 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AlertResponse.java @@ -0,0 +1,26 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class AlertResponse extends RPCResponse {
+
+ public AlertResponse() {
+ super("Alert");
+ }
+ public AlertResponse(Hashtable hash) {
+ super(hash);
+ }
+ public Integer getTryAgainTime() {
+ return (Integer) parameters.get(Names.tryAgainTime);
+ }
+ public void setTryAgainTime(Integer tryAgainTime) {
+ if (tryAgainTime != null) {
+ parameters.put(Names.tryAgainTime, tryAgainTime);
+ } else {
+ parameters.remove(Names.tryAgainTime);
+ }
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AudioPassThruCapabilities.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AudioPassThruCapabilities.java new file mode 100644 index 000000000..95fc137c0 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/AudioPassThruCapabilities.java @@ -0,0 +1,91 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.AudioType; +import com.ford.syncV4.proxy.rpc.enums.BitsPerSample; +import com.ford.syncV4.proxy.rpc.enums.SamplingRate; +import com.ford.syncV4.util.DebugTool; + +import java.util.Hashtable; + +public class AudioPassThruCapabilities extends RPCStruct { + public AudioPassThruCapabilities() { + } + + public AudioPassThruCapabilities(Hashtable hash) { + super(hash); + } + + public SamplingRate getSamplingRate() { + Object obj = store.get(Names.samplingRate); + if (obj instanceof SamplingRate) { + return (SamplingRate) obj; + } else if (obj instanceof String) { + try { + return SamplingRate.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.samplingRate, e); + } + } + return null; + } + + public void setSamplingRate(SamplingRate samplingRate) { + if (samplingRate != null) { + store.put(Names.samplingRate, samplingRate); + } else { + store.remove(Names.samplingRate); + } + } + + public BitsPerSample getBitsPerSample() { + Object obj = store.get(Names.bitsPerSample); + if (obj instanceof BitsPerSample) { + return (BitsPerSample) obj; + } else if (obj instanceof String) { + try { + return BitsPerSample.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.bitsPerSample, e); + } + } + return null; + } + + public void setBitsPerSample(BitsPerSample bitsPerSample) { + if (bitsPerSample != null) { + store.put(Names.bitsPerSample, bitsPerSample); + } else { + store.remove(Names.bitsPerSample); + } + } + + public AudioType getAudioType() { + Object obj = store.get(Names.audioType); + if (obj instanceof AudioType) { + return (AudioType) obj; + } else if (obj instanceof String) { + try { + return AudioType.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.audioType, e); + } + } + return null; + } + + public void setAudioType(AudioType audioType) { + if (audioType != null) { + store.put(Names.audioType, audioType); + } else { + store.remove(Names.audioType); + } + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/BeltStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/BeltStatus.java new file mode 100644 index 000000000..9dde8ce41 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/BeltStatus.java @@ -0,0 +1,347 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataEventStatus; +import com.ford.syncV4.util.DebugTool; + +public class BeltStatus extends RPCStruct { + + public BeltStatus() { } + public BeltStatus(Hashtable hash) { + super(hash); + } + + public void setDriverBeltDeployed(VehicleDataEventStatus driverBeltDeployed) { + if (driverBeltDeployed != null) { + store.put(Names.driverBeltDeployed, driverBeltDeployed); + } else { + store.remove(Names.driverBeltDeployed); + } + } + public VehicleDataEventStatus getDriverBeltDeployed() { + Object obj = store.get(Names.driverBeltDeployed); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.driverBeltDeployed, e); + } + return theCode; + } + return null; + } + public void setPassengerBeltDeployed(VehicleDataEventStatus passengerBeltDeployed) { + if (passengerBeltDeployed != null) { + store.put(Names.passengerBeltDeployed, passengerBeltDeployed); + } else { + store.remove(Names.passengerBeltDeployed); + } + } + public VehicleDataEventStatus getPassengerBeltDeployed() { + Object obj = store.get(Names.passengerBeltDeployed); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.passengerBeltDeployed, e); + } + return theCode; + } + return null; + } + public void setPassengerBuckleBelted(VehicleDataEventStatus passengerBuckleBelted) { + if (passengerBuckleBelted != null) { + store.put(Names.passengerBuckleBelted, passengerBuckleBelted); + } else { + store.remove(Names.passengerBuckleBelted); + } + } + public VehicleDataEventStatus getPassengerBuckleBelted() { + Object obj = store.get(Names.passengerBuckleBelted); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.passengerBuckleBelted, e); + } + return theCode; + } + return null; + } + public void setDriverBuckleBelted(VehicleDataEventStatus driverBuckleBelted) { + if (driverBuckleBelted != null) { + store.put(Names.driverBuckleBelted, driverBuckleBelted); + } else { + store.remove(Names.driverBuckleBelted); + } + } + public VehicleDataEventStatus getDriverBuckleBelted() { + Object obj = store.get(Names.driverBuckleBelted); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.driverBuckleBelted, e); + } + return theCode; + } + return null; + } + public void setLeftRow2BuckleBelted(VehicleDataEventStatus leftRow2BuckleBelted) { + if (leftRow2BuckleBelted != null) { + store.put(Names.leftRow2BuckleBelted, leftRow2BuckleBelted); + } else { + store.remove(Names.leftRow2BuckleBelted); + } + } + public VehicleDataEventStatus getLeftRow2BuckleBelted() { + Object obj = store.get(Names.leftRow2BuckleBelted); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.leftRow2BuckleBelted, e); + } + return theCode; + } + return null; + } + public void setPassengerChildDetected(VehicleDataEventStatus passengerChildDetected) { + if (passengerChildDetected != null) { + store.put(Names.passengerChildDetected, passengerChildDetected); + } else { + store.remove(Names.passengerChildDetected); + } + } + public VehicleDataEventStatus getPassengerChildDetected() { + Object obj = store.get(Names.passengerChildDetected); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.passengerChildDetected, e); + } + return theCode; + } + return null; + } + public void setRightRow2BuckleBelted(VehicleDataEventStatus rightRow2BuckleBelted) { + if (rightRow2BuckleBelted != null) { + store.put(Names.rightRow2BuckleBelted, rightRow2BuckleBelted); + } else { + store.remove(Names.rightRow2BuckleBelted); + } + } + public VehicleDataEventStatus getRightRow2BuckleBelted() { + Object obj = store.get(Names.rightRow2BuckleBelted); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.rightRow2BuckleBelted, e); + } + return theCode; + } + return null; + } + public void setMiddleRow2BuckleBelted(VehicleDataEventStatus middleRow2BuckleBelted) { + if (middleRow2BuckleBelted != null) { + store.put(Names.middleRow2BuckleBelted, middleRow2BuckleBelted); + } else { + store.remove(Names.middleRow2BuckleBelted); + } + } + public VehicleDataEventStatus getMiddleRow2BuckleBelted() { + Object obj = store.get(Names.middleRow2BuckleBelted); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.middleRow2BuckleBelted, e); + } + return theCode; + } + return null; + } + public void setMiddleRow3BuckleBelted(VehicleDataEventStatus middleRow3BuckleBelted) { + if (middleRow3BuckleBelted != null) { + store.put(Names.middleRow3BuckleBelted, middleRow3BuckleBelted); + } else { + store.remove(Names.middleRow3BuckleBelted); + } + } + public VehicleDataEventStatus getMiddleRow3BuckleBelted() { + Object obj = store.get(Names.middleRow3BuckleBelted); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.middleRow3BuckleBelted, e); + } + return theCode; + } + return null; + } + public void setLeftRow3BuckleBelted(VehicleDataEventStatus leftRow3BuckleBelted) { + if (leftRow3BuckleBelted != null) { + store.put(Names.leftRow3BuckleBelted, leftRow3BuckleBelted); + } else { + store.remove(Names.leftRow3BuckleBelted); + } + } + public VehicleDataEventStatus getLeftRow3BuckleBelted() { + Object obj = store.get(Names.leftRow3BuckleBelted); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.leftRow3BuckleBelted, e); + } + return theCode; + } + return null; + } + public void setRightRow3BuckleBelted(VehicleDataEventStatus rightRow3BuckleBelted) { + if (rightRow3BuckleBelted != null) { + store.put(Names.rightRow3BuckleBelted, rightRow3BuckleBelted); + } else { + store.remove(Names.rightRow3BuckleBelted); + } + } + public VehicleDataEventStatus getRightRow3BuckleBelted() { + Object obj = store.get(Names.rightRow3BuckleBelted); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.rightRow3BuckleBelted, e); + } + return theCode; + } + return null; + } + public void setLeftRearInflatableBelted(VehicleDataEventStatus rearInflatableBelted) { + if (rearInflatableBelted != null) { + store.put(Names.rearInflatableBelted, rearInflatableBelted); + } else { + store.remove(Names.rearInflatableBelted); + } + } + public VehicleDataEventStatus getLeftRearInflatableBelted() { + Object obj = store.get(Names.rearInflatableBelted); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.rearInflatableBelted, e); + } + return theCode; + } + return null; + } + public void setRightRearInflatableBelted(VehicleDataEventStatus rightRearInflatableBelted) { + if (rightRearInflatableBelted != null) { + store.put(Names.rightRearInflatableBelted, rightRearInflatableBelted); + } else { + store.remove(Names.rightRearInflatableBelted); + } + } + public VehicleDataEventStatus getRightRearInflatableBelted() { + Object obj = store.get(Names.rightRearInflatableBelted); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.rightRearInflatableBelted, e); + } + return theCode; + } + return null; + } + public void setMiddleRow1BeltDeployed(VehicleDataEventStatus middleRow1BeltDeployed) { + if (middleRow1BeltDeployed != null) { + store.put(Names.middleRow1BeltDeployed, middleRow1BeltDeployed); + } else { + store.remove(Names.middleRow1BeltDeployed); + } + } + public VehicleDataEventStatus getMiddleRow1BeltDeployed() { + Object obj = store.get(Names.middleRow1BeltDeployed); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.middleRow1BeltDeployed, e); + } + return theCode; + } + return null; + } + public void setMiddleRow1BuckleBelted(VehicleDataEventStatus middleRow1BuckleBelted) { + if (middleRow1BuckleBelted != null) { + store.put(Names.middleRow1BuckleBelted, middleRow1BuckleBelted); + } else { + store.remove(Names.middleRow1BuckleBelted); + } + } + public VehicleDataEventStatus getMiddleRow1BuckleBelted() { + Object obj = store.get(Names.middleRow1BuckleBelted); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.middleRow1BuckleBelted, e); + } + return theCode; + } + return null; + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/BodyInformation.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/BodyInformation.java new file mode 100644 index 000000000..821e8adf4 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/BodyInformation.java @@ -0,0 +1,72 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.IgnitionStableStatus; +import com.ford.syncV4.proxy.rpc.enums.IgnitionStatus; +import com.ford.syncV4.util.DebugTool; + +public class BodyInformation extends RPCStruct { + + public BodyInformation() { } + public BodyInformation(Hashtable hash) { + super(hash); + } + + public void setParkBrakeActive(Boolean parkBrakeActive) { + if (parkBrakeActive != null) { + store.put(Names.parkBrakeActive, parkBrakeActive); + } else { + store.remove(Names.parkBrakeActive); + } + } + public Boolean getParkBrakeActive() { + return (Boolean) store.get(Names.parkBrakeActive); + } + public void setIgnitionStableStatus(IgnitionStableStatus ignitionStableStatus) { + if (ignitionStableStatus != null) { + store.put(Names.ignitionStableStatus, ignitionStableStatus); + } else { + store.remove(Names.ignitionStableStatus); + } + } + public IgnitionStableStatus getIgnitionStableStatus() { + Object obj = store.get(Names.ignitionStableStatus); + if (obj instanceof IgnitionStableStatus) { + return (IgnitionStableStatus) obj; + } else if (obj instanceof String) { + IgnitionStableStatus theCode = null; + try { + theCode = IgnitionStableStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.ignitionStableStatus, e); + } + return theCode; + } + return null; + } + public void setIgnitionStatus(IgnitionStatus ignitionStatus) { + if (ignitionStatus != null) { + store.put(Names.ignitionStatus, ignitionStatus); + } else { + store.remove(Names.ignitionStatus); + } + } + public IgnitionStatus getIgnitionStatus() { + Object obj = store.get(Names.ignitionStatus); + if (obj instanceof IgnitionStatus) { + return (IgnitionStatus) obj; + } else if (obj instanceof String) { + IgnitionStatus theCode = null; + try { + theCode = IgnitionStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.ignitionStatus, e); + } + return theCode; + } + return null; + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ButtonCapabilities.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ButtonCapabilities.java new file mode 100644 index 000000000..9b2aeb865 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ButtonCapabilities.java @@ -0,0 +1,60 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCStruct;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.ButtonName;
+import com.ford.syncV4.util.DebugTool;
+
+public class ButtonCapabilities extends RPCStruct {
+
+ public ButtonCapabilities() { }
+ public ButtonCapabilities(Hashtable hash) {
+ super(hash);
+ }
+ public ButtonName getName() {
+ Object obj = store.get(Names.name);
+ if (obj instanceof ButtonName) {
+ return (ButtonName) obj;
+ } else if (obj instanceof String) {
+ ButtonName theCode = null;
+ try {
+ theCode = ButtonName.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.name, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setName( ButtonName name ) {
+ if (name != null) {
+ store.put(Names.name, name );
+ }
+ }
+ public Boolean getShortPressAvailable() {
+ return (Boolean) store.get( Names.shortPressAvailable );
+ }
+ public void setShortPressAvailable( Boolean shortPressAvailable ) {
+ if (shortPressAvailable != null) {
+ store.put(Names.shortPressAvailable, shortPressAvailable );
+ }
+ }
+ public Boolean getLongPressAvailable() {
+ return (Boolean) store.get( Names.longPressAvailable );
+ }
+ public void setLongPressAvailable( Boolean longPressAvailable ) {
+ if (longPressAvailable != null) {
+ store.put(Names.longPressAvailable, longPressAvailable );
+ }
+ }
+ public Boolean getUpDownAvailable() {
+ return (Boolean) store.get( Names.upDownAvailable );
+ }
+ public void setUpDownAvailable( Boolean upDownAvailable ) {
+ if (upDownAvailable != null) {
+ store.put(Names.upDownAvailable, upDownAvailable );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ChangeRegistration.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ChangeRegistration.java new file mode 100644 index 000000000..4681ddefb --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ChangeRegistration.java @@ -0,0 +1,62 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.Language; +import com.ford.syncV4.util.DebugTool; + +public class ChangeRegistration extends RPCRequest { + + public ChangeRegistration() { + super("ChangeRegistration"); + } + public ChangeRegistration(Hashtable hash) { + super(hash); + } + public void setLanguage(Language language) { + if (language != null) { + parameters.put(Names.language, language); + } else { + parameters.remove(Names.language); + } + } + public Language getLanguage() { + Object obj = parameters.get(Names.language); + if (obj instanceof Language) { + return (Language) obj; + } else if (obj instanceof String) { + Language theCode = null; + try { + theCode = Language.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.language, e); + } + return theCode; + } + return null; + } + public void setHmiDisplayLanguage(Language hmiDisplayLanguage) { + if (hmiDisplayLanguage != null) { + parameters.put(Names.hmiDisplayLanguage, hmiDisplayLanguage); + } else { + parameters.remove(Names.hmiDisplayLanguage); + } + } + public Language getHmiDisplayLanguage() { + Object obj = parameters.get(Names.hmiDisplayLanguage); + if (obj instanceof Language) { + return (Language) obj; + } else if (obj instanceof String) { + Language theCode = null; + try { + theCode = Language.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.hmiDisplayLanguage, e); + } + return theCode; + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ChangeRegistrationResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ChangeRegistrationResponse.java new file mode 100644 index 000000000..a962c1dfc --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ChangeRegistrationResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCResponse; + +public class ChangeRegistrationResponse extends RPCResponse { + + public ChangeRegistrationResponse() { + super("ChangeLanguageRegistration"); + } + public ChangeRegistrationResponse(Hashtable hash) { + super(hash); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Choice.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Choice.java new file mode 100644 index 000000000..97ec91142 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Choice.java @@ -0,0 +1,121 @@ +package com.ford.syncV4.proxy.rpc;
+
+import com.ford.syncV4.proxy.RPCStruct;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.util.DebugTool;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+public class Choice extends RPCStruct {
+
+ public Choice() {
+ }
+
+ public Choice(Hashtable hash) {
+ super(hash);
+ }
+
+ public Integer getChoiceID() {
+ return (Integer) store.get(Names.choiceID);
+ }
+
+ public void setChoiceID(Integer choiceID) {
+ if (choiceID != null) {
+ store.put(Names.choiceID, choiceID);
+ }
+ }
+
+ public String getMenuName() {
+ return (String) store.get(Names.menuName);
+ }
+
+ public void setMenuName(String menuName) {
+ if (menuName != null) {
+ store.put(Names.menuName, menuName);
+ }
+ }
+
+ public Vector<String> getVrCommands() {
+ if (store.get(Names.vrCommands) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>) store.get(Names.vrCommands);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof String) {
+ return (Vector<String>) list;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void setVrCommands(Vector<String> vrCommands) {
+ if (vrCommands != null) {
+ store.put(Names.vrCommands, vrCommands);
+ }
+ }
+
+ public Image getImage() {
+ Object obj = store.get(Names.image);
+ if (obj instanceof Image) {
+ return (Image) obj;
+ } else if (obj instanceof Hashtable) {
+ try {
+ return new Image((Hashtable) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.image, e);
+ }
+ }
+ return null;
+ }
+
+ public void setImage(Image image) {
+ if (image != null) {
+ store.put(Names.image, image);
+ } else {
+ store.remove(Names.image);
+ }
+ }
+
+ public String getSecondaryText() {
+ return (String) store.get(Names.secondaryText);
+ }
+
+ public void setSecondaryText(String secondaryText) {
+ if (secondaryText != null) {
+ store.put(Names.secondaryText, secondaryText);
+ }
+ }
+
+ public String getTertiaryText() {
+ return (String) store.get(Names.tertiaryText);
+ }
+
+ public void setTertiaryText(String tertiaryText) {
+ if (tertiaryText != null) {
+ store.put(Names.tertiaryText, tertiaryText);
+ }
+ }
+
+ public void setSecondaryImage(Image image) {
+ if (image != null) {
+ store.put(Names.secondaryImage, image);
+ } else {
+ store.remove(Names.secondaryImage);
+ }
+ }
+
+ public Image getSecondaryImage() {
+ Object obj = store.get(Names.secondaryImage);
+ if (obj instanceof Image) {
+ return (Image) obj;
+ } else if (obj instanceof Hashtable) {
+ try {
+ return new Image((Hashtable) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.secondaryImage, e);
+ }
+ }
+ return null;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ClusterModeStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ClusterModeStatus.java new file mode 100644 index 000000000..220f4e666 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ClusterModeStatus.java @@ -0,0 +1,96 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.CarModeStatus; +import com.ford.syncV4.proxy.rpc.enums.PowerModeQualificationStatus; +import com.ford.syncV4.proxy.rpc.enums.PowerModeStatus; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataNotificationStatus; +import com.ford.syncV4.util.DebugTool; + +public class ClusterModeStatus extends RPCStruct { + + public ClusterModeStatus() { } + public ClusterModeStatus(Hashtable hash) { + super(hash); + } + + public void setPowerModeActive(Boolean powerModeActive) { + if (powerModeActive != null) { + store.put(Names.powerModeActive, powerModeActive); + } else { + store.remove(Names.powerModeActive); + } + } + public Boolean getPowerModeActive() { + return (Boolean) store.get(Names.powerModeActive); + } + public void setPowerModeQualificationStatus(PowerModeQualificationStatus powerModeQualificationStatus) { + if (powerModeQualificationStatus != null) { + store.put(Names.powerModeQualificationStatus, powerModeQualificationStatus); + } else { + store.remove(Names.powerModeQualificationStatus); + } + } + public PowerModeQualificationStatus getPowerModeQualificationStatus() { + Object obj = store.get(Names.powerModeQualificationStatus); + if (obj instanceof PowerModeQualificationStatus) { + return (PowerModeQualificationStatus) obj; + } else if (obj instanceof String) { + PowerModeQualificationStatus theCode = null; + try { + theCode = PowerModeQualificationStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.powerModeQualificationStatus, e); + } + return theCode; + } + return null; + } + public void setCarModeStatus(CarModeStatus carModeStatus) { + if (carModeStatus != null) { + store.put(Names.carModeStatus, carModeStatus); + } else { + store.remove(Names.carModeStatus); + } + } + public CarModeStatus getCarModeStatus() { + Object obj = store.get(Names.carModeStatus); + if (obj instanceof CarModeStatus) { + return (CarModeStatus) obj; + } else if (obj instanceof String) { + CarModeStatus theCode = null; + try { + theCode = CarModeStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.carModeStatus, e); + } + return theCode; + } + return null; + } + public void setPowerModeStatus(PowerModeStatus powerModeStatus) { + if (powerModeStatus != null) { + store.put(Names.powerModeStatus, powerModeStatus); + } else { + store.remove(Names.powerModeStatus); + } + } + public PowerModeStatus getPowerModeStatus() { + Object obj = store.get(Names.powerModeStatus); + if (obj instanceof PowerModeStatus) { + return (PowerModeStatus) obj; + } else if (obj instanceof String) { + PowerModeStatus theCode = null; + try { + theCode = PowerModeStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.powerModeStatus, e); + } + return theCode; + } + return null; + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/CreateInteractionChoiceSet.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/CreateInteractionChoiceSet.java new file mode 100644 index 000000000..63e6f68ba --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/CreateInteractionChoiceSet.java @@ -0,0 +1,48 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class CreateInteractionChoiceSet extends RPCRequest {
+
+ public CreateInteractionChoiceSet() {
+ super("CreateInteractionChoiceSet");
+ }
+ public CreateInteractionChoiceSet(Hashtable hash) {
+ super(hash);
+ }
+ public Integer getInteractionChoiceSetID() {
+ return (Integer) parameters.get( Names.interactionChoiceSetID );
+ }
+ public void setInteractionChoiceSetID( Integer interactionChoiceSetID ) {
+ if (interactionChoiceSetID != null) {
+ parameters.put(Names.interactionChoiceSetID, interactionChoiceSetID );
+ }
+ }
+ public Vector<Choice> getChoiceSet() {
+ if (parameters.get(Names.choiceSet) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.choiceSet);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof Choice) {
+ return (Vector<Choice>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<Choice> newList = new Vector<Choice>();
+ for (Object hashObj : list) {
+ newList.add(new Choice((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setChoiceSet( Vector<Choice> choiceSet ) {
+ if (choiceSet != null) {
+ parameters.put(Names.choiceSet, choiceSet );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/CreateInteractionChoiceSetResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/CreateInteractionChoiceSetResponse.java new file mode 100644 index 000000000..b1772cdd4 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/CreateInteractionChoiceSetResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class CreateInteractionChoiceSetResponse extends RPCResponse {
+
+ public CreateInteractionChoiceSetResponse() {
+ super("CreateInteractionChoiceSet");
+ }
+ public CreateInteractionChoiceSetResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DIDResult.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DIDResult.java new file mode 100644 index 000000000..a41d54993 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DIDResult.java @@ -0,0 +1,73 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataResultCode; +import com.ford.syncV4.util.DebugTool; + +import java.util.Hashtable; + +public class DIDResult extends RPCStruct { + public DIDResult() { + } + + public DIDResult(Hashtable hash) { + super(hash); + } + + public VehicleDataResultCode getResultCode() { + Object obj = store.get(Names.resultCode); + if (obj instanceof VehicleDataResultCode) { + return (VehicleDataResultCode) obj; + } else if (obj instanceof String) { + try { + return VehicleDataResultCode.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.resultCode, e); + } + } + return null; + } + + public void setResultCode(VehicleDataResultCode resultCode) { + if (resultCode != null) { + store.put(Names.resultCode, resultCode); + } else { + store.remove(Names.resultCode); + } + } + + public Integer getDidLocation() { + final Object o = store.get(Names.didLocation); + if (o instanceof Integer) { + return (Integer) o; + } + return null; + } + + public void setDidLocation(Integer didLocation) { + if (didLocation != null) { + store.put(Names.didLocation, didLocation); + } else { + store.remove(Names.didLocation); + } + } + + public String getData() { + final Object o = store.get(Names.data); + if (o instanceof String) { + return (String) o; + } + return null; + } + + public void setData(String data) { + if (data != null) { + store.put(Names.data, data); + } else { + store.remove(Names.data); + } + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DTC.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DTC.java new file mode 100644 index 000000000..9853e3266 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DTC.java @@ -0,0 +1,35 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; + +public class DTC extends RPCStruct { + + public DTC() { } + public DTC(Hashtable hash) { + super(hash); + } + public void setIdentifier(String identifier) { + if (identifier != null) { + store.put(Names.identifier, identifier); + } else { + store.remove(Names.identifier); + } + } + public String getIdentifier() { + return (String) store.get(Names.identifier); + } + public void setStatusByte(String statusByte) { + if (statusByte != null) { + store.put(Names.statusByte, statusByte); + } else { + store.remove(Names.statusByte); + } + } + public String getStatusByte() { + return (String) store.get(Names.statusByte); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteCommand.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteCommand.java new file mode 100644 index 000000000..d08f8658e --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteCommand.java @@ -0,0 +1,24 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class DeleteCommand extends RPCRequest {
+
+ public DeleteCommand() {
+ super("DeleteCommand");
+ }
+ public DeleteCommand(Hashtable hash) {
+ super(hash);
+ }
+ public Integer getCmdID() {
+ return (Integer) parameters.get( Names.cmdID );
+ }
+ public void setCmdID( Integer cmdID ) {
+ if (cmdID != null) {
+ parameters.put(Names.cmdID, cmdID );
+ }
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteCommandResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteCommandResponse.java new file mode 100644 index 000000000..7149a4d83 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteCommandResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class DeleteCommandResponse extends RPCResponse {
+
+ public DeleteCommandResponse() {
+ super("DeleteCommand");
+ }
+ public DeleteCommandResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteFile.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteFile.java new file mode 100644 index 000000000..2eac7f079 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteFile.java @@ -0,0 +1,26 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; + +public class DeleteFile extends RPCRequest { + + public DeleteFile() { + super("DeleteFile"); + } + public DeleteFile(Hashtable hash) { + super(hash); + } + public void setSyncFileName(String syncFileName) { + if (syncFileName != null) { + parameters.put(Names.syncFileName, syncFileName); + } else { + parameters.remove(Names.syncFileName); + } + } + public String getSyncFileName() { + return (String) parameters.get(Names.syncFileName); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteFileResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteFileResponse.java new file mode 100644 index 000000000..b11ae1545 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteFileResponse.java @@ -0,0 +1,26 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCResponse; +import com.ford.syncV4.proxy.constants.Names; + +public class DeleteFileResponse extends RPCResponse { + + public DeleteFileResponse() { + super("DeleteFile"); + } + public DeleteFileResponse(Hashtable hash) { + super(hash); + } + public void setSpaceAvailable(Integer spaceAvailable) { + if (spaceAvailable != null) { + parameters.put(Names.spaceAvailable, spaceAvailable); + } else { + parameters.remove(Names.spaceAvailable); + } + } + public Integer getSpaceAvailable() { + return (Integer) parameters.get(Names.spaceAvailable); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteInteractionChoiceSet.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteInteractionChoiceSet.java new file mode 100644 index 000000000..b909a4de7 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteInteractionChoiceSet.java @@ -0,0 +1,24 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class DeleteInteractionChoiceSet extends RPCRequest {
+
+ public DeleteInteractionChoiceSet() {
+ super("DeleteInteractionChoiceSet");
+ }
+ public DeleteInteractionChoiceSet(Hashtable hash) {
+ super(hash);
+ }
+ public Integer getInteractionChoiceSetID() {
+ return (Integer) parameters.get( Names.interactionChoiceSetID );
+ }
+ public void setInteractionChoiceSetID( Integer interactionChoiceSetID ) {
+ if (interactionChoiceSetID != null) {
+ parameters.put(Names.interactionChoiceSetID, interactionChoiceSetID );
+ }
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteInteractionChoiceSetResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteInteractionChoiceSetResponse.java new file mode 100644 index 000000000..69bda4f2d --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteInteractionChoiceSetResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class DeleteInteractionChoiceSetResponse extends RPCResponse {
+
+ public DeleteInteractionChoiceSetResponse() {
+ super("DeleteInteractionChoiceSet");
+ }
+ public DeleteInteractionChoiceSetResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteSubMenu.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteSubMenu.java new file mode 100644 index 000000000..a4a511690 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteSubMenu.java @@ -0,0 +1,24 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class DeleteSubMenu extends RPCRequest {
+
+ public DeleteSubMenu() {
+ super("DeleteSubMenu");
+ }
+ public DeleteSubMenu(Hashtable hash) {
+ super(hash);
+ }
+ public Integer getMenuID() {
+ return (Integer) parameters.get( Names.menuID );
+ }
+ public void setMenuID( Integer menuID ) {
+ if (menuID != null) {
+ parameters.put(Names.menuID, menuID );
+ }
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteSubMenuResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteSubMenuResponse.java new file mode 100644 index 000000000..d0ce7df06 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeleteSubMenuResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class DeleteSubMenuResponse extends RPCResponse {
+
+ public DeleteSubMenuResponse() {
+ super("DeleteSubMenu");
+ }
+ public DeleteSubMenuResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeviceStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeviceStatus.java new file mode 100644 index 000000000..d2e7f5785 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeviceStatus.java @@ -0,0 +1,163 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.DeviceLevelStatus; +import com.ford.syncV4.proxy.rpc.enums.PrimaryAudioSource; +import com.ford.syncV4.util.DebugTool; + +public class DeviceStatus extends RPCStruct { + + public DeviceStatus() {} + public DeviceStatus(Hashtable hash) { + super(hash); + } + public void setVoiceRecOn(Boolean voiceRecOn) { + if (voiceRecOn != null) { + store.put(Names.voiceRecOn, voiceRecOn); + } else { + store.remove(Names.voiceRecOn); + } + } + public Boolean getVoiceRecOn() { + return (Boolean) store.get(Names.voiceRecOn); + } + public void setBtIconOn(Boolean btIconOn) { + if (btIconOn != null) { + store.put(Names.btIconOn, btIconOn); + } else { + store.remove(Names.btIconOn); + } + } + public Boolean getBtIconOn() { + return (Boolean) store.get(Names.btIconOn); + } + public void setCallActive(Boolean callActive) { + if (callActive != null) { + store.put(Names.callActive, callActive); + } else { + store.remove(Names.callActive); + } + } + public Boolean getCallActive() { + return (Boolean) store.get(Names.callActive); + } + public void setPhoneRoaming(Boolean phoneRoaming) { + if (phoneRoaming != null) { + store.put(Names.phoneRoaming, phoneRoaming); + } else { + store.remove(Names.phoneRoaming); + } + } + public Boolean getPhoneRoaming() { + return (Boolean) store.get(Names.phoneRoaming); + } + public void setTextMsgAvailable(Boolean textMsgAvailable) { + if (textMsgAvailable != null) { + store.put(Names.textMsgAvailable, textMsgAvailable); + } else { + store.remove(Names.textMsgAvailable); + } + } + public Boolean getTextMsgAvailable() { + return (Boolean) store.get(Names.textMsgAvailable); + } + public void setBattLevelStatus(DeviceLevelStatus battLevelStatus) { + if (battLevelStatus != null) { + store.put(Names.battLevelStatus, battLevelStatus); + } else { + store.remove(Names.battLevelStatus); + } + } + public DeviceLevelStatus getBattLevelStatus() { + Object obj = store.get(Names.battLevelStatus); + if (obj instanceof DeviceLevelStatus) { + return (DeviceLevelStatus) obj; + } else if (obj instanceof String) { + DeviceLevelStatus theCode = null; + try { + theCode = DeviceLevelStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.battLevelStatus, e); + } + return theCode; + } + return null; + } + public void setStereoAudioOutputMuted(Boolean stereoAudioOutputMuted) { + if (stereoAudioOutputMuted != null) { + store.put(Names.stereoAudioOutputMuted, stereoAudioOutputMuted); + } else { + store.remove(Names.stereoAudioOutputMuted); + } + } + public Boolean getStereoAudioOutputMuted() { + return (Boolean) store.get(Names.stereoAudioOutputMuted); + } + public void setMonoAudioOutputMuted(Boolean monoAudioOutputMuted) { + if (monoAudioOutputMuted != null) { + store.put(Names.monoAudioOutputMuted, monoAudioOutputMuted); + } else { + store.remove(Names.monoAudioOutputMuted); + } + } + public Boolean getMonoAudioOutputMuted() { + return (Boolean) store.get(Names.monoAudioOutputMuted); + } + public void setSignalLevelStatus(DeviceLevelStatus signalLevelStatus) { + if (signalLevelStatus != null) { + store.put(Names.signalLevelStatus, signalLevelStatus); + } else { + store.remove(Names.signalLevelStatus); + } + } + public DeviceLevelStatus getSignalLevelStatus() { + Object obj = store.get(Names.signalLevelStatus); + if (obj instanceof DeviceLevelStatus) { + return (DeviceLevelStatus) obj; + } else if (obj instanceof String) { + DeviceLevelStatus theCode = null; + try { + theCode = DeviceLevelStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.signalLevelStatus, e); + } + return theCode; + } + return null; + } + public void setPrimaryAudioSource(PrimaryAudioSource primaryAudioSource) { + if (primaryAudioSource != null) { + store.put(Names.primaryAudioSource, primaryAudioSource); + } else { + store.remove(Names.primaryAudioSource); + } + } + public PrimaryAudioSource getPrimaryAudioSource() { + Object obj = store.get(Names.primaryAudioSource); + if (obj instanceof PrimaryAudioSource) { + return (PrimaryAudioSource) obj; + } else if (obj instanceof String) { + PrimaryAudioSource theCode = null; + try { + theCode = PrimaryAudioSource.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.primaryAudioSource, e); + } + return theCode; + } + return null; + } + public void setECallEventActive(Boolean eCallEventActive) { + if (eCallEventActive != null) { + store.put(Names.eCallEventActive, eCallEventActive); + } else { + store.remove(Names.eCallEventActive); + } + } + public Boolean getECallEventActive() { + return (Boolean) store.get(Names.eCallEventActive); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DiagnosticMessage.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DiagnosticMessage.java new file mode 100644 index 000000000..d2e0e9496 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DiagnosticMessage.java @@ -0,0 +1,71 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; + +import java.util.Hashtable; +import java.util.Vector; + +public class DiagnosticMessage extends RPCRequest { + public DiagnosticMessage() { + super("DiagnosticMessage"); + } + + public DiagnosticMessage(Hashtable hash) { + super(hash); + } + + public Integer getTargetID() { + final Object o = parameters.get(Names.targetID); + if (o instanceof Integer) { + return (Integer) o; + } + return null; + } + + public void setTargetID(Integer targetID) { + if (targetID != null) { + parameters.put(Names.targetID, targetID); + } else { + parameters.remove(Names.targetID); + } + } + + public Integer getMessageLength() { + final Object o = parameters.get(Names.messageLength); + if (o instanceof Integer) { + return (Integer) o; + } + return null; + } + + public void setMessageLength(Integer messageLength) { + if (messageLength != null) { + parameters.put(Names.messageLength, messageLength); + } else { + parameters.remove(Names.messageLength); + } + } + + public Vector<Integer> getMessageData() { + final Object o = parameters.get(Names.messageData); + if (o instanceof Vector<?>) { + Vector<?> list = (Vector<?>) o; + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof Integer) { + return (Vector<Integer>) list; + } + } + } + return null; + } + + public void setMessageData(Vector<Integer> messageData) { + if (messageData != null) { + parameters.put(Names.messageData, messageData); + } else { + parameters.remove(Names.messageData); + } + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DiagnosticMessageResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DiagnosticMessageResponse.java new file mode 100644 index 000000000..2997e9ccf --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DiagnosticMessageResponse.java @@ -0,0 +1,39 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCResponse; +import com.ford.syncV4.proxy.constants.Names; + +import java.util.Hashtable; +import java.util.Vector; + +public class DiagnosticMessageResponse extends RPCResponse { + public DiagnosticMessageResponse() { + super("DiagnosticMessage"); + } + + public DiagnosticMessageResponse(Hashtable hash) { + super(hash); + } + + public Vector<Integer> getMessageDataResult() { + final Object o = parameters.get(Names.messageDataResult); + if (o instanceof Vector<?>) { + Vector<?> list = (Vector<?>) o; + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof Integer) { + return (Vector<Integer>) list; + } + } + } + return null; + } + + public void setMessageDataResult(Vector<Integer> messageDataResult) { + if (messageDataResult != null) { + parameters.put(Names.messageDataResult, messageDataResult); + } else { + parameters.remove(Names.messageDataResult); + } + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DisplayCapabilities.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DisplayCapabilities.java new file mode 100644 index 000000000..68de2bbd2 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DisplayCapabilities.java @@ -0,0 +1,201 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCStruct;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.DisplayType;
+import com.ford.syncV4.proxy.rpc.enums.MediaClockFormat;
+import com.ford.syncV4.util.DebugTool;
+
+public class DisplayCapabilities extends RPCStruct {
+
+ public DisplayCapabilities() { }
+ public DisplayCapabilities(Hashtable hash) {
+ super(hash);
+ }
+
+ public DisplayType getDisplayType() {
+ Object obj = store.get(Names.displayType);
+ if (obj instanceof DisplayType) {
+ return (DisplayType) obj;
+ } else if (obj instanceof String) {
+ DisplayType theCode = null;
+ try {
+ theCode = DisplayType.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.displayType, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setDisplayType( DisplayType displayType ) {
+ if (displayType != null) {
+ store.put(Names.displayType, displayType );
+ }
+ }
+ public Vector<TextField> getTextFields() {
+ if (store.get(Names.textFields) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)store.get(Names.textFields);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof TextField) {
+ return (Vector<TextField>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<TextField> newList = new Vector<TextField>();
+ for (Object hashObj : list) {
+ newList.add(new TextField((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setTextFields( Vector<TextField> textFields ) {
+ if (textFields != null) {
+ store.put(Names.textFields, textFields );
+ }
+ }
+
+ public Vector<ImageField> getImageFields() {
+ if (store.get(Names.imageFields) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>) store.get(Names.imageFields);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof ImageField) {
+ return (Vector<ImageField>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<ImageField> newList = new Vector<ImageField>();
+ for (Object hashObj : list) {
+ newList.add(new ImageField((Hashtable) hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void setImageFields(Vector<ImageField> imageFields) {
+ if (imageFields != null) {
+ store.put(Names.imageFields, imageFields);
+ } else {
+ store.remove(Names.imageFields);
+ }
+ }
+
+ public Vector<MediaClockFormat> getMediaClockFormats() {
+ if (store.get(Names.mediaClockFormats) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)store.get(Names.mediaClockFormats);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof MediaClockFormat) {
+ return (Vector<MediaClockFormat>) list;
+ } else if (obj instanceof String) {
+ Vector<MediaClockFormat> newList = new Vector<MediaClockFormat>();
+ for (Object hashObj : list) {
+ String strFormat = (String)hashObj;
+ MediaClockFormat toAdd = null;
+ try {
+ toAdd = MediaClockFormat.valueForString(strFormat);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse MediaClockFormat from " + getClass().getSimpleName() + "." + Names.mediaClockFormats, e);
+ }
+ if (toAdd != null) {
+ newList.add(toAdd);
+ }
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setMediaClockFormats( Vector<MediaClockFormat> mediaClockFormats ) {
+ if (mediaClockFormats != null) {
+ store.put(Names.mediaClockFormats, mediaClockFormats );
+ }
+ }
+
+ public void setGraphicSupported(Boolean graphicSupported) {
+ if (graphicSupported != null) {
+ store.put(Names.graphicSupported, graphicSupported);
+ } else {
+ store.remove(Names.graphicSupported);
+ }
+ }
+
+ public Boolean getGraphicSupported() {
+ final Object o = store.get(Names.graphicSupported);
+ if (o instanceof Boolean) {
+ return (Boolean) o;
+ }
+ return null;
+ }
+
+ public Vector<String> getTemplatesAvailable() {
+ if (store.get(Names.templatesAvailable) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>) store.get(Names.templatesAvailable);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof String) {
+ return (Vector<String>) list;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void setTemplatesAvailable(Vector<String> templatesAvailable) {
+ if (templatesAvailable != null) {
+ store.put(Names.templatesAvailable, templatesAvailable);
+ } else {
+ store.remove(Names.templatesAvailable);
+ }
+ }
+
+ public ScreenParams getScreenParams() {
+ Object obj = store.get(Names.screenParams);
+ if (obj instanceof ScreenParams) {
+ return (ScreenParams) obj;
+ } else if (obj instanceof Hashtable) {
+ try {
+ return new ScreenParams((Hashtable) obj);
+ } catch (Exception e) {
+ DebugTool.logError(
+ "Failed to parse " + getClass().getSimpleName() + "." +
+ Names.screenParams, e);
+ }
+ }
+ return null;
+ }
+
+ public void setScreenParams(ScreenParams screenParams) {
+ if (screenParams != null) {
+ store.put(Names.screenParams, screenParams);
+ } else {
+ store.remove(Names.screenParams);
+ }
+ }
+
+ public void setNumCustomPresetsAvailable(
+ Integer numCustomPresetsAvailable) {
+ if (numCustomPresetsAvailable != null) {
+ store.put(Names.numCustomPresetsAvailable,
+ numCustomPresetsAvailable);
+ } else {
+ store.remove(Names.numCustomPresetsAvailable);
+ }
+ }
+
+ public Integer getNumCustomPresetsAvailable() {
+ final Object o = store.get(Names.numCustomPresetsAvailable);
+ if (o instanceof Integer) {
+ return (Integer) o;
+ }
+ return null;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ECallInfo.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ECallInfo.java new file mode 100644 index 000000000..d9c996500 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ECallInfo.java @@ -0,0 +1,84 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.ECallConfirmationStatus; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataNotificationStatus; +import com.ford.syncV4.util.DebugTool; + +public class ECallInfo extends RPCStruct { + + public ECallInfo() { } + public ECallInfo(Hashtable hash) { + super(hash); + } + + public void setECallNotificationStatus(VehicleDataNotificationStatus eCallNotificationStatus) { + if (eCallNotificationStatus != null) { + store.put(Names.eCallNotificationStatus, eCallNotificationStatus); + } else { + store.remove(Names.eCallNotificationStatus); + } + } + public VehicleDataNotificationStatus getECallNotificationStatus() { + Object obj = store.get(Names.eCallNotificationStatus); + if (obj instanceof VehicleDataNotificationStatus) { + return (VehicleDataNotificationStatus) obj; + } else if (obj instanceof String) { + VehicleDataNotificationStatus theCode = null; + try { + theCode = VehicleDataNotificationStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.eCallNotificationStatus, e); + } + return theCode; + } + return null; + } + public void setAuxECallNotificationStatus(VehicleDataNotificationStatus auxECallNotificationStatus) { + if (auxECallNotificationStatus != null) { + store.put(Names.auxECallNotificationStatus, auxECallNotificationStatus); + } else { + store.remove(Names.auxECallNotificationStatus); + } + } + public VehicleDataNotificationStatus getAuxECallNotificationStatus() { + Object obj = store.get(Names.auxECallNotificationStatus); + if (obj instanceof VehicleDataNotificationStatus) { + return (VehicleDataNotificationStatus) obj; + } else if (obj instanceof String) { + VehicleDataNotificationStatus theCode = null; + try { + theCode = VehicleDataNotificationStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.auxECallNotificationStatus, e); + } + return theCode; + } + return null; + } + public void setECallConfirmationStatus(ECallConfirmationStatus eCallConfirmationStatus) { + if (eCallConfirmationStatus != null) { + store.put(Names.eCallConfirmationStatus, eCallConfirmationStatus); + } else { + store.remove(Names.eCallConfirmationStatus); + } + } + public ECallConfirmationStatus getECallConfirmationStatus() { + Object obj = store.get(Names.eCallConfirmationStatus); + if (obj instanceof ECallConfirmationStatus) { + return (ECallConfirmationStatus) obj; + } else if (obj instanceof String) { + ECallConfirmationStatus theCode = null; + try { + theCode = ECallConfirmationStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.eCallConfirmationStatus, e); + } + return theCode; + } + return null; + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EVInfo.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EVInfo.java new file mode 100644 index 000000000..9fbba285a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EVInfo.java @@ -0,0 +1,69 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.MaintenanceModeStatus; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataActiveStatus; +import com.ford.syncV4.util.DebugTool; + +public class EVInfo extends RPCStruct { + + public EVInfo() {} + public EVInfo(Hashtable hash) { + super(hash); + } + public void setElectricFuelConsumption(Float electricFuelConsumption) { + if (electricFuelConsumption != null) { + store.put(Names.electricFuelConsumption, electricFuelConsumption); + } else { + store.remove(Names.electricFuelConsumption); + } + } + public Float getElectricFuelConsumption() { + return (Float) store.get(Names.electricFuelConsumption); + } + public void setStateOfCharge(Float stateOfCharge) { + if (stateOfCharge != null) { + store.put(Names.stateOfCharge, stateOfCharge); + } else { + store.remove(Names.stateOfCharge); + } + } + public Float getStateOfCharge() { + return (Float) store.get(Names.stateOfCharge); + } + public void setFuelMaintenanceMode(MaintenanceModeStatus fuelMaintenanceMode) { + if (fuelMaintenanceMode != null) { + store.put(Names.fuelMaintenanceMode, fuelMaintenanceMode); + } else { + store.remove(Names.fuelMaintenanceMode); + } + } + public MaintenanceModeStatus getFuelMaintenanceMode() { + Object obj = store.get(Names.fuelMaintenanceMode); + if (obj instanceof MaintenanceModeStatus) { + return (MaintenanceModeStatus) obj; + } else if (obj instanceof String) { + MaintenanceModeStatus theCode = null; + try { + theCode = MaintenanceModeStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.fuelMaintenanceMode, e); + } + return theCode; + } + return null; + } + public void setDistanceToEmpty(Float distanceToEmpty) { + if (distanceToEmpty != null) { + store.put(Names.distanceToEmpty, distanceToEmpty); + } else { + store.remove(Names.distanceToEmpty); + } + } + public Float getDistanceToEmpty() { + return (Float) store.get(Names.distanceToEmpty); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EmergencyEvent.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EmergencyEvent.java new file mode 100644 index 000000000..1810a9538 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EmergencyEvent.java @@ -0,0 +1,130 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.EmergencyEventType; +import com.ford.syncV4.proxy.rpc.enums.FuelCutoffStatus; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataEventStatus; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataNotificationStatus; +import com.ford.syncV4.util.DebugTool; + +public class EmergencyEvent extends RPCStruct { + + public EmergencyEvent() { } + public EmergencyEvent(Hashtable hash) { + super(hash); + } + + public void setEmergencyEventType(EmergencyEventType emergencyEventType) { + if (emergencyEventType != null) { + store.put(Names.emergencyEventType, emergencyEventType); + } else { + store.remove(Names.emergencyEventType); + } + } + public EmergencyEventType getEmergencyEventType() { + Object obj = store.get(Names.emergencyEventType); + if (obj instanceof EmergencyEventType) { + return (EmergencyEventType) obj; + } else if (obj instanceof String) { + EmergencyEventType theCode = null; + try { + theCode = EmergencyEventType.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.emergencyEventType, e); + } + return theCode; + } + return null; + } + public void setFuelCutoffStatus(FuelCutoffStatus fuelCutoffStatus) { + if (fuelCutoffStatus != null) { + store.put(Names.fuelCutoffStatus, fuelCutoffStatus); + } else { + store.remove(Names.fuelCutoffStatus); + } + } + public FuelCutoffStatus getFuelCutoffStatus() { + Object obj = store.get(Names.fuelCutoffStatus); + if (obj instanceof FuelCutoffStatus) { + return (FuelCutoffStatus) obj; + } else if (obj instanceof String) { + FuelCutoffStatus theCode = null; + try { + theCode = FuelCutoffStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.fuelCutoffStatus, e); + } + return theCode; + } + return null; + } + public void setRolloverEvent(VehicleDataEventStatus rolloverEvent) { + if (rolloverEvent != null) { + store.put(Names.rolloverEvent, rolloverEvent); + } else { + store.remove(Names.rolloverEvent); + } + } + public VehicleDataEventStatus getRolloverEvent() { + Object obj = store.get(Names.rolloverEvent); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.rolloverEvent, e); + } + return theCode; + } + return null; + } + public void setMaximumChangeVelocity(VehicleDataEventStatus maximumChangeVelocity) { + if (maximumChangeVelocity != null) { + store.put(Names.maximumChangeVelocity, maximumChangeVelocity); + } else { + store.remove(Names.maximumChangeVelocity); + } + } + public VehicleDataEventStatus getMaximumChangeVelocity() { + Object obj = store.get(Names.maximumChangeVelocity); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.maximumChangeVelocity, e); + } + return theCode; + } + return null; + } + public void setMultipleEvents(VehicleDataEventStatus multipleEvents) { + if (multipleEvents != null) { + store.put(Names.multipleEvents, multipleEvents); + } else { + store.remove(Names.multipleEvents); + } + } + public VehicleDataEventStatus getMultipleEvents() { + Object obj = store.get(Names.multipleEvents); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.multipleEvents, e); + } + return theCode; + } + return null; + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EncodedSyncPData.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EncodedSyncPData.java new file mode 100644 index 000000000..47ce88b6b --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EncodedSyncPData.java @@ -0,0 +1,35 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class EncodedSyncPData extends RPCRequest {
+ public EncodedSyncPData() {
+ super("EncodedSyncPData");
+ }
+
+ public EncodedSyncPData(Hashtable hash) {
+ super(hash);
+ }
+
+ public Vector<String> getData() {
+ if (parameters.get(Names.data) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.data);
+ if (list != null && list.size()>0) {
+ Object obj = list.get(0);
+ if (obj instanceof String) {
+ return (Vector<String>) list;
+ }
+ }
+ }
+ return null;
+ }
+ public void setData( Vector<String> data ) {
+ if ( data!= null) {
+ parameters.put(Names.data, data );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EncodedSyncPDataResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EncodedSyncPDataResponse.java new file mode 100644 index 000000000..a720f2dc8 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EncodedSyncPDataResponse.java @@ -0,0 +1,14 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class EncodedSyncPDataResponse extends RPCResponse {
+ public EncodedSyncPDataResponse() {
+ super("EncodedSyncPData");
+ }
+ public EncodedSyncPDataResponse(Hashtable hash) {
+ super(hash);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EndAudioPassThru.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EndAudioPassThru.java new file mode 100644 index 000000000..4259f00bf --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EndAudioPassThru.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCRequest; + +public class EndAudioPassThru extends RPCRequest { + + public EndAudioPassThru() { + super("EndAudioPassThru"); + } + public EndAudioPassThru(Hashtable hash) { + super(hash); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EndAudioPassThruResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EndAudioPassThruResponse.java new file mode 100644 index 000000000..c20b39eb1 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/EndAudioPassThruResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCResponse; + +public class EndAudioPassThruResponse extends RPCResponse { + + public EndAudioPassThruResponse() { + super("EndAudioPassThru"); + } + public EndAudioPassThruResponse(Hashtable hash) { + super(hash); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/FuelEconomyInformation.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/FuelEconomyInformation.java new file mode 100644 index 000000000..79302975f --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/FuelEconomyInformation.java @@ -0,0 +1,54 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; + +public class FuelEconomyInformation extends RPCStruct { + + public FuelEconomyInformation() { } + public FuelEconomyInformation(Hashtable hash) { + super(hash); + } + public void setFuelEconomySinceLastReset(Float fuelEconomySinceLastReset) { + if (fuelEconomySinceLastReset != null) { + store.put(Names.fuelEconomySinceLastReset, fuelEconomySinceLastReset); + } else { + store.remove(Names.fuelEconomySinceLastReset); + } + } + public Float getFuelEconomySinceLastReset() { + return (Float) store.get(Names.fuelEconomySinceLastReset); + } + public void setCurrentTripFuelEconomy(Float currentTripFuelEconomy) { + if (currentTripFuelEconomy != null) { + store.put(Names.currentTripFuelEconomy, currentTripFuelEconomy); + } else { + store.remove(Names.currentTripFuelEconomy); + } + } + public Float getCurrentTripFuelEconomy() { + return (Float) store.get(Names.currentTripFuelEconomy); + } + public void setAverageTripFuelEconomy(Float averageTripFuelEconomy) { + if (averageTripFuelEconomy != null) { + store.put(Names.averageTripFuelEconomy, averageTripFuelEconomy); + } else { + store.remove(Names.averageTripFuelEconomy); + } + } + public Float getAverageTripFuelEconomy() { + return (Float) store.get(Names.averageTripFuelEconomy); + } + public void setCurrentCycleFuelEconomy(Float currentCycleFuelEconomy) { + if (currentCycleFuelEconomy != null) { + store.put(Names.currentCycleFuelEconomy, currentCycleFuelEconomy); + } else { + store.remove(Names.currentCycleFuelEconomy); + } + } + public Float getCurrentCycleFuelEconomy() { + return (Float) store.get(Names.currentCycleFuelEconomy); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GPSData.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GPSData.java new file mode 100644 index 000000000..ea458b1e0 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GPSData.java @@ -0,0 +1,222 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.CompassDirection; +import com.ford.syncV4.proxy.rpc.enums.Dimension; +import com.ford.syncV4.proxy.rpc.enums.DisplayType; +import com.ford.syncV4.util.DebugTool; + +public class GPSData extends RPCStruct { + + public GPSData() { } + public GPSData(Hashtable hash) { + super(hash); + } + public void setLongitudeDegrees(Integer longitudeDegrees) { + if (longitudeDegrees != null) { + store.put(Names.longitudeDegrees, longitudeDegrees); + } else { + store.remove(Names.longitudeDegrees); + } + } + public Integer getLongitudeDegrees() { + return (Integer) store.get(Names.longitudeDegrees); + } + public void setLatitudeDegrees(Integer latitudeDegrees) { + if (latitudeDegrees != null) { + store.put(Names.latitudeDegrees, latitudeDegrees); + } else { + store.remove(Names.latitudeDegrees); + } + } + public Integer getLatitudeDegrees() { + return (Integer) store.get(Names.latitudeDegrees); + } + public void setUtcYear(Integer utcYear) { + if (utcYear != null) { + store.put(Names.utcYear, utcYear); + } else { + store.remove(Names.utcYear); + } + } + public Integer getUtcYear() { + return (Integer) store.get(Names.utcYear); + } + public void setUtcMonth(Integer utcMonth) { + if (utcMonth != null) { + store.put(Names.utcMonth, utcMonth); + } else { + store.remove(Names.utcMonth); + } + } + public Integer getUtcMonth() { + return (Integer) store.get(Names.utcMonth); + } + public void setUtcDay(Integer utcDay) { + if (utcDay != null) { + store.put(Names.utcDay, utcDay); + } else { + store.remove(Names.utcDay); + } + } + public Integer getUtcDay() { + return (Integer) store.get(Names.utcDay); + } + public void setUtcHours(Integer utcHours) { + if (utcHours != null) { + store.put(Names.utcHours, utcHours); + } else { + store.remove(Names.utcHours); + } + } + public Integer getUtcHours() { + return (Integer) store.get(Names.utcHours); + } + public void setUtcMinutes(Integer utcMinutes) { + if (utcMinutes != null) { + store.put(Names.utcMinutes, utcMinutes); + } else { + store.remove(Names.utcMinutes); + } + } + public Integer getUtcMinutes() { + return (Integer) store.get(Names.utcMinutes); + } + public void setUtcSeconds(Integer utcSeconds) { + if (utcSeconds != null) { + store.put(Names.utcSeconds, utcSeconds); + } else { + store.remove(Names.utcSeconds); + } + } + public Integer getUtcSeconds() { + return (Integer) store.get(Names.utcSeconds); + } + public void setCompassDirection(CompassDirection compassDirection) { + if (compassDirection != null) { + store.put(Names.compassDirection, compassDirection); + } else { + store.remove(Names.compassDirection); + } + } + public CompassDirection getCompassDirection() { + Object obj = store.get(Names.compassDirection); + if (obj instanceof CompassDirection) { + return (CompassDirection) obj; + } else if (obj instanceof String) { + CompassDirection theCode = null; + try { + theCode = CompassDirection.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.compassDirection, e); + } + return theCode; + } + return null; + } + public void setPdop(Integer pdop) { + if (pdop != null) { + store.put(Names.pdop, pdop); + } else { + store.remove(Names.pdop); + } + } + public Integer getPdop() { + return (Integer) store.get(Names.pdop); + } + public void setHdop(Integer hdop) { + if (hdop != null) { + store.put(Names.hdop, hdop); + } else { + store.remove(Names.hdop); + } + } + public Integer getHdop() { + return (Integer) store.get(Names.hdop); + } + public void setVdop(Integer vdop) { + if (vdop != null) { + store.put(Names.vdop, vdop); + } else { + store.remove(Names.vdop); + } + } + public Integer getVdop() { + return (Integer) store.get(Names.vdop); + } + public void setActual(Boolean actual) { + if (actual != null) { + store.put(Names.actual, actual); + } else { + store.remove(Names.actual); + } + } + public Boolean getActual() { + return (Boolean) store.get(Names.actual); + } + public void setSatellites(Integer satellites) { + if (satellites != null) { + store.put(Names.satellites, satellites); + } else { + store.remove(Names.satellites); + } + } + public Integer getSatellites() { + return (Integer) store.get(Names.satellites); + } + public void setDimension(Dimension dimension) { + if (dimension != null) { + store.put(Names.dimension, dimension); + } else { + store.remove(Names.dimension); + } + } + public Dimension getDimension() { + Object obj = store.get(Names.dimension); + if (obj instanceof Dimension) { + return (Dimension) obj; + } else if (obj instanceof String) { + Dimension theCode = null; + try { + theCode = Dimension.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.dimension, e); + } + return theCode; + } + return null; + } + public void setAltitude(Integer altitude) { + if (altitude != null) { + store.put(Names.altitude, altitude); + } else { + store.remove(Names.altitude); + } + } + public Integer getAltitude() { + return (Integer) store.get(Names.altitude); + } + public void setHeading(Integer heading) { + if (heading != null) { + store.put(Names.heading, heading); + } else { + store.remove(Names.heading); + } + } + public Integer getHeading() { + return (Integer) store.get(Names.heading); + } + public void setSpeed(Integer speed) { + if (speed != null) { + store.put(Names.speed, speed); + } else { + store.remove(Names.speed); + } + } + public Integer getSpeed() { + return (Integer) store.get(Names.speed); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GenericResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GenericResponse.java new file mode 100644 index 000000000..58e57a364 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GenericResponse.java @@ -0,0 +1,19 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+/** ************************************************************************
+/* class: GenericResponseResponse
+ * 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.
+*/
+public class GenericResponse extends RPCResponse {
+
+ public GenericResponse() {
+ super("GenericResponse");
+ }
+ public GenericResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GetDTCs.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GetDTCs.java new file mode 100644 index 000000000..334bc83ec --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GetDTCs.java @@ -0,0 +1,37 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; + +public class GetDTCs extends RPCRequest { + + public GetDTCs() { + super("GetDTCs"); + } + public GetDTCs(Hashtable hash) { + super(hash); + } + public void setEcuName(Integer ecuName) { + if (ecuName != null) { + parameters.put(Names.ecuName, ecuName); + } else { + parameters.remove(Names.ecuName); + } + } + public Integer getEcuName() { + return (Integer) parameters.get(Names.ecuName); + } + + public void setDTCMask(Integer dtcMask) { + if (dtcMask != null) { + parameters.put(Names.dtcMask, dtcMask); + } else { + parameters.remove(Names.dtcMask); + } + } + public Integer getDTCMask() { + return (Integer) parameters.get(Names.dtcMask); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GetDTCsResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GetDTCsResponse.java new file mode 100644 index 000000000..4a70e3f78 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GetDTCsResponse.java @@ -0,0 +1,42 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCResponse; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.HMILevel; +import com.ford.syncV4.proxy.rpc.enums.MediaClockFormat; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataResultCode; +import com.ford.syncV4.util.DebugTool; + +public class GetDTCsResponse extends RPCResponse { + + public GetDTCsResponse() { + super("GetDTCs"); + } + public GetDTCsResponse(Hashtable hash) { + super(hash); + } + public void setDtcList(DTC dtcList) { + if (dtcList != null) { + parameters.put(Names.dtcList, dtcList); + } else { + parameters.remove(Names.dtcList); + } + } + public DTC getDtcList() { + Object obj = parameters.get(Names.dtcList); + if (obj instanceof DTC) { + return (DTC) obj; + } else { + DTC theCode = null; + try { + theCode = new DTC((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.dtcList, e); + } + return theCode; + } + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GetVehicleData.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GetVehicleData.java new file mode 100644 index 000000000..43640e1dd --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GetVehicleData.java @@ -0,0 +1,276 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; + +import java.util.Hashtable; + +public class GetVehicleData extends RPCRequest { + + public GetVehicleData() { + super("GetVehicleData"); + } + public GetVehicleData(Hashtable hash) { + super(hash); + } + public void setGps(Boolean gps) { + if (gps != null) { + parameters.put(Names.gps, gps); + } else { + parameters.remove(Names.gps); + } + } + public Boolean getGps() { + return (Boolean) parameters.get(Names.gps); + } + public void setSpeed(Boolean speed) { + if (speed != null) { + parameters.put(Names.speed, speed); + } else { + parameters.remove(Names.speed); + } + } + public Boolean getSpeed() { + return (Boolean) parameters.get(Names.speed); + } + public void setRpm(Boolean rpm) { + if (rpm != null) { + parameters.put(Names.rpm, rpm); + } else { + parameters.remove(Names.rpm); + } + } + public Boolean getRpm() { + return (Boolean) parameters.get(Names.rpm); + } + public void setFuelLevel(Boolean fuelLevel) { + if (fuelLevel != null) { + parameters.put(Names.fuelLevel, fuelLevel); + } else { + parameters.remove(Names.fuelLevel); + } + } + public Boolean getFuelLevel() { + return (Boolean) parameters.get(Names.fuelLevel); + } + public void setFuelLevel_State(Boolean fuelLevel_State) { + if (fuelLevel_State != null) { + parameters.put(Names.fuelLevel_State, fuelLevel_State); + } else { + parameters.remove(Names.fuelLevel_State); + } + } + public Boolean getFuelLevel_State() { + return (Boolean) parameters.get(Names.fuelLevel_State); + } + public void setInstantFuelConsumption(Boolean instantFuelConsumption) { + if (instantFuelConsumption != null) { + parameters.put(Names.instantFuelConsumption, instantFuelConsumption); + } else { + parameters.remove(Names.instantFuelConsumption); + } + } + public Boolean getInstantFuelConsumption() { + return (Boolean) parameters.get(Names.instantFuelConsumption); + } + public void setExternalTemperature(Boolean externalTemperature) { + if (externalTemperature != null) { + parameters.put(Names.externalTemperature, externalTemperature); + } else { + parameters.remove(Names.externalTemperature); + } + } + public Boolean getExternalTemperature() { + return (Boolean) parameters.get(Names.externalTemperature); + } + public void setVin(Boolean vin) { + if (vin != null) { + parameters.put(Names.vin, vin); + } else { + parameters.remove(Names.vin); + } + } + public Boolean getVin() { + return (Boolean) parameters.get(Names.vin); + } + public void setPrndl(Boolean prndl) { + if (prndl != null) { + parameters.put(Names.prndl, prndl); + } else { + parameters.remove(Names.prndl); + } + } + public Boolean getPrndl() { + return (Boolean) parameters.get(Names.prndl); + } + public void setTirePressure(Boolean tirePressure) { + if (tirePressure != null) { + parameters.put(Names.tirePressure, tirePressure); + } else { + parameters.remove(Names.tirePressure); + } + } + public Boolean getTirePressure() { + return (Boolean) parameters.get(Names.tirePressure); + } + public void setOdometer(Boolean odometer) { + if (odometer != null) { + parameters.put(Names.odometer, odometer); + } else { + parameters.remove(Names.odometer); + } + } + public Boolean getOdometer() { + return (Boolean) parameters.get(Names.odometer); + } + public void setBeltStatus(Boolean beltStatus) { + if (beltStatus != null) { + parameters.put(Names.beltStatus, beltStatus); + } else { + parameters.remove(Names.beltStatus); + } + } + public Boolean getBeltStatus() { + return (Boolean) parameters.get(Names.beltStatus); + } + public void setBodyInformation(Boolean bodyInformation) { + if (bodyInformation != null) { + parameters.put(Names.bodyInformation, bodyInformation); + } else { + parameters.remove(Names.bodyInformation); + } + } + public Boolean getBodyInformation() { + return (Boolean) parameters.get(Names.bodyInformation); + } + public void setDeviceStatus(Boolean deviceStatus) { + if (deviceStatus != null) { + parameters.put(Names.deviceStatus, deviceStatus); + } else { + parameters.remove(Names.deviceStatus); + } + } + public Boolean getDeviceStatus() { + return (Boolean) parameters.get(Names.deviceStatus); + } + public void setDriverBraking(Boolean driverBraking) { + if (driverBraking != null) { + parameters.put(Names.driverBraking, driverBraking); + } else { + parameters.remove(Names.driverBraking); + } + } + public Boolean getDriverBraking() { + return (Boolean) parameters.get(Names.driverBraking); + } + public void setWiperStatus(Boolean wiperStatus) { + if (wiperStatus != null) { + parameters.put(Names.wiperStatus, wiperStatus); + } else { + parameters.remove(Names.wiperStatus); + } + } + public Boolean getWiperStatus() { + return (Boolean) parameters.get(Names.wiperStatus); + } + public void setHeadLampStatus(Boolean headLampStatus) { + if (headLampStatus != null) { + parameters.put(Names.headLampStatus, headLampStatus); + } else { + parameters.remove(Names.headLampStatus); + } + } + public Boolean getHeadLampStatus() { + return (Boolean) parameters.get(Names.headLampStatus); + } + public void setBatteryVoltage(Boolean batteryVoltage) { + if (batteryVoltage != null) { + parameters.put(Names.batteryVoltage, batteryVoltage); + } else { + parameters.remove(Names.batteryVoltage); + } + } + public Boolean getBatteryVoltage() { + return (Boolean) parameters.get(Names.batteryVoltage); + } + public void setEngineTorque(Boolean engineTorque) { + if (engineTorque != null) { + parameters.put(Names.engineTorque, engineTorque); + } else { + parameters.remove(Names.engineTorque); + } + } + public Boolean getEngineTorque() { + return (Boolean) parameters.get(Names.engineTorque); + } + public void setAccPedalPosition(Boolean accPedalPosition) { + if (accPedalPosition != null) { + parameters.put(Names.accPedalPosition, accPedalPosition); + } else { + parameters.remove(Names.accPedalPosition); + } + } + public Boolean getAccPedalPosition() { + return (Boolean) parameters.get(Names.accPedalPosition); + } + public void setSteeringWheelAngle(Boolean steeringWheelAngle) { + if (steeringWheelAngle != null) { + parameters.put(Names.steeringWheelAngle, steeringWheelAngle); + } else { + parameters.remove(Names.steeringWheelAngle); + } + } + public Boolean getSteeringWheelAngle() { + return (Boolean) parameters.get(Names.steeringWheelAngle); + } + public void setECallInfo(Boolean eCallInfo) { + if (eCallInfo != null) { + parameters.put(Names.eCallInfo, eCallInfo); + } else { + parameters.remove(Names.eCallInfo); + } + } + public Boolean getECallInfo() { + return (Boolean) parameters.get(Names.eCallInfo); + } + public void setAirbagStatus(Boolean airbagStatus) { + if (airbagStatus != null) { + parameters.put(Names.airbagStatus, airbagStatus); + } else { + parameters.remove(Names.airbagStatus); + } + } + public Boolean getAirbagStatus() { + return (Boolean) parameters.get(Names.airbagStatus); + } + public void setEmergencyEvent(Boolean emergencyEvent) { + if (emergencyEvent != null) { + parameters.put(Names.emergencyEvent, emergencyEvent); + } else { + parameters.remove(Names.emergencyEvent); + } + } + public Boolean getEmergencyEvent() { + return (Boolean) parameters.get(Names.emergencyEvent); + } + public void setClusterModeStatus(Boolean clusterModeStatus) { + if (clusterModeStatus != null) { + parameters.put(Names.clusterModeStatus, clusterModeStatus); + } else { + parameters.remove(Names.clusterModeStatus); + } + } + public Boolean getClusterModeStatus() { + return (Boolean) parameters.get(Names.clusterModeStatus); + } + public void setMyKey(Boolean myKey) { + if (myKey != null) { + parameters.put(Names.myKey, myKey); + } else { + parameters.remove(Names.myKey); + } + } + public Boolean getMyKey() { + return (Boolean) parameters.get(Names.myKey); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GetVehicleDataResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GetVehicleDataResponse.java new file mode 100644 index 000000000..96f2fc933 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/GetVehicleDataResponse.java @@ -0,0 +1,449 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCResponse; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.ComponentVolumeStatus; +import com.ford.syncV4.proxy.rpc.enums.PRNDL; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataEventStatus; +import com.ford.syncV4.proxy.rpc.enums.WiperStatus; +import com.ford.syncV4.util.DebugTool; + +import java.util.Hashtable; + +public class GetVehicleDataResponse extends RPCResponse { + + public GetVehicleDataResponse() { + super("GetVehicleData"); + } + public GetVehicleDataResponse(Hashtable hash) { + super(hash); + } + public void setGps(GPSData gps) { + if (gps != null) { + parameters.put(Names.gps, gps); + } else { + parameters.remove(Names.gps); + } + } + public GPSData getGps() { + Object obj = parameters.get(Names.gps); + if (obj instanceof GPSData) { + return (GPSData) obj; + } else { + GPSData theCode = null; + try { + theCode = new GPSData((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.gps, e); + } + return theCode; + } + } + public void setSpeed(Float speed) { + if (speed != null) { + parameters.put(Names.speed, speed); + } else { + parameters.remove(Names.speed); + } + } + public Float getSpeed() { + return (Float) parameters.get(Names.speed); + } + public void setRpm(Integer rpm) { + if (rpm != null) { + parameters.put(Names.rpm, rpm); + } else { + parameters.remove(Names.rpm); + } + } + public Integer getRpm() { + return (Integer) parameters.get(Names.rpm); + } + public void setFuelLevel(Float fuelLevel) { + if (fuelLevel != null) { + parameters.put(Names.fuelLevel, fuelLevel); + } else { + parameters.remove(Names.fuelLevel); + } + } + public Float getFuelLevel() { + return (Float) parameters.get(Names.fuelLevel); + } + public void setFuelLevel_State(ComponentVolumeStatus fuelLevel_State) { + if (fuelLevel_State != null) { + parameters.put(Names.fuelLevel_State, fuelLevel_State); + } else { + parameters.remove(Names.fuelLevel_State); + } + } + public ComponentVolumeStatus getFuelLevel_State() { + Object obj = parameters.get(Names.fuelLevel_State); + if (obj instanceof ComponentVolumeStatus) { + return (ComponentVolumeStatus) obj; + } else if (obj instanceof String) { + ComponentVolumeStatus theCode = null; + try { + theCode = ComponentVolumeStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.fuelLevel_State, e); + } + return theCode; + } + return null; + } + public void setInstantFuelConsumption(Float instantFuelConsumption) { + if (instantFuelConsumption != null) { + parameters.put(Names.instantFuelConsumption, instantFuelConsumption); + } else { + parameters.remove(Names.instantFuelConsumption); + } + } + public Float getInstantFuelConsumption() { + return (Float) parameters.get(Names.instantFuelConsumption); + } + public void setExternalTemperature(Float externalTemperature) { + if (externalTemperature != null) { + parameters.put(Names.externalTemperature, externalTemperature); + } else { + parameters.remove(Names.externalTemperature); + } + } + public Float getExternalTemperature() { + return (Float) parameters.get(Names.externalTemperature); + } + public void setVin(String vin) { + if (vin != null) { + parameters.put(Names.vin, vin); + } else { + parameters.remove(Names.vin); + } + } + public String getVin() { + return (String) parameters.get(Names.vin); + } + public void setPrndl(PRNDL prndl) { + if (prndl != null) { + parameters.put(Names.prndl, prndl); + } else { + parameters.remove(Names.prndl); + } + } + public PRNDL getPrndl() { + Object obj = parameters.get(Names.prndl); + if (obj instanceof PRNDL) { + return (PRNDL) obj; + } else if (obj instanceof String) { + PRNDL theCode = null; + try { + theCode = PRNDL.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.prndl, e); + } + return theCode; + } + return null; + } + public void setTirePressure(TireStatus tirePressure) { + if (tirePressure != null) { + parameters.put(Names.tirePressure, tirePressure); + } else { + parameters.remove(Names.tirePressure); + } + } + public TireStatus getTirePressure() { + Object obj = parameters.get(Names.tirePressure); + if (obj instanceof TireStatus) { + return (TireStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new TireStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.tirePressure, e); + } + } + return null; + } + public void setOdometer(Integer odometer) { + if (odometer != null) { + parameters.put(Names.odometer, odometer); + } else { + parameters.remove(Names.odometer); + } + } + public Integer getOdometer() { + return (Integer) parameters.get(Names.odometer); + } + public void setBeltStatus(BeltStatus beltStatus) { + if (beltStatus != null) { + parameters.put(Names.beltStatus, beltStatus); + } else { + parameters.remove(Names.beltStatus); + } + } + public BeltStatus getBeltStatus() { + Object obj = parameters.get(Names.beltStatus); + if (obj instanceof BeltStatus) { + return (BeltStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new BeltStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.beltStatus, e); + } + } + return null; + } + public void setBodyInformation(BodyInformation bodyInformation) { + if (bodyInformation != null) { + parameters.put(Names.bodyInformation, bodyInformation); + } else { + parameters.remove(Names.bodyInformation); + } + } + public BodyInformation getBodyInformation() { + Object obj = parameters.get(Names.bodyInformation); + if (obj instanceof BodyInformation) { + return (BodyInformation) obj; + } else if (obj instanceof Hashtable) { + try { + return new BodyInformation((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.bodyInformation, e); + } + } + return null; + } + public void setDeviceStatus(DeviceStatus deviceStatus) { + if (deviceStatus != null) { + parameters.put(Names.deviceStatus, deviceStatus); + } else { + parameters.remove(Names.deviceStatus); + } + } + public DeviceStatus getDeviceStatus() { + Object obj = parameters.get(Names.deviceStatus); + if (obj instanceof DeviceStatus) { + return (DeviceStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new DeviceStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.deviceStatus, e); + } + } + return null; + } + public void setDriverBraking(VehicleDataEventStatus driverBraking) { + if (driverBraking != null) { + parameters.put(Names.driverBraking, driverBraking); + } else { + parameters.remove(Names.driverBraking); + } + } + public VehicleDataEventStatus getDriverBraking() { + Object obj = parameters.get(Names.driverBraking); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.driverBraking, e); + } + return theCode; + } + return null; + } + public void setWiperStatus(WiperStatus wiperStatus) { + if (wiperStatus != null) { + parameters.put(Names.wiperStatus, wiperStatus); + } else { + parameters.remove(Names.wiperStatus); + } + } + public WiperStatus getWiperStatus() { + Object obj = parameters.get(Names.wiperStatus); + if (obj instanceof WiperStatus) { + return (WiperStatus) obj; + } else if (obj instanceof String) { + WiperStatus theCode = null; + try { + theCode = WiperStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.wiperStatus, e); + } + return theCode; + } + return null; + } + public void setHeadLampStatus(HeadLampStatus headLampStatus) { + if (headLampStatus != null) { + parameters.put(Names.headLampStatus, headLampStatus); + } else { + parameters.remove(Names.headLampStatus); + } + } + public HeadLampStatus getHeadLampStatus() { + Object obj = parameters.get(Names.headLampStatus); + if (obj instanceof HeadLampStatus) { + return (HeadLampStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new HeadLampStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.headLampStatus, e); + } + } + return null; + } + public void setBatteryVoltage(Float batteryVoltage) { + if (batteryVoltage != null) { + parameters.put(Names.batteryVoltage, batteryVoltage); + } else { + parameters.remove(Names.batteryVoltage); + } + } + public Float getBatteryVoltage() { + return (Float) parameters.get(Names.batteryVoltage); + } + public void setEngineTorque(Float engineTorque) { + if (engineTorque != null) { + parameters.put(Names.engineTorque, engineTorque); + } else { + parameters.remove(Names.engineTorque); + } + } + public Float getEngineTorque() { + return (Float) parameters.get(Names.engineTorque); + } + public void setAccPedalPosition(Float accPedalPosition) { + if (accPedalPosition != null) { + parameters.put(Names.accPedalPosition, accPedalPosition); + } else { + parameters.remove(Names.accPedalPosition); + } + } + public Float getAccPedalPosition() { + return (Float) parameters.get(Names.accPedalPosition); + } + + public void setSteeringWheelAngle(Float steeringWheelAngle) { + if (steeringWheelAngle != null) { + parameters.put(Names.steeringWheelAngle, steeringWheelAngle); + } else { + parameters.remove(Names.steeringWheelAngle); + } + } + + public Float getSteeringWheelAngle() { + final Object o = parameters.get(Names.steeringWheelAngle); + if (o instanceof Float) { + return (Float) o; + } + if (o instanceof Double) { + return ((Double) o).floatValue(); + } + return null; + } + public void setECallInfo(ECallInfo eCallInfo) { + if (eCallInfo != null) { + parameters.put(Names.eCallInfo, eCallInfo); + } else { + parameters.remove(Names.eCallInfo); + } + } + public ECallInfo getECallInfo() { + Object obj = parameters.get(Names.eCallInfo); + if (obj instanceof ECallInfo) { + return (ECallInfo) obj; + } else if (obj instanceof Hashtable) { + try { + return new ECallInfo((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.eCallInfo, e); + } + } + return null; + } + public void setAirbagStatus(AirbagStatus airbagStatus) { + if (airbagStatus != null) { + parameters.put(Names.airbagStatus, airbagStatus); + } else { + parameters.remove(Names.airbagStatus); + } + } + public AirbagStatus getAirbagStatus() { + Object obj = parameters.get(Names.airbagStatus); + if (obj instanceof AirbagStatus) { + return (AirbagStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new AirbagStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.airbagStatus, e); + } + } + return null; + } + public void setEmergencyEvent(EmergencyEvent emergencyEvent) { + if (emergencyEvent != null) { + parameters.put(Names.emergencyEvent, emergencyEvent); + } else { + parameters.remove(Names.emergencyEvent); + } + } + public EmergencyEvent getEmergencyEvent() { + Object obj = parameters.get(Names.emergencyEvent); + if (obj instanceof EmergencyEvent) { + return (EmergencyEvent) obj; + } else if (obj instanceof Hashtable) { + try { + return new EmergencyEvent((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.emergencyEvent, e); + } + } + return null; + } + public void setClusterModeStatus(ClusterModeStatus clusterModeStatus) { + if (clusterModeStatus != null) { + parameters.put(Names.clusterModeStatus, clusterModeStatus); + } else { + parameters.remove(Names.clusterModeStatus); + } + } + public ClusterModeStatus getClusterModeStatus() { + Object obj = parameters.get(Names.clusterModeStatus); + if (obj instanceof ClusterModeStatus) { + return (ClusterModeStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new ClusterModeStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.clusterModeStatus, e); + } + } + return null; + } + public void setMyKey(MyKey myKey) { + if (myKey != null) { + parameters.put(Names.myKey, myKey); + } else { + parameters.remove(Names.myKey); + } + } + public MyKey getMyKey() { + Object obj = parameters.get(Names.myKey); + if (obj instanceof MyKey) { + return (MyKey) obj; + } else if (obj instanceof Hashtable) { + try { + return new MyKey((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.myKey, e); + } + } + return null; + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/HMIPermissions.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/HMIPermissions.java new file mode 100644 index 000000000..82b55b3a9 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/HMIPermissions.java @@ -0,0 +1,85 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.HMILevel; +import com.ford.syncV4.util.DebugTool; + +public class HMIPermissions extends RPCStruct { + + public HMIPermissions() { } + public HMIPermissions(Hashtable hash) { + super(hash); + } + public Vector<HMILevel> getAllowed() { + if (store.get(Names.allowed) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)store.get(Names.allowed); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof HMILevel) { + return (Vector<HMILevel>) list; + } else if (obj instanceof String) { + Vector<HMILevel> newList = new Vector<HMILevel>(); + for (Object hashObj : list) { + String strFormat = (String)hashObj; + HMILevel toAdd = null; + try { + toAdd = HMILevel.valueForString(strFormat); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.allowed, e); + } + if (toAdd != null) { + newList.add(toAdd); + } + } + return newList; + } + } + } + return null; + } + public void setAllowed(HMILevel allowed) { + if (allowed != null) { + store.put(Names.allowed, allowed); + } else { + store.remove(Names.allowed); + } + } + public Vector<HMILevel> getUserDisallowed() { + if (store.get(Names.userDisallowed) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)store.get(Names.userDisallowed); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof HMILevel) { + return (Vector<HMILevel>) list; + } else if (obj instanceof String) { + Vector<HMILevel> newList = new Vector<HMILevel>(); + for (Object hashObj : list) { + String strFormat = (String)hashObj; + HMILevel toAdd = null; + try { + toAdd = HMILevel.valueForString(strFormat); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.userDisallowed, e); + } + if (toAdd != null) { + newList.add(toAdd); + } + } + return newList; + } + } + } + return null; + } + public void setUserDisallowed(HMILevel userDisallowed) { + if (userDisallowed != null) { + store.put(Names.userDisallowed, userDisallowed); + } else { + store.remove(Names.userDisallowed); + } + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/HeadLampStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/HeadLampStatus.java new file mode 100644 index 000000000..6685e34eb --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/HeadLampStatus.java @@ -0,0 +1,70 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.AmbientLightStatus; +import com.ford.syncV4.util.DebugTool; + +public class HeadLampStatus extends RPCStruct { + + public HeadLampStatus() {} + public HeadLampStatus(Hashtable hash) { + super(hash); + } + + public void setAmbientLightSensorStatus( + AmbientLightStatus ambientLightStatus) { + if (ambientLightStatus != null) { + store.put(Names.ambientLightSensorStatus, ambientLightStatus); + } else { + store.remove(Names.ambientLightSensorStatus); + } + } + + public AmbientLightStatus getAmbientLightSensorStatus() { + Object obj = store.get(Names.ambientLightSensorStatus); + if (obj instanceof AmbientLightStatus) { + return (AmbientLightStatus) obj; + } else if (obj instanceof String) { + AmbientLightStatus theCode = null; + try { + theCode = AmbientLightStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.ambientLightSensorStatus, e); + } + return theCode; + } + return null; + } + + public void setLowBeamsOn(Boolean lowBeamsOn) { + if (lowBeamsOn != null) { + store.put(Names.lowBeamsOn, lowBeamsOn); + } else { + store.remove(Names.lowBeamsOn); + } + } + + public Boolean getLowBeamsOn() { + final Object o = store.get(Names.lowBeamsOn); + if (o instanceof Boolean) { + return (Boolean) o; + } + return null; + } + + public void setHighBeamsOn(Boolean highBeamsOn) { + if (highBeamsOn != null) { + store.put(Names.highBeamsOn, highBeamsOn); + } else { + store.remove(Names.highBeamsOn); + } + } + public Boolean getHighBeamsOn() { + return (Boolean) store.get(Names.highBeamsOn); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Image.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Image.java new file mode 100644 index 000000000..f2871d0d6 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Image.java @@ -0,0 +1,48 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.ImageType; +import com.ford.syncV4.util.DebugTool; + +public class Image extends RPCStruct { + + public Image() { } + public Image(Hashtable hash) { + super(hash); + } + public void setValue(String value) { + if (value != null) { + store.put(Names.value, value); + } else { + store.remove(Names.value); + } + } + public String getValue() { + return (String) store.get(Names.value); + } + public void setImageType(ImageType imageType) { + if (imageType != null) { + store.put(Names.imageType, imageType); + } else { + store.remove(Names.imageType); + } + } + public ImageType getImageType() { + Object obj = store.get(Names.imageType); + if (obj instanceof ImageType) { + return (ImageType) obj; + } else if (obj instanceof String) { + ImageType theCode = null; + try { + theCode = ImageType.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.imageType, e); + } + return theCode; + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ImageField.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ImageField.java new file mode 100755 index 000000000..55fde9a22 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ImageField.java @@ -0,0 +1,90 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.FileType; +import com.ford.syncV4.proxy.rpc.enums.ImageFieldName; +import com.ford.syncV4.util.DebugTool; + +import java.util.Hashtable; +import java.util.Vector; + +public class ImageField extends RPCStruct { + public ImageField() { + } + + public ImageField(Hashtable hash) { + super(hash); + } + + public ImageFieldName getName() { + Object obj = store.get(Names.name); + if (obj instanceof ImageFieldName) { + return (ImageFieldName) obj; + } else if (obj instanceof String) { + ImageFieldName theCode = null; + try { + theCode = ImageFieldName.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.name, e); + } + return theCode; + } + return null; + } + + public void setName(ImageFieldName imageFieldName) { + if (imageFieldName != null) { + store.put(Names.name, imageFieldName); + } else { + store.remove(Names.name); + } + } + + public Vector<FileType> getImageTypeSupported() { + if (store.get(Names.imageTypeSupported) instanceof Vector<?>) { + Vector<?> list = (Vector<?>) store.get(Names.imageTypeSupported); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof FileType) { + return (Vector<FileType>) list; + } + } + } + return null; + } + + public void setImageTypeSupported(Vector<FileType> imageFieldName) { + if (imageFieldName != null) { + store.put(Names.imageTypeSupported, imageFieldName); + } else { + store.remove(Names.imageTypeSupported); + } + } + + public ImageResolution getImageResolution() { + Object obj = store.get(Names.imageResolution); + if (obj instanceof ImageResolution) { + return (ImageResolution) obj; + } else if (obj instanceof Hashtable) { + try { + return new ImageResolution((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.imageResolution, e); + } + } + return null; + } + + public void setImageResolution(ImageResolution imageResolution) { + if (imageResolution != null) { + store.put(Names.imageResolution, imageResolution); + } else { + store.remove(Names.imageResolution); + } + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ImageResolution.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ImageResolution.java new file mode 100755 index 000000000..d2c87aeab --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ImageResolution.java @@ -0,0 +1,46 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; + +import java.util.Hashtable; + +public class ImageResolution extends RPCStruct { + public ImageResolution() {} + + public ImageResolution(Hashtable hash) { + super(hash); + } + + public void setResolutionWidth(Integer resolutionWidth) { + if (resolutionWidth != null) { + store.put(Names.resolutionWidth, resolutionWidth); + } else { + store.remove(Names.resolutionWidth); + } + } + + public Integer getResolutionWidth() { + final Object o = store.get(Names.resolutionWidth); + if (o instanceof Integer) { + return (Integer) o; + } + return null; + } + + public void setResolutionHeight(Integer resolutionHeight) { + if (resolutionHeight != null) { + store.put(Names.resolutionHeight, resolutionHeight); + } else { + store.remove(Names.resolutionHeight); + } + } + + public Integer getResolutionHeight() { + final Object o = store.get(Names.resolutionHeight); + if (o instanceof Integer) { + return (Integer) o; + } + return null; + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/KeyboardProperties.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/KeyboardProperties.java new file mode 100644 index 000000000..3c0f37216 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/KeyboardProperties.java @@ -0,0 +1,143 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.KeyboardLayout; +import com.ford.syncV4.proxy.rpc.enums.KeypressMode; +import com.ford.syncV4.proxy.rpc.enums.Language; +import com.ford.syncV4.util.DebugTool; + +import java.util.Hashtable; +import java.util.Vector; + +public class KeyboardProperties extends RPCStruct { + private static final KeypressMode KEYPRESS_MODE_DEFAULT = + KeypressMode.RESEND_CURRENT_ENTRY; + + public KeyboardProperties() { + store.put(Names.keypressMode, KEYPRESS_MODE_DEFAULT); + } + + public KeyboardProperties(Hashtable hash) { + super(hash); + if (!store.containsKey(Names.keypressMode)) { + store.put(Names.keypressMode, KEYPRESS_MODE_DEFAULT); + } + } + + public Language getLanguage() { + Object obj = store.get(Names.language); + if (obj instanceof Language) { + return (Language) obj; + } else if (obj instanceof String) { + Language theCode = null; + try { + theCode = Language.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.language, e); + } + return theCode; + } + return null; + } + + public void setLanguage(Language language) { + if (language != null) { + store.put(Names.language, language); + } else { + store.remove(Names.language); + } + } + + public KeyboardLayout getKeyboardLayout() { + Object obj = store.get(Names.keyboardLayout); + if (obj instanceof KeyboardLayout) { + return (KeyboardLayout) obj; + } else if (obj instanceof String) { + KeyboardLayout theCode = null; + try { + theCode = KeyboardLayout.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.keyboardLayout, e); + } + return theCode; + } + return null; + } + + public void setKeyboardLayout(KeyboardLayout keyboardLayout) { + if (keyboardLayout != null) { + store.put(Names.keyboardLayout, keyboardLayout); + } else { + store.remove(Names.keyboardLayout); + } + } + + public KeypressMode getKeypressMode() { + Object obj = store.get(Names.keypressMode); + if (obj instanceof KeypressMode) { + return (KeypressMode) obj; + } else if (obj instanceof String) { + KeypressMode theCode = null; + try { + theCode = KeypressMode.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.keypressMode, e); + } + return theCode; + } + return KEYPRESS_MODE_DEFAULT; + } + + public void setKeypressMode(KeypressMode keypressMode) { + if (keypressMode != null) { + store.put(Names.keypressMode, keypressMode); + } else { + store.put(Names.keypressMode, KEYPRESS_MODE_DEFAULT); + } + } + + public Vector<String> getLimitedCharacterList() { + final Object listObj = store.get(Names.limitedCharacterList); + if (listObj instanceof Vector<?>) { + Vector<?> list = (Vector<?>) listObj; + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof String) { + return (Vector<String>) list; + } + } + } + return null; + } + + public void setLimitedCharacterList(Vector<String> limitedCharacterList) { + if (limitedCharacterList != null) { + store.put(Names.limitedCharacterList, limitedCharacterList); + } else { + store.remove(Names.limitedCharacterList); + } + } + + public String getAutoCompleteText() { + final Object obj = store.get(Names.autoCompleteText); + if (obj instanceof String) { + return (String) obj; + } + return null; + } + + public void setAutoCompleteText(String autoCompleteText) { + if (autoCompleteText != null) { + store.put(Names.autoCompleteText, autoCompleteText); + } else { + store.remove(Names.autoCompleteText); + } + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ListFiles.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ListFiles.java new file mode 100644 index 000000000..7d8b55b5a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ListFiles.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCRequest; + +public class ListFiles extends RPCRequest { + + public ListFiles() { + super("ListFiles"); + } + public ListFiles(Hashtable hash) { + super(hash); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ListFilesResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ListFilesResponse.java new file mode 100644 index 000000000..61981f602 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ListFilesResponse.java @@ -0,0 +1,46 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCResponse; +import com.ford.syncV4.proxy.constants.Names; + +public class ListFilesResponse extends RPCResponse { + + public ListFilesResponse() { + super("ListFiles"); + } + public ListFilesResponse(Hashtable hash) { + super(hash); + } + public void setFilenames(Vector<String> filenames) { + if (filenames != null) { + parameters.put(Names.filenames, filenames); + } else { + parameters.remove(Names.filenames); + } + } + public Vector<String> getFilenames() { + if (parameters.get(Names.filenames) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)parameters.get(Names.filenames); + if (list != null && list.size()>0) { + Object obj = list.get(0); + if (obj instanceof String) { + return (Vector<String>) list; + } + } + } + return null; + } + public void setSpaceAvailable(Integer spaceAvailable) { + if (spaceAvailable != null) { + parameters.put(Names.spaceAvailable, spaceAvailable); + } else { + parameters.remove(Names.spaceAvailable); + } + } + public Integer getSpaceAvailable() { + return (Integer) parameters.get(Names.spaceAvailable); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/MenuParams.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/MenuParams.java new file mode 100644 index 000000000..1047efada --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/MenuParams.java @@ -0,0 +1,56 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCStruct;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class MenuParams extends RPCStruct {
+
+ public MenuParams() { }
+ public MenuParams(Hashtable hash) {
+ super(hash);
+ }
+ public Integer getParentID() {
+ final Object o = store.get(Names.parentID);
+ if (o instanceof Integer) {
+ return (Integer) o;
+ }
+ return null;
+ }
+ public void setParentID( Integer parentID ) {
+ if (parentID != null) {
+ store.put(Names.parentID, parentID );
+ } else {
+ store.remove(Names.parentID);
+ }
+ }
+ public Integer getPosition() {
+ final Object o = store.get(Names.position);
+ if (o instanceof Integer) {
+ return (Integer) o;
+ }
+ return null;
+ }
+ public void setPosition( Integer position ) {
+ if (position != null) {
+ store.put(Names.position, position );
+ } else {
+ store.remove(Names.position);
+ }
+ }
+ public String getMenuName() {
+ final Object o = store.get(Names.menuName);
+ if (o instanceof String) {
+ return (String) o;
+ }
+ return null;
+ }
+ public void setMenuName( String menuName ) {
+ if (menuName != null) {
+ store.put(Names.menuName, menuName );
+ } else {
+ store.remove(Names.menuName);
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/MyKey.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/MyKey.java new file mode 100644 index 000000000..7320d5aea --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/MyKey.java @@ -0,0 +1,40 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataNotificationStatus; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataStatus; +import com.ford.syncV4.util.DebugTool; + +public class MyKey extends RPCStruct { + + public MyKey() { } + public MyKey(Hashtable hash) { + super(hash); + } + + public void setE911Override(VehicleDataStatus e911Override) { + if (e911Override != null) { + store.put(Names.e911Override, e911Override); + } else { + store.remove(Names.e911Override); + } + } + public VehicleDataStatus getE911Override() { + Object obj = store.get(Names.e911Override); + if (obj instanceof VehicleDataStatus) { + return (VehicleDataStatus) obj; + } else if (obj instanceof String) { + VehicleDataStatus theCode = null; + try { + theCode = VehicleDataStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.e911Override, e); + } + return theCode; + } + return null; + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnAppInterfaceUnregistered.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnAppInterfaceUnregistered.java new file mode 100644 index 000000000..bc9744d0c --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnAppInterfaceUnregistered.java @@ -0,0 +1,38 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCNotification;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.AppInterfaceUnregisteredReason;
+import com.ford.syncV4.util.DebugTool;
+
+public class OnAppInterfaceUnregistered extends RPCNotification {
+
+ public OnAppInterfaceUnregistered() {
+ super("OnAppInterfaceUnregistered");
+ }
+ public OnAppInterfaceUnregistered(Hashtable hash) {
+ super(hash);
+ }
+ public AppInterfaceUnregisteredReason getReason() {
+ Object obj = parameters.get(Names.reason);
+ if (obj instanceof AppInterfaceUnregisteredReason) {
+ return (AppInterfaceUnregisteredReason) obj;
+ } else if (obj instanceof String) {
+ AppInterfaceUnregisteredReason theCode = null;
+ try {
+ theCode = AppInterfaceUnregisteredReason.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.reason, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setReason( AppInterfaceUnregisteredReason reason ) {
+ if (reason != null) {
+ parameters.put(Names.reason, reason );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnAudioPassThru.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnAudioPassThru.java new file mode 100644 index 000000000..36577390c --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnAudioPassThru.java @@ -0,0 +1,26 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCNotification; +import com.ford.syncV4.proxy.constants.Names; + +public class OnAudioPassThru extends RPCNotification { + + public OnAudioPassThru() { + super("OnAudioPassThru"); + } + public OnAudioPassThru(Hashtable hash) { + super(hash); + } + public void setAPTData(byte[] aptData) { + if (aptData != null) { + store.put(Names.bulkData, aptData); + } else { + store.remove(Names.bulkData); + } + } + public byte[] getAPTData() { + return (byte[]) store.get(Names.bulkData); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnButtonEvent.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnButtonEvent.java new file mode 100644 index 000000000..7c15c227f --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnButtonEvent.java @@ -0,0 +1,73 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCNotification;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.ButtonEventMode;
+import com.ford.syncV4.proxy.rpc.enums.ButtonName;
+import com.ford.syncV4.util.DebugTool;
+
+public class OnButtonEvent extends RPCNotification {
+
+ public OnButtonEvent() {
+ super("OnButtonEvent");
+ }
+ public OnButtonEvent(Hashtable hash) {
+ super(hash);
+ }
+ public ButtonName getButtonName() {
+ Object obj = parameters.get(Names.buttonName);
+ if (obj instanceof ButtonName) {
+ return (ButtonName) obj;
+ } else if (obj instanceof String) {
+ ButtonName theCode = null;
+ try {
+ theCode = ButtonName.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.buttonName, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setButtonName(ButtonName buttonName) {
+ if (buttonName != null) {
+ parameters.put(Names.buttonName, buttonName);
+ } else {
+ parameters.remove(Names.buttonName);
+ }
+ }
+ public ButtonEventMode getButtonEventMode() {
+ Object obj = parameters.get(Names.buttonEventMode);
+ if (obj instanceof ButtonEventMode) {
+ return (ButtonEventMode) obj;
+ } else if (obj instanceof String) {
+ ButtonEventMode theCode = null;
+ try {
+ theCode = ButtonEventMode.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.buttonEventMode, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setButtonEventMode(ButtonEventMode buttonEventMode) {
+ if (buttonEventMode != null) {
+ parameters.put(Names.buttonEventMode, buttonEventMode);
+ } else {
+ parameters.remove(Names.buttonEventMode);
+ }
+ }
+ public void setCustomButtonID(Integer customButtonID) {
+ if (customButtonID != null) {
+ parameters.put(Names.customButtonID, customButtonID);
+ } else {
+ parameters.remove(Names.customButtonID);
+ }
+ }
+ public Integer getCustomButtonID() {
+ return (Integer) parameters.get(Names.customButtonID);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnButtonPress.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnButtonPress.java new file mode 100644 index 000000000..06809343b --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnButtonPress.java @@ -0,0 +1,69 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCNotification;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.ButtonName;
+import com.ford.syncV4.proxy.rpc.enums.ButtonPressMode;
+import com.ford.syncV4.util.DebugTool;
+
+public class OnButtonPress extends RPCNotification {
+
+ public OnButtonPress() {
+ super("OnButtonPress");
+ }
+ public OnButtonPress(Hashtable hash) {
+ super(hash);
+ }
+ public ButtonName getButtonName() {
+ Object obj = parameters.get(Names.buttonName);
+ if (obj instanceof ButtonName) {
+ return (ButtonName) obj;
+ } else if (obj instanceof String) {
+ ButtonName theCode = null;
+ try {
+ theCode = ButtonName.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.buttonName, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setButtonName( ButtonName buttonName ) {
+ if (buttonName != null) {
+ parameters.put(Names.buttonName, buttonName );
+ }
+ }
+ public ButtonPressMode getButtonPressMode() {
+ Object obj = parameters.get(Names.buttonPressMode);
+ if (obj instanceof ButtonPressMode) {
+ return (ButtonPressMode) obj;
+ } else if (obj instanceof String) {
+ ButtonPressMode theCode = null;
+ try {
+ theCode = ButtonPressMode.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.buttonPressMode, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setButtonPressMode( ButtonPressMode buttonPressMode ) {
+ if (buttonPressMode != null) {
+ parameters.put(Names.buttonPressMode, buttonPressMode );
+ }
+ }
+ public void setCustomButtonName(Integer customButtonID) {
+ if (customButtonID != null) {
+ parameters.put(Names.customButtonID, customButtonID);
+ } else {
+ parameters.remove(Names.customButtonID);
+ }
+ }
+ public Integer getCustomButtonName() {
+ return (Integer) parameters.get(Names.customButtonID);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnCommand.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnCommand.java new file mode 100644 index 000000000..7d993d244 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnCommand.java @@ -0,0 +1,46 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCNotification;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.TriggerSource;
+import com.ford.syncV4.util.DebugTool;
+
+public class OnCommand extends RPCNotification {
+
+ public OnCommand() {
+ super("OnCommand");
+ }
+ public OnCommand(Hashtable hash) {
+ super(hash);
+ }
+ public Integer getCmdID() {
+ return (Integer) parameters.get( Names.cmdID );
+ }
+ public void setCmdID( Integer cmdID ) {
+ if (cmdID != null) {
+ parameters.put(Names.cmdID, cmdID );
+ }
+ }
+ public TriggerSource getTriggerSource() {
+ Object obj = parameters.get(Names.triggerSource);
+ if (obj instanceof TriggerSource) {
+ return (TriggerSource) obj;
+ } else if (obj instanceof String) {
+ TriggerSource theCode = null;
+ try {
+ theCode = TriggerSource.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.triggerSource, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setTriggerSource( TriggerSource triggerSource ) {
+ if (triggerSource != null) {
+ parameters.put(Names.triggerSource, triggerSource );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnDriverDistraction.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnDriverDistraction.java new file mode 100644 index 000000000..18ffaa73f --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnDriverDistraction.java @@ -0,0 +1,39 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+
+import com.ford.syncV4.proxy.RPCNotification;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.DriverDistractionState;
+import com.ford.syncV4.util.DebugTool;
+
+public class OnDriverDistraction extends RPCNotification {
+ public OnDriverDistraction() {
+ super("OnDriverDistraction");
+ }
+ public OnDriverDistraction(Hashtable hash) {
+ super(hash);
+ }
+
+ public DriverDistractionState getState() {
+ Object obj = parameters.get(Names.state);
+ if (obj instanceof DriverDistractionState) {
+ return (DriverDistractionState)obj;
+ } else if(obj instanceof String) {
+ DriverDistractionState theCode = null;
+ try {
+ theCode = DriverDistractionState.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.state, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setState( DriverDistractionState state ) {
+ if (state != null) {
+ parameters.put(Names.state, state );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnEncodedSyncPData.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnEncodedSyncPData.java new file mode 100644 index 000000000..188197e7a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnEncodedSyncPData.java @@ -0,0 +1,59 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+
+import com.ford.syncV4.proxy.RPCNotification;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class OnEncodedSyncPData extends RPCNotification {
+ public OnEncodedSyncPData() {
+ super("OnEncodedSyncPData");
+ }
+ public OnEncodedSyncPData(Hashtable hash) {
+ super(hash);
+ }
+ public Vector<String> getData() {
+ if (parameters.get(Names.data) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.data);
+ if (list != null && list.size()>0) {
+ Object obj = list.get(0);
+ if (obj instanceof String) {
+ return (Vector<String>)list;
+ }
+ }
+ }
+ return null;
+ }
+ public void setData(Vector<String> data) {
+ if (data != null) {
+ parameters.put(Names.data, data);
+ } else {
+ parameters.remove(Names.data);
+ }
+ }
+ public String getUrl(){
+ return (String) parameters.get(Names.URL);
+ }
+ public void setUrl(String url) {
+ if (url != null) {
+ parameters.put(Names.URL, url);
+ } else {
+ parameters.remove(Names.URL);
+ }
+ }
+ public Integer getTimeout(){
+ if (parameters.get(Names.Timeout) instanceof Integer) {
+ return (Integer)parameters.get(Names.Timeout);
+ }
+ return null;
+ }
+ public void setTimeout(Integer timeout) {
+ if (timeout != null) {
+ parameters.put(Names.timeout, timeout);
+ } else {
+ parameters.remove(Names.timeout);
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnHMIStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnHMIStatus.java new file mode 100644 index 000000000..39b437f8c --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnHMIStatus.java @@ -0,0 +1,87 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCNotification;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.AudioStreamingState;
+import com.ford.syncV4.proxy.rpc.enums.HMILevel;
+import com.ford.syncV4.proxy.rpc.enums.SystemContext;
+import com.ford.syncV4.util.DebugTool;
+
+public class OnHMIStatus extends RPCNotification {
+ private Boolean firstRun;
+
+ public OnHMIStatus() {
+ super("OnHMIStatus");
+ }
+ public OnHMIStatus(Hashtable hash) {
+ super(hash);
+ }
+ public HMILevel getHmiLevel() {
+ Object obj = parameters.get(Names.hmiLevel);
+ if (obj instanceof HMILevel) {
+ return (HMILevel) obj;
+ } else if (obj instanceof String) {
+ HMILevel theCode = null;
+ try {
+ theCode = HMILevel.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.hmiLevel, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setHmiLevel( HMILevel hmiLevel ) {
+ if (hmiLevel != null) {
+ parameters.put(Names.hmiLevel, hmiLevel );
+ }
+ }
+ public AudioStreamingState getAudioStreamingState() {
+ Object obj = parameters.get(Names.audioStreamingState);
+ if (obj instanceof AudioStreamingState) {
+ return (AudioStreamingState) obj;
+ } else if (obj instanceof String) {
+ AudioStreamingState theCode = null;
+ try {
+ theCode = AudioStreamingState.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.audioStreamingState, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setAudioStreamingState( AudioStreamingState audioStreamingState ) {
+ if (audioStreamingState != null) {
+ parameters.put(Names.audioStreamingState, audioStreamingState );
+ }
+ }
+ public SystemContext getSystemContext() {
+ Object obj = parameters.get(Names.systemContext);
+ if (obj instanceof SystemContext) {
+ return (SystemContext) obj;
+ } else if (obj instanceof String) {
+ SystemContext theCode = null;
+ try {
+ theCode = SystemContext.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.systemContext, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setSystemContext( SystemContext systemContext ) {
+ if (systemContext != null) {
+ parameters.put(Names.systemContext, systemContext );
+ }
+ }
+ public Boolean getFirstRun() {
+ return this.firstRun;
+ }
+ public void setFirstRun(Boolean firstRun) {
+ this.firstRun = firstRun;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnHashChange.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnHashChange.java new file mode 100644 index 000000000..4e8d47246 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnHashChange.java @@ -0,0 +1,68 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCMessage; +import com.ford.syncV4.proxy.RPCNotification; +import com.ford.syncV4.proxy.constants.Names; + +import java.util.Hashtable; + +/** + * Created with Android Studio. + * Author: Chernyshov Yuriy - Mobile Development + * Date: 2/25/14 + * Time: 1:42 PM + */ + +/** + * 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. + */ +public class OnHashChange extends RPCNotification { + + private static final int HASH_ID_MAX_LENGTH = 100; + + public OnHashChange() { + super(Names.OnHashChange); + } + + public OnHashChange(Hashtable hash) { + super(hash); + } + + public OnHashChange(RPCMessage rpcMsg) { + super(rpcMsg); + } + + /** + * Return calculated hash ID to be referenced during RegisterAppInterface. + * + * @return {@link java.lang.String} hash ID + */ + public String getHashID() { + if (!parameters.containsKey(Names.hashID)) { + return null; + } + if (parameters.get(Names.hashID) instanceof String) { + return (String) parameters.get(Names.hashID); + } + return null; + } + + /** + * Set calculated hash ID to be referenced during RegisterAppInterface. + * + * @param hashID hash ID + */ + public void setHashID(String hashID) { + if (hashID != null) { + if (hashID.length() > HASH_ID_MAX_LENGTH) { + throw new IllegalArgumentException("Parameter 'hashId' can have max length " + + "'" + HASH_ID_MAX_LENGTH + "', current length is '" + hashID.length() + "'"); + } + parameters.put(Names.hashID, hashID); + } else { + parameters.remove(Names.hashID); + } + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnKeyboardInput.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnKeyboardInput.java new file mode 100644 index 000000000..d3276242c --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnKeyboardInput.java @@ -0,0 +1,68 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCNotification; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.KeyboardEvent; +import com.ford.syncV4.util.DebugTool; + +import java.util.Hashtable; + +/** + * Created by Andrew Batutin on 9/22/13. + */ +public class OnKeyboardInput extends RPCNotification { + + public OnKeyboardInput() { + super("OnKeyboardInput"); + } + + public OnKeyboardInput(Hashtable hash) { + super(hash); + } + + public KeyboardEvent getEvent() { + Object obj = parameters.get(Names.keyboardEvent); + if (obj instanceof KeyboardEvent) { + return (KeyboardEvent) obj; + } else if (obj instanceof String) { + KeyboardEvent theCode = null; + try { + theCode = KeyboardEvent.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.keyboardEvent, e); + } + return theCode; + } + return null; + } + + public void setEvent(KeyboardEvent event) { + if (event != null) { + parameters.put(Names.keyboardEvent, event); + } else { + parameters.remove(Names.keyboardEvent); + } + } + + public void setData(String data) { + if (data != null) { + parameters.put(Names.data, data); + } else { + parameters.remove(Names.data); + } + } + public String getData() { + Object obj = parameters.get(Names.data); + if (obj instanceof String) { + return (String) obj; + } + return null; + } + + @Override + public String toString(){ + String result = this.getFunctionName() +": " + " data: " + this.getData() + " event:" + this.getEvent().toString(); + return result; + } + +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnLanguageChange.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnLanguageChange.java new file mode 100644 index 000000000..22e6f97e5 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnLanguageChange.java @@ -0,0 +1,62 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCNotification; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.Language; +import com.ford.syncV4.util.DebugTool; + +public class OnLanguageChange extends RPCNotification { + + public OnLanguageChange() { + super("OnLanguageChange"); + } + public OnLanguageChange(Hashtable hash) { + super(hash); + } + public void setLanguage(Language language) { + if (language != null) { + parameters.put(Names.language, language); + } else { + parameters.remove(Names.language); + } + } + public Language getLanguage() { + Object obj = parameters.get(Names.language); + if (obj instanceof Language) { + return (Language) obj; + } else if (obj instanceof String) { + Language theCode = null; + try { + theCode = Language.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.language, e); + } + return theCode; + } + return null; + } + public void setHmiDisplayLanguage(Language hmiDisplayLanguage) { + if (hmiDisplayLanguage != null) { + parameters.put(Names.hmiDisplayLanguage, hmiDisplayLanguage); + } else { + parameters.remove(Names.hmiDisplayLanguage); + } + } + public Language getHmiDisplayLanguage() { + Object obj = parameters.get(Names.hmiDisplayLanguage); + if (obj instanceof Language) { + return (Language) obj; + } else if (obj instanceof String) { + Language theCode = null; + try { + theCode = Language.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.hmiDisplayLanguage, e); + } + return theCode; + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnPermissionsChange.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnPermissionsChange.java new file mode 100644 index 000000000..711bc4ca7 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnPermissionsChange.java @@ -0,0 +1,40 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCNotification;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class OnPermissionsChange extends RPCNotification {
+
+ public OnPermissionsChange() {
+ super("OnPermissionsChange");
+ }
+ public OnPermissionsChange(Hashtable hash) {
+ super(hash);
+ }
+ public Vector<PermissionItem> getPermissionItem() {
+ Vector<?> list = (Vector<?>)parameters.get(Names.permissionItem);
+ if (list != null && list.size()>0) {
+ Object obj = list.get(0);
+ if(obj instanceof PermissionItem){
+ return (Vector<PermissionItem>) list;
+ } else if(obj instanceof Hashtable) {
+ Vector<PermissionItem> newList = new Vector<PermissionItem>();
+ for (Object hash:list) {
+ newList.add(new PermissionItem((Hashtable)hash));
+ }
+ return newList;
+ }
+ }
+ return null;
+ }
+ public void setPermissionItem(Vector<PermissionItem> permissionItem) {
+ if (permissionItem != null) {
+ parameters.put(Names.permissionItem, permissionItem);
+ } else {
+ parameters.remove(Names.permissionItem);
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnSyncChoiceChosen.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnSyncChoiceChosen.java new file mode 100644 index 000000000..e568ba037 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnSyncChoiceChosen.java @@ -0,0 +1,47 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCNotification;
+import com.ford.syncV4.proxy.SyncProxyALMManager.SyncChoice;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.TriggerSource;
+import com.ford.syncV4.util.DebugTool;
+
+public class OnSyncChoiceChosen extends RPCNotification {
+
+ public OnSyncChoiceChosen() {
+ super(Names.OnSyncChoiceChosen);
+ }
+ public OnSyncChoiceChosen(Hashtable hash){
+ super(hash);
+ }
+ public SyncChoice getSyncChoice() {
+ return (SyncChoice) parameters.get(Names.syncChoice);
+ }
+ public void setSyncChoice(SyncChoice syncChoice) {
+ if (syncChoice != null) {
+ parameters.put(Names.syncChoice, syncChoice);
+ }
+ }
+ public TriggerSource getTriggerSource() {
+ Object obj = parameters.get(Names.triggerSource);
+ if (obj instanceof TriggerSource) {
+ return (TriggerSource) obj;
+ } else if (obj instanceof String) {
+ TriggerSource theCode = null;
+ try {
+ theCode = TriggerSource.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.triggerSource, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setTriggerSource( TriggerSource triggerSource ) {
+ if (triggerSource != null) {
+ parameters.put(Names.triggerSource, triggerSource );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnSyncPData.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnSyncPData.java new file mode 100644 index 000000000..a7896ccfe --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnSyncPData.java @@ -0,0 +1,49 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCNotification; +import com.ford.syncV4.proxy.constants.Names; + +import java.util.Hashtable; + +public class OnSyncPData extends RPCNotification { + public OnSyncPData() { + super("OnSyncPData"); + } + public OnSyncPData(Hashtable hash) { + super(hash); + } + public String getUrl(){ + return (String) parameters.get(Names.URL); + } + public void setUrl(String url) { + if (url != null) { + parameters.put(Names.URL, url); + } else { + parameters.remove(Names.URL); + } + } + public Integer getTimeout(){ + if (parameters.get(Names.Timeout) instanceof Integer) { + return (Integer)parameters.get(Names.Timeout); + } + return null; + } + public void setTimeout(Integer timeout) { + if (timeout != null) { + parameters.put(Names.timeout, timeout); + } else { + parameters.remove(Names.timeout); + } + } + + public void setSyncPData(byte[] syncPData) { + if (syncPData != null) { + store.put(Names.bulkData, syncPData); + } else { + store.remove(Names.bulkData); + } + } + public byte[] getSyncPData() { + return (byte[]) store.get(Names.bulkData); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnSystemRequest.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnSystemRequest.java new file mode 100644 index 000000000..d38b68845 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnSystemRequest.java @@ -0,0 +1,140 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCNotification; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.FileType; +import com.ford.syncV4.proxy.rpc.enums.RequestType; +import com.ford.syncV4.util.DebugTool; + +import java.util.Hashtable; +import java.util.Vector; + +public class OnSystemRequest extends RPCNotification { + + public OnSystemRequest() { + super("OnSystemRequest"); + } + + public OnSystemRequest(Hashtable hash) { + super(hash); + } + + public RequestType getRequestType() { + Object obj = parameters.get(Names.requestType); + if (obj instanceof RequestType) { + return (RequestType) obj; + } else if (obj instanceof String) { + RequestType theCode = null; + try { + theCode = RequestType.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.requestType, e); + } + return theCode; + } + return null; + } + + public void setRequestType(RequestType requestType) { + if (requestType != null) { + parameters.put(Names.requestType, requestType); + } else { + parameters.remove(Names.requestType); + } + } + + public Vector<String> getUrl() { + if (parameters.get(Names.url) instanceof Vector<?>) { + Vector<?> list = (Vector<?>) parameters.get(Names.url); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof String) { + return (Vector<String>) list; + } + } + } + return null; + } + + public void setUrl(Vector<String> url) { + if (url != null) { + parameters.put(Names.url, url); + } else { + parameters.remove(Names.url); + } + } + + public FileType getFileType() { + Object obj = parameters.get(Names.fileType); + if (obj instanceof FileType) { + return (FileType) obj; + } else if (obj instanceof String) { + FileType theCode = null; + try { + theCode = FileType.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.fileType, e); + } + return theCode; + } + return null; + } + + public void setFileType(FileType fileType) { + if (fileType != null) { + parameters.put(Names.fileType, fileType); + } else { + parameters.remove(Names.fileType); + } + } + + public Integer getOffset() { + final Object o = parameters.get(Names.offset); + if (o instanceof Integer) { + return (Integer) o; + } + return null; + } + + public void setOffset(Integer offset) { + if (offset != null) { + parameters.put(Names.offset, offset); + } else { + parameters.remove(Names.offset); + } + } + + public Integer getLength() { + final Object o = parameters.get(Names.length); + if (o instanceof Integer) { + return (Integer) o; + } + return null; + } + + public void setLength(Integer length) { + if (length != null) { + parameters.put(Names.length, length); + } else { + parameters.remove(Names.length); + } + } + + public Integer getTimeout(){ + if (parameters.get(Names.timeout) instanceof Integer) { + return (Integer)parameters.get(Names.timeout); + } + return null; + } + public void setTimeout(Integer timeout) { + if (timeout != null) { + parameters.put(Names.timeout, timeout); + } else { + parameters.remove(Names.timeout); + } + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnTBTClientState.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnTBTClientState.java new file mode 100644 index 000000000..12b004c29 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnTBTClientState.java @@ -0,0 +1,40 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCNotification;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.TBTState;
+import com.ford.syncV4.util.DebugTool;
+
+public class OnTBTClientState extends RPCNotification {
+
+ public OnTBTClientState() {
+ super("OnTBTClientState");
+ }
+ public OnTBTClientState(Hashtable hash) {
+ super(hash);
+ }
+ public TBTState getState() {
+ Object obj = parameters.get(Names.state);
+ if (obj instanceof TBTState) {
+ return (TBTState)obj;
+ } else if(obj instanceof String) {
+ TBTState theCode = null;
+ try{
+ theCode = TBTState.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.state, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setState( TBTState state ) {
+ if (state != null) {
+ parameters.put(Names.state, state );
+ } else {
+ parameters.remove(Names.state);
+ }
+ }
+} // end-class
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnTouchEvent.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnTouchEvent.java new file mode 100755 index 000000000..40a3c1493 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnTouchEvent.java @@ -0,0 +1,64 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCNotification; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.TouchType; +import com.ford.syncV4.util.DebugTool; + +import java.util.Hashtable; +import java.util.Vector; + +public class OnTouchEvent extends RPCNotification { + public OnTouchEvent() { + super("OnTouchEvent"); + } + public OnTouchEvent(Hashtable hash) { + super(hash); + } + + public void setType(TouchType type) { + if (type != null) { + parameters.put(Names.type, type); + } else { + parameters.remove(Names.type); + } + } + + public TouchType getType() { + Object obj = parameters.get(Names.type); + if (obj instanceof TouchType) { + return (TouchType) obj; + } else if (obj instanceof String) { + TouchType theCode = null; + try { + theCode = TouchType.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.type, e); + } + return theCode; + } + return null; + } + + public void setEvent(Vector<TouchType> event) { + if (event != null) { + parameters.put(Names.event, event); + } else { + parameters.remove(Names.event); + } + } + + public Vector<TouchType> getEvent() { + Object objList = parameters.get(Names.event); + if (objList instanceof Vector<?>) { + Vector<?> list = (Vector<?>)objList; + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof TouchType) { + return (Vector<TouchType>)list; + } + } + } + return null; + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnVehicleData.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnVehicleData.java new file mode 100644 index 000000000..66e41e682 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/OnVehicleData.java @@ -0,0 +1,464 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCNotification; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.ComponentVolumeStatus; +import com.ford.syncV4.proxy.rpc.enums.PRNDL; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataEventStatus; +import com.ford.syncV4.proxy.rpc.enums.WiperStatus; +import com.ford.syncV4.util.DebugTool; + +public class OnVehicleData extends RPCNotification { + + public OnVehicleData() { + super("OnVehicleData"); + } + public OnVehicleData(Hashtable hash) { + super(hash); + } + public void setGps(GPSData gps) { + if (gps != null) { + parameters.put(Names.gps, gps); + } else { + parameters.remove(Names.gps); + } + } + public GPSData getGps() { + Object obj = parameters.get(Names.gps); + if (obj instanceof GPSData) { + return (GPSData) obj; + } else { + GPSData theCode = null; + try { + theCode = new GPSData((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.gps, e); + } + return theCode; + } + } + public void setSpeed(Integer speed) { + if (speed != null) { + store.put(Names.speed, speed); + } else { + store.remove(Names.speed); + } + } + public Integer getSpeed() { + return (Integer) store.get(Names.speed); + } + public void setRpm(Integer rpm) { + if (rpm != null) { + store.put(Names.rpm, rpm); + } else { + store.remove(Names.rpm); + } + } + public Integer getRpm() { + return (Integer) store.get(Names.rpm); + } + public void setFuelLevel(Float fuelLevel) { + if (fuelLevel != null) { + store.put(Names.fuelLevel, fuelLevel); + } else { + store.remove(Names.fuelLevel); + } + } + public Float getFuelLevel() { + return (Float) store.get(Names.fuelLevel); + } + public void setFuelLevel_State(ComponentVolumeStatus fuelLevel_State) { + if (fuelLevel_State != null) { + parameters.put(Names.fuelLevel_State, fuelLevel_State); + } else { + parameters.remove(Names.fuelLevel_State); + } + } + public ComponentVolumeStatus getFuelLevel_State() { + Object obj = parameters.get(Names.fuelLevel_State); + if (obj instanceof ComponentVolumeStatus) { + return (ComponentVolumeStatus) obj; + } else if (obj instanceof String) { + ComponentVolumeStatus theCode = null; + try { + theCode = ComponentVolumeStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.fuelLevel_State, e); + } + return theCode; + } + return null; + } + public void setInstantFuelConsumption(Float instantFuelConsumption) { + if (instantFuelConsumption != null) { + parameters.put(Names.instantFuelConsumption, instantFuelConsumption); + } else { + parameters.remove(Names.instantFuelConsumption); + } + } + public Float getInstantFuelConsumption() { + return (Float) parameters.get(Names.instantFuelConsumption); + } + public void setExternalTemperature(Float externalTemperature) { + if (externalTemperature != null) { + store.put(Names.externalTemperature, externalTemperature); + } else { + store.remove(Names.externalTemperature); + } + } + public Float getExternalTemperature() { + return (Float) store.get(Names.externalTemperature); + } + public void setVin(String vin) { + if (vin != null) { + store.put(Names.vin, vin); + } else { + store.remove(Names.vin); + } + } + public String getVin() { + return (String) store.get(Names.vin); + } + public void setPrndl(PRNDL prndl) { + if (prndl != null) { + store.put(Names.prndl, prndl); + } else { + store.remove(Names.prndl); + } + } + public PRNDL getPrndl() { + Object obj = store.get(Names.prndl); + if (obj instanceof PRNDL) { + return (PRNDL) obj; + } else if (obj instanceof String) { + PRNDL theCode = null; + try { + theCode = PRNDL.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.prndl, e); + } + return theCode; + } + return null; + } + public void setTirePressure(TireStatus tirePressure) { + if (tirePressure != null) { + store.put(Names.tirePressure, tirePressure); + } else { + store.remove(Names.tirePressure); + } + } + public TireStatus getTirePressure() { + Object obj = store.get(Names.tirePressure); + if (obj instanceof TireStatus) { + return (TireStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new TireStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.tirePressure, e); + } + } + return null; + } + public void setOdometer(Integer odometer) { + if (odometer != null) { + store.put(Names.odometer, odometer); + } else { + store.remove(Names.odometer); + } + } + public Integer getOdometer() { + return (Integer) store.get(Names.odometer); + } + public void setBeltStatus(BeltStatus beltStatus) { + if (beltStatus != null) { + parameters.put(Names.beltStatus, beltStatus); + } else { + parameters.remove(Names.beltStatus); + } + } + public BeltStatus getBeltStatus() { + Object obj = parameters.get(Names.beltStatus); + if (obj instanceof BeltStatus) { + return (BeltStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new BeltStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.beltStatus, e); + } + } + return null; + } + public void setBodyInformation(BodyInformation bodyInformation) { + if (bodyInformation != null) { + parameters.put(Names.bodyInformation, bodyInformation); + } else { + parameters.remove(Names.bodyInformation); + } + } + public BodyInformation getBodyInformation() { + Object obj = parameters.get(Names.bodyInformation); + if (obj instanceof BodyInformation) { + return (BodyInformation) obj; + } else if (obj instanceof Hashtable) { + try { + return new BodyInformation((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.bodyInformation, e); + } + } + return null; + } + public void setDeviceStatus(DeviceStatus deviceStatus) { + if (deviceStatus != null) { + parameters.put(Names.deviceStatus, deviceStatus); + } else { + parameters.remove(Names.deviceStatus); + } + } + public DeviceStatus getDeviceStatus() { + Object obj = parameters.get(Names.deviceStatus); + if (obj instanceof DeviceStatus) { + return (DeviceStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new DeviceStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.deviceStatus, e); + } + } + return null; + } + public void setDriverBraking(VehicleDataEventStatus driverBraking) { + if (driverBraking != null) { + parameters.put(Names.driverBraking, driverBraking); + } else { + parameters.remove(Names.driverBraking); + } + } + public VehicleDataEventStatus getDriverBraking() { + Object obj = parameters.get(Names.driverBraking); + if (obj instanceof VehicleDataEventStatus) { + return (VehicleDataEventStatus) obj; + } else if (obj instanceof String) { + VehicleDataEventStatus theCode = null; + try { + theCode = VehicleDataEventStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.driverBraking, e); + } + return theCode; + } + return null; + } + public void setWiperStatus(WiperStatus wiperStatus) { + if (wiperStatus != null) { + parameters.put(Names.wiperStatus, wiperStatus); + } else { + parameters.remove(Names.wiperStatus); + } + } + public WiperStatus getWiperStatus() { + Object obj = parameters.get(Names.wiperStatus); + if (obj instanceof WiperStatus) { + return (WiperStatus) obj; + } else if (obj instanceof String) { + WiperStatus theCode = null; + try { + theCode = WiperStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.wiperStatus, e); + } + return theCode; + } + return null; + } + + public void setHeadLampStatus(HeadLampStatus headLampStatus) { + if (headLampStatus != null) { + parameters.put(Names.headLampStatus, headLampStatus); + } else { + parameters.remove(Names.headLampStatus); + } + } + + public HeadLampStatus getHeadLampStatus() { + Object obj = parameters.get(Names.headLampStatus); + if (obj instanceof HeadLampStatus) { + return (HeadLampStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new HeadLampStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.headLampStatus, e); + } + } + return null; + } + + public void setEngineTorque(Integer engineTorque) { + if (engineTorque != null) { + store.put(Names.engineTorque, engineTorque); + } else { + store.remove(Names.engineTorque); + } + } + public Integer getEngineTorque() { + return (Integer) store.get(Names.engineTorque); + } + public void setAccPedalPosition(Float accPedalPosition) { + if (accPedalPosition != null) { + parameters.put(Names.accPedalPosition, accPedalPosition); + } else { + parameters.remove(Names.accPedalPosition); + } + } + public Float getAccPedalPosition() { + return (Float) parameters.get(Names.accPedalPosition); + } + + public void setSteeringWheelAngle(Float steeringWheelAngle) { + if (steeringWheelAngle != null) { + parameters.put(Names.steeringWheelAngle, steeringWheelAngle); + } else { + parameters.remove(Names.steeringWheelAngle); + } + } + + public Float getSteeringWheelAngle() { + final Object o = parameters.get(Names.steeringWheelAngle); + if (o instanceof Float) { + return (Float) o; + } + if (o instanceof Double) { + return ((Double) o).floatValue(); + } + return null; + } + + public void setECallInfo(ECallInfo eCallInfo) { + if (eCallInfo != null) { + parameters.put(Names.eCallInfo, eCallInfo); + } else { + parameters.remove(Names.eCallInfo); + } + } + + public ECallInfo getECallInfo() { + Object obj = parameters.get(Names.eCallInfo); + if (obj instanceof ECallInfo) { + return (ECallInfo) obj; + } else if (obj instanceof Hashtable) { + try { + return new ECallInfo((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.eCallInfo, e); + } + } + return null; + } + + public void setAirbagStatus(AirbagStatus airbagStatus) { + if (airbagStatus != null) { + parameters.put(Names.airbagStatus, airbagStatus); + } else { + parameters.remove(Names.airbagStatus); + } + } + + public AirbagStatus getAirbagStatus() { + Object obj = parameters.get(Names.airbagStatus); + if (obj instanceof AirbagStatus) { + return (AirbagStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new AirbagStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.airbagStatus, e); + } + } + return null; + } + + public void setEmergencyEvent(EmergencyEvent emergencyEvent) { + if (emergencyEvent != null) { + parameters.put(Names.emergencyEvent, emergencyEvent); + } else { + parameters.remove(Names.emergencyEvent); + } + } + + public EmergencyEvent getEmergencyEvent() { + Object obj = parameters.get(Names.emergencyEvent); + if (obj instanceof EmergencyEvent) { + return (EmergencyEvent) obj; + } else if (obj instanceof Hashtable) { + try { + return new EmergencyEvent((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.emergencyEvent, e); + } + } + return null; + } + + public void setClusterModeStatus(ClusterModeStatus clusterModeStatus) { + if (clusterModeStatus != null) { + parameters.put(Names.clusterModeStatus, clusterModeStatus); + } else { + parameters.remove(Names.clusterModeStatus); + } + } + + public ClusterModeStatus getClusterModeStatus() { + Object obj = parameters.get(Names.clusterModeStatus); + if (obj instanceof ClusterModeStatus) { + return (ClusterModeStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new ClusterModeStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.clusterModeStatus, e); + } + } + return null; + } + + public void setMyKey(MyKey myKey) { + if (myKey != null) { + parameters.put(Names.myKey, myKey); + } else { + parameters.remove(Names.myKey); + } + } + + public MyKey getMyKey() { + Object obj = parameters.get(Names.myKey); + if (obj instanceof MyKey) { + return (MyKey) obj; + } else if (obj instanceof Hashtable) { + try { + return new MyKey((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.myKey, e); + } + } + return null; + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ParameterPermissions.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ParameterPermissions.java new file mode 100644 index 000000000..da3d10d97 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ParameterPermissions.java @@ -0,0 +1,54 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.HMILevel; + +public class ParameterPermissions extends RPCStruct { + + public ParameterPermissions() { } + public ParameterPermissions(Hashtable hash) { + super(hash); + } + public Vector<String> getAllowed() { + if (store.get(Names.allowed) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)store.get( Names.allowed); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof String) { + return (Vector<String>) list; + } + } + } + return null; + } + public void setAllowed(HMILevel allowed) { + if (allowed != null) { + store.put(Names.allowed, allowed); + } else { + store.remove(Names.allowed); + } + } + public Vector<String> getUserDisallowed() { + if (store.get(Names.userDisallowed) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)store.get( Names.userDisallowed); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof String) { + return (Vector<String>) list; + } + } + } + return null; + } + public void setUserDisallowed(HMILevel userDisallowed) { + if (userDisallowed != null) { + store.put(Names.userDisallowed, userDisallowed); + } else { + store.remove(Names.userDisallowed); + } + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PerformAudioPassThru.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PerformAudioPassThru.java new file mode 100644 index 000000000..9e86d1728 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PerformAudioPassThru.java @@ -0,0 +1,153 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.BitsPerSample; +import com.ford.syncV4.proxy.rpc.enums.AudioType; +import com.ford.syncV4.proxy.rpc.enums.SamplingRate; +import com.ford.syncV4.util.DebugTool; + +public class PerformAudioPassThru extends RPCRequest { + + public PerformAudioPassThru() { + super("PerformAudioPassThru"); + } + public PerformAudioPassThru(Hashtable hash) { + super(hash); + } + public void setInitialPrompt(Vector<TTSChunk> initialPrompt) { + if (initialPrompt != null) { + parameters.put(Names.initialPrompt, initialPrompt); + } else { + parameters.remove(Names.initialPrompt); + } + } + public Vector<TTSChunk> getInitialPrompt() { + if (parameters.get(Names.initialPrompt) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)parameters.get(Names.initialPrompt); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof TTSChunk) { + return (Vector<TTSChunk>) list; + } else if (obj instanceof Hashtable) { + Vector<TTSChunk> newList = new Vector<TTSChunk>(); + for (Object hashObj : list) { + newList.add(new TTSChunk((Hashtable)hashObj)); + } + return newList; + } + } + } + return null; + } + public void setAudioPassThruDisplayText1(String audioPassThruDisplayText1) { + if (audioPassThruDisplayText1 != null) { + parameters.put(Names.audioPassThruDisplayText1, audioPassThruDisplayText1); + } else { + parameters.remove(Names.audioPassThruDisplayText1); + } + } + public String getAudioPassThruDisplayText1() { + return (String) parameters.get(Names.audioPassThruDisplayText1); + } + public void setAudioPassThruDisplayText2(String audioPassThruDisplayText2) { + if (audioPassThruDisplayText2 != null) { + parameters.put(Names.audioPassThruDisplayText2, audioPassThruDisplayText2); + } else { + parameters.remove(Names.audioPassThruDisplayText2); + } + } + public String getAudioPassThruDisplayText2() { + return (String) parameters.get(Names.audioPassThruDisplayText2); + } + public void setSamplingRate(SamplingRate samplingRate) { + if (samplingRate != null) { + parameters.put(Names.samplingRate, samplingRate); + } else { + parameters.remove(Names.samplingRate); + } + } + public SamplingRate getSamplingRate() { + Object obj = parameters.get(Names.samplingRate); + if (obj instanceof SamplingRate) { + return (SamplingRate) obj; + } else if (obj instanceof String) { + SamplingRate theCode = null; + try { + theCode = SamplingRate.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.samplingRate, e); + } + return theCode; + } + return null; + } + public void setMaxDuration(Integer maxDuration) { + if (maxDuration != null) { + parameters.put(Names.maxDuration, maxDuration); + } else { + parameters.remove(Names.maxDuration); + } + } + public int getMaxDuration() { + return (Integer) parameters.get(Names.maxDuration); + } + public void setBitsPerSample(BitsPerSample audioQuality) { + if (audioQuality != null) { + parameters.put(Names.bitsPerSample, audioQuality); + } else { + parameters.remove(Names.bitsPerSample); + } + } + public BitsPerSample getBitsPerSample() { + Object obj = parameters.get(Names.bitsPerSample); + if (obj instanceof BitsPerSample) { + return (BitsPerSample) obj; + } else if (obj instanceof String) { + BitsPerSample theCode = null; + try { + theCode = BitsPerSample.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.bitsPerSample, e); + } + return theCode; + } + return null; + } + public void setAudioType(AudioType audioType) { + if (audioType != null) { + parameters.put(Names.audioType, audioType); + } else { + parameters.remove(Names.audioType); + } + } + public AudioType getAudioType() { + Object obj = parameters.get(Names.audioType); + if (obj instanceof AudioType) { + return (AudioType) obj; + } else if (obj instanceof String) { + AudioType theCode = null; + try { + theCode = AudioType.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.audioType, e); + } + return theCode; + } + return null; + } + + public void setMuteAudio(Boolean muteAudio) { + if (muteAudio != null) { + parameters.put(Names.muteAudio, muteAudio); + } else { + parameters.remove(Names.muteAudio); + } + } + public Boolean getMuteAudio() { + return (Boolean) parameters.get(Names.muteAudio); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PerformAudioPassThruResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PerformAudioPassThruResponse.java new file mode 100644 index 000000000..ec819d99c --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PerformAudioPassThruResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCResponse; + +public class PerformAudioPassThruResponse extends RPCResponse { + + public PerformAudioPassThruResponse() { + super("PerformAudioPassThru"); + } + public PerformAudioPassThruResponse(Hashtable hash) { + super(hash); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PerformInteraction.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PerformInteraction.java new file mode 100644 index 000000000..5a79cd52b --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PerformInteraction.java @@ -0,0 +1,203 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.InteractionMode;
+import com.ford.syncV4.proxy.rpc.enums.LayoutMode;
+import com.ford.syncV4.util.DebugTool;
+
+public class PerformInteraction extends RPCRequest {
+
+ public PerformInteraction() {
+ super("PerformInteraction");
+ }
+ public PerformInteraction(Hashtable hash) {
+ super(hash);
+ }
+ public String getInitialText() {
+ return (String) parameters.get(Names.initialText);
+ }
+ public void setInitialText(String initialText) {
+ if (initialText != null) {
+ parameters.put(Names.initialText, initialText);
+ } else {
+ parameters.remove(Names.initialText);
+ }
+ }
+ public Vector<TTSChunk> getInitialPrompt() {
+ if (parameters.get(Names.initialPrompt) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.initialPrompt);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof TTSChunk) {
+ return (Vector<TTSChunk>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<TTSChunk> newList = new Vector<TTSChunk>();
+ for (Object hashObj : list) {
+ newList.add(new TTSChunk((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setInitialPrompt(Vector<TTSChunk> initialPrompt) {
+ if (initialPrompt != null) {
+ parameters.put(Names.initialPrompt, initialPrompt);
+ } else {
+ parameters.remove(Names.initialPrompt);
+ }
+ }
+ public InteractionMode getInteractionMode() {
+ Object obj = parameters.get(Names.interactionMode);
+ if (obj instanceof InteractionMode) {
+ return (InteractionMode) obj;
+ } else if (obj instanceof String) {
+ InteractionMode theCode = null;
+ try {
+ theCode = InteractionMode.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.interactionMode, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setInteractionMode(InteractionMode interactionMode) {
+ if (interactionMode != null) {
+ parameters.put(Names.interactionMode, interactionMode);
+ } else {
+ parameters.remove(Names.interactionMode);
+ }
+ }
+ public Vector<Integer> getInteractionChoiceSetIDList() {
+ if(parameters.get(Names.interactionChoiceSetIDList) instanceof Vector<?>){
+ Vector<?> list = (Vector<?>)parameters.get(Names.interactionChoiceSetIDList);
+ if(list != null && list.size()>0){
+ Object obj = list.get(0);
+ if(obj instanceof Integer){
+ return (Vector<Integer>) list;
+ }
+ }
+ }
+ return null;
+ }
+ public void setInteractionChoiceSetIDList(Vector<Integer> interactionChoiceSetIDList) {
+ if (interactionChoiceSetIDList != null) {
+ parameters.put(Names.interactionChoiceSetIDList, interactionChoiceSetIDList);
+ } else {
+ parameters.remove(Names.interactionChoiceSetIDList);
+ }
+ }
+ public Vector<TTSChunk> getHelpPrompt() {
+ if(parameters.get(Names.helpPrompt) instanceof Vector<?>){
+ Vector<?> list = (Vector<?>)parameters.get(Names.helpPrompt);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof TTSChunk) {
+ return (Vector<TTSChunk>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<TTSChunk> newList = new Vector<TTSChunk>();
+ for (Object hashObj : list) {
+ newList.add(new TTSChunk((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setHelpPrompt(Vector<TTSChunk> helpPrompt) {
+ if (helpPrompt != null) {
+ parameters.put(Names.helpPrompt, helpPrompt);
+ } else {
+ parameters.remove(Names.helpPrompt);
+ }
+ }
+ public Vector<TTSChunk> getTimeoutPrompt() {
+ if (parameters.get(Names.timeoutPrompt) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.timeoutPrompt);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof TTSChunk) {
+ return (Vector<TTSChunk>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<TTSChunk> newList = new Vector<TTSChunk>();
+ for (Object hashObj : list) {
+ newList.add(new TTSChunk((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setTimeoutPrompt(Vector<TTSChunk> timeoutPrompt) {
+ if (timeoutPrompt != null) {
+ parameters.put(Names.timeoutPrompt, timeoutPrompt);
+ } else {
+ parameters.remove(Names.timeoutPrompt);
+ }
+ }
+ public Integer getTimeout() {
+ return (Integer) parameters.get(Names.timeout);
+ }
+ public void setTimeout(Integer timeout) {
+ if (timeout != null) {
+ parameters.put(Names.timeout, timeout);
+ } else {
+ parameters.remove(Names.timeout);
+ }
+ }
+ public Vector<VrHelpItem> getVrHelp() {
+ if (parameters.get(Names.vrHelp) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.vrHelp);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof VrHelpItem) {
+ return (Vector<VrHelpItem>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<VrHelpItem> newList = new Vector<VrHelpItem>();
+ for (Object hashObj : list) {
+ newList.add(new VrHelpItem((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setVrHelp(Vector<VrHelpItem> vrHelp) {
+ if (vrHelp != null) {
+ parameters.put(Names.vrHelp, vrHelp);
+ } else {
+ parameters.remove(Names.vrHelp);
+ }
+ }
+ public LayoutMode getInteractionLayout() {
+ Object obj = parameters.get(Names.interactionLayout);
+ if (obj instanceof LayoutMode) {
+ return (LayoutMode) obj;
+ } else if (obj instanceof String) {
+ LayoutMode theCode = null;
+ try {
+ theCode = LayoutMode.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.interactionLayout, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setInteractionLayout(LayoutMode layoutMode) {
+ if (layoutMode != null) {
+ parameters.put(Names.interactionLayout, layoutMode);
+ } else {
+ parameters.remove(Names.interactionLayout);
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PerformInteractionResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PerformInteractionResponse.java new file mode 100644 index 000000000..9cf35c497 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PerformInteractionResponse.java @@ -0,0 +1,56 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.TriggerSource;
+import com.ford.syncV4.util.DebugTool;
+
+public class PerformInteractionResponse extends RPCResponse {
+
+ public PerformInteractionResponse() {
+ super("PerformInteraction");
+ }
+ public PerformInteractionResponse(Hashtable hash) {
+ super(hash);
+ }
+ public Integer getChoiceID() {
+ return (Integer) parameters.get( Names.choiceID );
+ }
+ public void setChoiceID( Integer choiceID ) {
+ if (choiceID != null) {
+ parameters.put(Names.choiceID, choiceID );
+ }
+ }
+ public TriggerSource getTriggerSource() {
+ Object obj = parameters.get(Names.triggerSource);
+ if (obj instanceof TriggerSource) {
+ return (TriggerSource) obj;
+ } else if (obj instanceof String) {
+ TriggerSource theCode = null;
+ try {
+ theCode = TriggerSource.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.triggerSource, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setTriggerSource( TriggerSource triggerSource ) {
+ if (triggerSource != null) {
+ parameters.put(Names.triggerSource, triggerSource );
+ }
+ }
+ public void setManualTextEntry(String manualTextEntry) {
+ if (manualTextEntry != null) {
+ parameters.put(Names.manualTextEntry, manualTextEntry);
+ } else {
+ parameters.remove(Names.manualTextEntry);
+ }
+ }
+ public String getManualTextEntry() {
+ return (String) parameters.get(Names.manualTextEntry);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PermissionItem.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PermissionItem.java new file mode 100644 index 000000000..89bc89072 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PermissionItem.java @@ -0,0 +1,65 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.util.DebugTool; + +public class PermissionItem extends RPCStruct { + + public PermissionItem() { } + public PermissionItem(Hashtable hash) { + super(hash); + } + public String getRpcName() { + return (String) store.get(Names.rpcName); + } + public void setRpcName(String rpcName) { + if (rpcName != null) { + store.put(Names.rpcName, rpcName); + } else { + store.remove(Names.rpcName); + } + } + public HMIPermissions getHMIPermissions() { + Object obj = store.get(Names.hmiPermissions); + if (obj instanceof HMIPermissions) { + return (HMIPermissions) obj; + } else if (obj instanceof Hashtable) { + try { + return new HMIPermissions((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.hmiPermissions, e); + } + } + return null; + } + public void setHMIPermissions(HMIPermissions hmiPermissions) { + if (hmiPermissions != null) { + store.put(Names.hmiPermissions, hmiPermissions); + } else { + store.remove(Names.hmiPermissions); + } + } + public ParameterPermissions getParameterPermissions() { + Object obj = store.get(Names.parameterPermissions); + if (obj instanceof ParameterPermissions) { + return (ParameterPermissions) obj; + } else if (obj instanceof Hashtable) { + try { + return new ParameterPermissions((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.parameterPermissions, e); + } + } + return null; + } + public void setParameterPermissions(ParameterPermissions parameterPermissions) { + if (parameterPermissions != null) { + store.put(Names.parameterPermissions, parameterPermissions); + } else { + store.remove(Names.parameterPermissions); + } + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PresetBankCapabilities.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PresetBankCapabilities.java new file mode 100644 index 000000000..3fa99f184 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PresetBankCapabilities.java @@ -0,0 +1,24 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; + +public class PresetBankCapabilities extends RPCStruct { + + public PresetBankCapabilities() { } + public PresetBankCapabilities(Hashtable hash) { + super(hash); + } + public void setOnScreenPresetsAvailable(Boolean onScreenPresetsAvailable) { + if (onScreenPresetsAvailable != null) { + store.put(Names.OnScreenPresetsAvailable, onScreenPresetsAvailable); + } else { + store.remove(Names.OnScreenPresetsAvailable); + } + } + public Boolean onScreenPresetsAvailable() { + return (Boolean) store.get(Names.OnScreenPresetsAvailable); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PutFile.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PutFile.java new file mode 100644 index 000000000..e495ee6a2 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PutFile.java @@ -0,0 +1,127 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.FileType; +import com.ford.syncV4.util.DebugTool; + +public class PutFile extends RPCRequest { + + public PutFile() { + super("PutFile"); + } + public PutFile(Hashtable hash) { + super(hash); + } + + public PutFile(PutFile that) { + // FIXME test this! + super(that); + } + + public void setSyncFileName(String syncFileName) { + if (syncFileName != null) { + parameters.put(Names.syncFileName, syncFileName); + } else { + parameters.remove(Names.syncFileName); + } + } + public String getSyncFileName() { + return (String) parameters.get(Names.syncFileName); + } + public void setFileType(FileType fileType) { + if (fileType != null) { + parameters.put(Names.fileType, fileType); + } else { + parameters.remove(Names.fileType); + } + } + public FileType getFileType() { + Object obj = parameters.get(Names.fileType); + if (obj instanceof FileType) { + return (FileType) obj; + } else if (obj instanceof String) { + FileType theCode = null; + try { + theCode = FileType.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.fileType, e); + } + return theCode; + } + return null; + } + public void setPersistentFile(Boolean persistentFile) { + if (persistentFile != null) { + parameters.put(Names.persistentFile, persistentFile); + } else { + parameters.remove(Names.persistentFile); + } + } + public Boolean getPersistentFile() { + return (Boolean) parameters.get(Names.persistentFile); + } + public void setFileData(byte[] fileData) { + if (fileData != null) { + parameters.put(Names.bulkData, fileData); + } else { + parameters.remove(Names.bulkData); + } + } + public byte[] getFileData() { + return (byte[]) parameters.get(Names.bulkData); + } + + public void setSystemFile(Boolean systemFile) { + if (systemFile != null) { + parameters.put(Names.systemFile, systemFile); + } else { + parameters.remove(Names.systemFile); + } + } + + public Boolean getSystemFile() { + final Object o = parameters.get(Names.systemFile); + if (o instanceof Boolean) { + return (Boolean) o; + } + + return null; + } + + public void setOffset(Integer offset) { + if (offset != null) { + parameters.put(Names.offset, offset); + } else { + parameters.remove(Names.offset); + } + } + + public Integer getOffset() { + final Object o = parameters.get(Names.offset); + if (o instanceof Integer) { + return (Integer) o; + } + + return null; + } + + public void setLength(Integer length) { + if (length != null) { + parameters.put(Names.length, length); + } else { + parameters.remove(Names.length); + } + } + + public Integer getLength() { + final Object o = parameters.get(Names.length); + if (o instanceof Integer) { + return (Integer) o; + } + + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PutFileResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PutFileResponse.java new file mode 100644 index 000000000..309239f99 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/PutFileResponse.java @@ -0,0 +1,26 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCResponse; +import com.ford.syncV4.proxy.constants.Names; + +public class PutFileResponse extends RPCResponse { + + public PutFileResponse() { + super("PutFile"); + } + public PutFileResponse(Hashtable hash) { + super(hash); + } + public void setSpaceAvailable(Integer spaceAvailable) { + if (spaceAvailable != null) { + parameters.put(Names.spaceAvailable, spaceAvailable); + } else { + parameters.remove(Names.spaceAvailable); + } + } + public Integer getSpaceAvailable() { + return (Integer) parameters.get(Names.spaceAvailable); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ReadDID.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ReadDID.java new file mode 100644 index 000000000..1e3ebdf11 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ReadDID.java @@ -0,0 +1,46 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; + +public class ReadDID extends RPCRequest { + + public ReadDID() { + super("ReadDID"); + } + public ReadDID(Hashtable hash) { + super(hash); + } + public void setEcuName(Integer ecuName) { + if (ecuName != null) { + parameters.put(Names.ecuName, ecuName); + } else { + parameters.remove(Names.ecuName); + } + } + public Integer getEcuName() { + return (Integer) parameters.get(Names.ecuName); + } + public void setDidLocation(Vector<Integer> didLocation) { + if (didLocation != null) { + parameters.put(Names.didLocation, didLocation); + } else { + parameters.remove(Names.didLocation); + } + } + public Vector<Integer> getDidLocation() { + if (parameters.get(Names.didLocation) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)parameters.get(Names.didLocation); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof Integer) { + return (Vector<Integer>) list; + } + } + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ReadDIDResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ReadDIDResponse.java new file mode 100644 index 000000000..cb41d7bcf --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ReadDIDResponse.java @@ -0,0 +1,56 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCResponse; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.util.DebugTool; + +import java.util.Hashtable; +import java.util.Vector; + +public class ReadDIDResponse extends RPCResponse { + public ReadDIDResponse() { + super("ReadDID"); + } + + public ReadDIDResponse(Hashtable hash) { + super(hash); + } + + public Vector<DIDResult> getDidResult() { + final Object o = parameters.get(Names.didResult); + if (o instanceof Vector<?>) { + Vector<?> list = (Vector<?>) o; + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof DIDResult) { + return (Vector<DIDResult>) list; + } else if (obj instanceof Hashtable) { + Vector<DIDResult> newList = new Vector<DIDResult>(); + for (Object hashObj : list) { + DIDResult toAdd = null; + try { + toAdd = new DIDResult((Hashtable) hashObj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + + getClass().getSimpleName() + "." + + Names.didResult, e); + } + if (toAdd != null) { + newList.add(toAdd); + } + } + return newList; + } + } + } + return null; + } + + public void setDidResult(Vector<DIDResult> dataResult) { + if (dataResult != null) { + parameters.put(Names.didResult, dataResult); + } else { + parameters.remove(Names.didResult); + } + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/RegisterAppInterface.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/RegisterAppInterface.java new file mode 100644 index 000000000..84d52f33e --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/RegisterAppInterface.java @@ -0,0 +1,265 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.AppHMIType;
+import com.ford.syncV4.proxy.rpc.enums.Language;
+import com.ford.syncV4.util.DebugTool;
+
+public class RegisterAppInterface extends RPCRequest {
+
+ private static final int HASH_ID_MAX_LENGTH = 100;
+
+ public RegisterAppInterface() {
+ super(Names.RegisterAppInterface);
+ }
+
+ public RegisterAppInterface(Hashtable hash) {
+ super(hash);
+ }
+
+ public SyncMsgVersion getSyncMsgVersion() {
+ Object obj = parameters.get(Names.syncMsgVersion);
+ if (obj instanceof SyncMsgVersion) {
+ return (SyncMsgVersion) obj;
+ } else if (obj instanceof Hashtable) {
+ return new SyncMsgVersion((Hashtable) obj);
+ }
+ return null;
+ }
+
+ public void setSyncMsgVersion(SyncMsgVersion syncMsgVersion) {
+ if (syncMsgVersion != null) {
+ parameters.put(Names.syncMsgVersion, syncMsgVersion);
+ } else {
+ parameters.remove(Names.syncMsgVersion);
+ }
+ }
+
+ public String getAppName() {
+ return (String) parameters.get(Names.appName);
+ }
+
+ public void setAppName(String appName) {
+ if (appName != null) {
+ parameters.put(Names.appName, appName);
+ } else {
+ parameters.remove(Names.appName);
+ }
+ }
+
+ public Vector<TTSChunk> getTtsName() {
+ if (parameters.get(Names.ttsName) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>) parameters.get(Names.ttsName);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof TTSChunk) {
+ return (Vector<TTSChunk>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<TTSChunk> newList = new Vector<TTSChunk>();
+ for (Object hashObj : list) {
+ newList.add(new TTSChunk((Hashtable) hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void setTtsName(Vector<TTSChunk> ttsName) {
+ if (ttsName != null) {
+ parameters.put(Names.ttsName, ttsName);
+ } else {
+ parameters.remove(Names.ttsName);
+ }
+ }
+
+ public String getNgnMediaScreenAppName() {
+ return (String) parameters.get(Names.ngnMediaScreenAppName);
+ }
+
+ public void setNgnMediaScreenAppName(String ngnMediaScreenAppName) {
+ if (ngnMediaScreenAppName != null) {
+ parameters.put(Names.ngnMediaScreenAppName, ngnMediaScreenAppName);
+ } else {
+ parameters.remove(Names.ngnMediaScreenAppName);
+ }
+ }
+
+ public Vector<String> getVrSynonyms() {
+ if (parameters.get(Names.vrSynonyms) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>) parameters.get(Names.vrSynonyms);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof String) {
+ return (Vector<String>) list;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void setVrSynonyms(Vector<String> vrSynonyms) {
+ if (vrSynonyms != null) {
+ parameters.put(Names.vrSynonyms, vrSynonyms);
+ } else {
+ parameters.remove(Names.vrSynonyms);
+ }
+ }
+
+ public Boolean getIsMediaApplication() {
+ return (Boolean) parameters.get(Names.isMediaApplication);
+ }
+
+ public void setIsMediaApplication(Boolean isMediaApplication) {
+ if (isMediaApplication != null) {
+ parameters.put(Names.isMediaApplication, isMediaApplication);
+ } else {
+ parameters.remove(Names.isMediaApplication);
+ }
+ }
+
+ public Language getLanguageDesired() {
+ Object obj = parameters.get(Names.languageDesired);
+ if (obj instanceof Language) {
+ return (Language) obj;
+ } else if (obj instanceof String) {
+ Language theCode = null;
+ try {
+ theCode = Language.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.languageDesired, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+
+ public void setLanguageDesired(Language languageDesired) {
+ if (languageDesired != null) {
+ parameters.put(Names.languageDesired, languageDesired);
+ } else {
+ parameters.remove(Names.languageDesired);
+ }
+ }
+
+ public Language getHmiDisplayLanguageDesired() {
+ Object obj = parameters.get(Names.hmiDisplayLanguageDesired);
+ if (obj instanceof Language) {
+ return (Language) obj;
+ } else if (obj instanceof String) {
+ Language theCode = null;
+ try {
+ theCode = Language.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.hmiDisplayLanguageDesired, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+
+ public void setHmiDisplayLanguageDesired(Language hmiDisplayLanguageDesired) {
+ if (hmiDisplayLanguageDesired != null) {
+ parameters.put(Names.hmiDisplayLanguageDesired, hmiDisplayLanguageDesired);
+ } else {
+ parameters.remove(Names.hmiDisplayLanguageDesired);
+ }
+ }
+
+ public Vector<AppHMIType> getAppType() {
+ if (parameters.get(Names.appHMIType) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>) parameters.get(Names.appHMIType);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof AppHMIType) {
+ return (Vector<AppHMIType>) list;
+ } else if (obj instanceof String) {
+ Vector<AppHMIType> newList = new Vector<AppHMIType>();
+ for (Object hashObj : list) {
+ String strFormat = (String) hashObj;
+ AppHMIType toAdd = null;
+ try {
+ toAdd = AppHMIType.valueForString(strFormat);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.appHMIType, e);
+ }
+ if (toAdd != null) {
+ newList.add(toAdd);
+ }
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void setAppType(Vector<AppHMIType> appHMIType) {
+ if (appHMIType != null) {
+ parameters.put(Names.appHMIType, appHMIType);
+ } else {
+ parameters.remove(Names.appHMIType);
+ }
+ }
+
+ public String getAppID() {
+ return (String) parameters.get(Names.appID);
+ }
+
+ public void setAppID(String appID) {
+ if (appID != null) {
+ parameters.put(Names.appID, appID);
+ } else {
+ parameters.remove(Names.appID);
+ }
+ }
+
+ /**
+ * Return uniquely identify of the current state of all app data that can persist through
+ * connection cycles.
+ *
+ * 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.
+ *
+ * @return {@link java.lang.String} uniquely identify of the current state of all app data
+ */
+ public String getHashID() {
+ if (!parameters.containsKey(Names.hashID)) {
+ return null;
+ }
+ if (parameters.get(Names.hashID) instanceof String) {
+ return (String) parameters.get(Names.hashID);
+ }
+ return null;
+ }
+
+ /**
+ * Set uniquely identify of the current state of all app data that can persist through
+ * connection cycles.
+ *
+ * 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.
+ *
+ * @param hashID uniquely identify of the current state
+ */
+ public void setHashID(String hashID) {
+ if (hashID != null) {
+ if (hashID.length() > HASH_ID_MAX_LENGTH) {
+ throw new IllegalArgumentException("Parameter 'hashId' can have max length " +
+ "'" + HASH_ID_MAX_LENGTH + "', current length is '" + hashID.length() + "'");
+ }
+ parameters.put(Names.hashID, hashID);
+ } else {
+ parameters.remove(Names.hashID);
+ }
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/RegisterAppInterfaceResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/RegisterAppInterfaceResponse.java new file mode 100644 index 000000000..9ef3a8b2f --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/RegisterAppInterfaceResponse.java @@ -0,0 +1,370 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCResponse;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.HmiZoneCapabilities;
+import com.ford.syncV4.proxy.rpc.enums.Language;
+import com.ford.syncV4.proxy.rpc.enums.PrerecordedSpeech;
+import com.ford.syncV4.proxy.rpc.enums.SpeechCapabilities;
+import com.ford.syncV4.proxy.rpc.enums.VrCapabilities;
+import com.ford.syncV4.util.DebugTool;
+
+public class RegisterAppInterfaceResponse extends RPCResponse {
+
+ public RegisterAppInterfaceResponse() {
+ super("RegisterAppInterface");
+ }
+ public RegisterAppInterfaceResponse(Hashtable hash) {
+ super(hash);
+ }
+ public SyncMsgVersion getSyncMsgVersion() {
+ Object obj = parameters.get(Names.syncMsgVersion);
+ if (obj instanceof SyncMsgVersion) {
+ return (SyncMsgVersion)obj;
+ } else if (obj instanceof Hashtable) {
+ return new SyncMsgVersion((Hashtable)obj);
+ }
+ return null;
+ }
+ public void setSyncMsgVersion(SyncMsgVersion syncMsgVersion) {
+ if (syncMsgVersion != null) {
+ parameters.put(Names.syncMsgVersion, syncMsgVersion);
+ }
+ }
+ public Language getLanguage() {
+ Object obj = parameters.get(Names.language);
+ if (obj instanceof Language) {
+ return (Language) obj;
+ } else if (obj instanceof String) {
+ Language theCode = null;
+ try {
+ theCode = Language.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.language, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setLanguage(Language language) {
+ if (language != null) {
+ parameters.put(Names.language, language);
+ }
+ }
+ public Language getHmiDisplayLanguage() {
+ Object obj = parameters.get(Names.hmiDisplayLanguage);
+ if (obj instanceof Language) {
+ return (Language) obj;
+ } else if (obj instanceof String) {
+ Language theCode = null;
+ try {
+ theCode = Language.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.hmiDisplayLanguage, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setHmiDisplayLanguage(Language hmiDisplayLanguage) {
+ if (hmiDisplayLanguage != null) {
+ parameters.put(Names.hmiDisplayLanguage, hmiDisplayLanguage);
+ } else {
+ parameters.remove(Names.hmiDisplayLanguage);
+ }
+ }
+ public DisplayCapabilities getDisplayCapabilities() {
+ Object obj = parameters.get(Names.displayCapabilities);
+ if (obj instanceof DisplayCapabilities) {
+ return (DisplayCapabilities)obj;
+ } else if (obj instanceof Hashtable) {
+ return new DisplayCapabilities((Hashtable)obj);
+ }
+ return null;
+ }
+ public void setDisplayCapabilities(DisplayCapabilities displayCapabilities) {
+ if (displayCapabilities != null) {
+ parameters.put(Names.displayCapabilities, displayCapabilities);
+ }
+ }
+ public Vector<ButtonCapabilities> getButtonCapabilities() {
+ if (parameters.get(Names.buttonCapabilities) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.buttonCapabilities);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof ButtonCapabilities) {
+ return (Vector<ButtonCapabilities>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<ButtonCapabilities> newList = new Vector<ButtonCapabilities>();
+ for (Object hashObj : list) {
+ newList.add(new ButtonCapabilities((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setButtonCapabilities(Vector<ButtonCapabilities> buttonCapabilities) {
+ if (buttonCapabilities != null) {
+ parameters.put(Names.buttonCapabilities, buttonCapabilities);
+ }
+ }
+ public Vector<SoftButtonCapabilities> getSoftButtonCapabilities() {
+ if (parameters.get(Names.softButtonCapabilities) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.softButtonCapabilities);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof SoftButtonCapabilities) {
+ return (Vector<SoftButtonCapabilities>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<SoftButtonCapabilities> newList = new Vector<SoftButtonCapabilities>();
+ for (Object hashObj : list) {
+ newList.add(new SoftButtonCapabilities((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setSoftButtonCapabilities(Vector<SoftButtonCapabilities> softButtonCapabilities) {
+ if (softButtonCapabilities != null) {
+ parameters.put(Names.softButtonCapabilities, softButtonCapabilities);
+ }
+ }
+ public PresetBankCapabilities getPresetBankCapabilities() {
+ Object obj = parameters.get(Names.presetBankCapabilities);
+ if (obj instanceof PresetBankCapabilities) {
+ return (PresetBankCapabilities)obj;
+ } else if (obj instanceof Hashtable) {
+ return new PresetBankCapabilities((Hashtable)obj);
+ }
+ return null;
+ }
+ public void setPresetBankCapabilities(PresetBankCapabilities presetBankCapabilities) {
+ if (presetBankCapabilities != null) {
+ parameters.put(Names.presetBankCapabilities, presetBankCapabilities);
+ }
+ }
+ public Vector<HmiZoneCapabilities> getHmiZoneCapabilities() {
+ if (parameters.get(Names.hmiZoneCapabilities) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.hmiZoneCapabilities);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof HmiZoneCapabilities) {
+ return (Vector<HmiZoneCapabilities>) list;
+ } else if (obj instanceof String) {
+ Vector<HmiZoneCapabilities> newList = new Vector<HmiZoneCapabilities>();
+ for (Object hashObj : list) {
+ String strFormat = (String)hashObj;
+ HmiZoneCapabilities toAdd = null;
+ try {
+ toAdd = HmiZoneCapabilities.valueForString(strFormat);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.hmiZoneCapabilities, e);
+ }
+ if (toAdd != null) {
+ newList.add(toAdd);
+ }
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setHmiZoneCapabilities(Vector<HmiZoneCapabilities> hmiZoneCapabilities) {
+ if (hmiZoneCapabilities != null) {
+ parameters.put(Names.hmiZoneCapabilities, hmiZoneCapabilities);
+ }
+ }
+ public Vector<SpeechCapabilities> getSpeechCapabilities() {
+ if (parameters.get(Names.speechCapabilities) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.speechCapabilities);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof SpeechCapabilities) {
+ return (Vector<SpeechCapabilities>) list;
+ } else if (obj instanceof String) {
+ Vector<SpeechCapabilities> newList = new Vector<SpeechCapabilities>();
+ for (Object hashObj : list) {
+ String strFormat = (String)hashObj;
+ SpeechCapabilities toAdd = null;
+ try {
+ toAdd = SpeechCapabilities.valueForString(strFormat);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.speechCapabilities, e);
+ }
+ if (toAdd != null) {
+ newList.add(toAdd);
+ }
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setSpeechCapabilities(Vector<SpeechCapabilities> speechCapabilities) {
+ if (speechCapabilities != null) {
+ parameters.put(Names.speechCapabilities, speechCapabilities);
+ }
+ }
+
+ public Vector<PrerecordedSpeech> getPrerecordedSpeech() {
+ final Object o = parameters.get(Names.prerecordedSpeech);
+ if (o instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>) o;
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof PrerecordedSpeech) {
+ return (Vector<PrerecordedSpeech>) list;
+ } else if (obj instanceof String) {
+ Vector<PrerecordedSpeech> newList =
+ new Vector<PrerecordedSpeech>();
+ for (Object hashObj : list) {
+ String strFormat = (String) hashObj;
+ PrerecordedSpeech toAdd = null;
+ try {
+ toAdd = PrerecordedSpeech.valueForString(strFormat);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " +
+ getClass().getSimpleName() + "." +
+ Names.prerecordedSpeech, e);
+ }
+ if (toAdd != null) {
+ newList.add(toAdd);
+ }
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void setPrerecordedSpeech(
+ Vector<PrerecordedSpeech> prerecordedSpeech) {
+ if (prerecordedSpeech != null) {
+ parameters.put(Names.prerecordedSpeech, prerecordedSpeech);
+ } else {
+ parameters.remove(Names.prerecordedSpeech);
+ }
+ }
+
+ public Vector<VrCapabilities> getVrCapabilities() {
+ if (parameters.get(Names.vrCapabilities) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.vrCapabilities);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof VrCapabilities) {
+ return (Vector<VrCapabilities>) list;
+ } else if (obj instanceof String) {
+ Vector<VrCapabilities> newList = new Vector<VrCapabilities>();
+ for (Object hashObj : list) {
+ String strFormat = (String)hashObj;
+ VrCapabilities toAdd = null;
+ try {
+ toAdd = VrCapabilities.valueForString(strFormat);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.vrCapabilities, e);
+ }
+ if (toAdd != null) {
+ newList.add(toAdd);
+ }
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setVrCapabilities(Vector<VrCapabilities> vrCapabilities) {
+ if (vrCapabilities != null) {
+ parameters.put(Names.vrCapabilities, vrCapabilities);
+ }
+ }
+
+ public Vector<AudioPassThruCapabilities> getAudioPassThruCapabilities() {
+ final Object o = parameters.get(Names.audioPassThruCapabilities);
+ if (o instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>) o;
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof AudioPassThruCapabilities) {
+ return (Vector<AudioPassThruCapabilities>) list;
+ } else if (obj instanceof String) {
+ Vector<AudioPassThruCapabilities> newList =
+ new Vector<AudioPassThruCapabilities>();
+ for (Object hashObj : list) {
+ AudioPassThruCapabilities toAdd = null;
+ try {
+ toAdd = new AudioPassThruCapabilities(
+ (Hashtable) hashObj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " +
+ getClass().getSimpleName() + "." +
+ Names.audioPassThruCapabilities, e);
+ }
+ if (toAdd != null) {
+ newList.add(toAdd);
+ }
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void setAudioPassThruCapabilities(
+ Vector<AudioPassThruCapabilities> audioPassThruCapabilities) {
+ if (audioPassThruCapabilities != null) {
+ parameters.put(Names.audioPassThruCapabilities,
+ audioPassThruCapabilities);
+ } else {
+ parameters.remove(Names.audioPassThruCapabilities);
+ }
+ }
+
+ public VehicleType getVehicleType() {
+ Object obj = parameters.get(Names.vehicleType);
+ if (obj instanceof VehicleType) {
+ return (VehicleType)obj;
+ } else if (obj instanceof Hashtable) {
+ return new VehicleType((Hashtable)obj);
+ }
+ return null;
+ }
+ public void setVehicleType(VehicleType vehicleType) {
+ if (vehicleType != null) {
+ parameters.put(Names.vehicleType, vehicleType);
+ }
+ }
+
+ public Vector<Integer> getSupportedDiagModes() {
+ final Object o = parameters.get(Names.supportedDiagModes);
+ if (o instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>) o;
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof Integer) {
+ return (Vector<Integer>) list;
+ }
+ }
+ }
+ return null;
+ }
+
+ public void setSupportedDiagModes(Vector<Integer> supportedDiagModes) {
+ if (supportedDiagModes != null) {
+ parameters.put(Names.supportedDiagModes, supportedDiagModes);
+ } else {
+ parameters.remove(Names.supportedDiagModes);
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ResetGlobalProperties.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ResetGlobalProperties.java new file mode 100644 index 000000000..750ec2fa8 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ResetGlobalProperties.java @@ -0,0 +1,51 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.GlobalProperty;
+import com.ford.syncV4.util.DebugTool;
+
+public class ResetGlobalProperties extends RPCRequest {
+
+ public ResetGlobalProperties() {
+ super("ResetGlobalProperties");
+ }
+ public ResetGlobalProperties(Hashtable hash) {
+ super(hash);
+ }
+ public Vector<GlobalProperty> getProperties() {
+ if (parameters.get(Names.properties) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.properties);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof GlobalProperty) {
+ return (Vector<GlobalProperty>) list;
+ } else if (obj instanceof String) {
+ Vector<GlobalProperty> newList = new Vector<GlobalProperty>();
+ for (Object hashObj : list) {
+ String strFormat = (String)hashObj;
+ GlobalProperty toAdd = null;
+ try {
+ toAdd = GlobalProperty.valueForString(strFormat);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.properties, e);
+ }
+ if (toAdd != null) {
+ newList.add(toAdd);
+ }
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setProperties( Vector<GlobalProperty> properties ) {
+ if (properties != null) {
+ parameters.put(Names.properties, properties );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ResetGlobalPropertiesResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ResetGlobalPropertiesResponse.java new file mode 100644 index 000000000..96ae74537 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ResetGlobalPropertiesResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class ResetGlobalPropertiesResponse extends RPCResponse {
+
+ public ResetGlobalPropertiesResponse() {
+ super("ResetGlobalProperties");
+ }
+ public ResetGlobalPropertiesResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ScreenParams.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ScreenParams.java new file mode 100644 index 000000000..f1e1f9daf --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ScreenParams.java @@ -0,0 +1,65 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.util.DebugTool; + +import java.util.Hashtable; + +public class ScreenParams extends RPCStruct { + public ScreenParams() { + } + + public ScreenParams(Hashtable hash) { + super(hash); + } + + public ImageResolution getResolution() { + Object obj = store.get(Names.resolution); + if (obj instanceof ImageResolution) { + return (ImageResolution) obj; + } else if (obj instanceof Hashtable) { + try { + return new ImageResolution((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.resolution, e); + } + } + return null; + } + + public void setResolution(ImageResolution resolution) { + if (resolution != null) { + store.put(Names.resolution, resolution); + } else { + store.remove(Names.resolution); + } + } + + public TouchEventCapabilities getTouchEventAvailable() { + Object obj = store.get(Names.touchEventAvailable); + if (obj instanceof TouchEventCapabilities) { + return (TouchEventCapabilities) obj; + } else if (obj instanceof Hashtable) { + try { + return new TouchEventCapabilities((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.touchEventAvailable, e); + } + } + return null; + } + + public void setTouchEventAvailable( + TouchEventCapabilities touchEventCapabilities) { + if (touchEventCapabilities != null) { + store.put(Names.touchEventAvailable, touchEventCapabilities); + } else { + store.remove(Names.touchEventAvailable); + } + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ScrollableMessage.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ScrollableMessage.java new file mode 100644 index 000000000..947c183a5 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ScrollableMessage.java @@ -0,0 +1,64 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.SystemAction; +import com.ford.syncV4.util.DebugTool; + +public class ScrollableMessage extends RPCRequest { + + public ScrollableMessage() { + super("ScrollableMessage"); + } + public ScrollableMessage(Hashtable hash) { + super(hash); + } + public void setScrollableMessageBody(String scrollableMessageBody) { + if (scrollableMessageBody != null) { + parameters.put(Names.scrollableMessageBody, scrollableMessageBody); + } else { + parameters.remove(Names.scrollableMessageBody); + } + } + public String getScrollableMessageBody() { + return (String) parameters.get(Names.scrollableMessageBody); + } + public void setTimeout(Integer timeout) { + if (timeout != null) { + parameters.put(Names.timeout, timeout); + } else { + parameters.remove(Names.timeout); + } + } + public Integer getTimeout() { + return (Integer) parameters.get(Names.timeout); + } + public void setSoftButtons(Vector<SoftButton> softButtons) { + if (softButtons != null) { + parameters.put(Names.softButtons, softButtons); + } else { + parameters.remove(Names.softButtons); + } + } + public Vector<SoftButton> getSoftButtons() { + if (parameters.get(Names.softButtons) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)parameters.get(Names.softButtons); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof SoftButton) { + return (Vector<SoftButton>) list; + } else if (obj instanceof Hashtable) { + Vector<SoftButton> newList = new Vector<SoftButton>(); + for (Object hashObj : list) { + newList.add(new SoftButton((Hashtable) hashObj)); + } + return newList; + } + } + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ScrollableMessageResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ScrollableMessageResponse.java new file mode 100644 index 000000000..155ad8a48 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ScrollableMessageResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCResponse; + +public class ScrollableMessageResponse extends RPCResponse { + + public ScrollableMessageResponse() { + super("ScrollableMessage"); + } + public ScrollableMessageResponse(Hashtable hash) { + super(hash); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetAppIcon.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetAppIcon.java new file mode 100644 index 000000000..a6ff25117 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetAppIcon.java @@ -0,0 +1,26 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; + +public class SetAppIcon extends RPCRequest { + + public SetAppIcon() { + super("SetAppIcon"); + } + public SetAppIcon(Hashtable hash) { + super(hash); + } + public void setSyncFileName(String syncFileName) { + if (syncFileName != null) { + parameters.put(Names.syncFileName, syncFileName); + } else { + parameters.remove(Names.syncFileName); + } + } + public String getSyncFileName() { + return (String) parameters.get(Names.syncFileName); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetAppIconResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetAppIconResponse.java new file mode 100644 index 000000000..62982598f --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetAppIconResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCResponse; + +public class SetAppIconResponse extends RPCResponse { + + public SetAppIconResponse() { + super("SetAppIcon"); + } + public SetAppIconResponse(Hashtable hash) { + super(hash); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetDisplayLayout.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetDisplayLayout.java new file mode 100644 index 000000000..108b63653 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetDisplayLayout.java @@ -0,0 +1,27 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.util.DebugTool; + +public class SetDisplayLayout extends RPCRequest { + + public SetDisplayLayout() { + super("SetDisplayLayout"); + } + public SetDisplayLayout(Hashtable hash) { + super(hash); + } + public void setDisplayLayout(String displayLayout) { + if (displayLayout != null) { + parameters.put(Names.displayLayout, displayLayout); + } else { + parameters.remove(Names.displayLayout); + } + } + public String getDisplayLayout() { + return (String) parameters.get(Names.displayLayout); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetDisplayLayoutResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetDisplayLayoutResponse.java new file mode 100644 index 000000000..cb190f260 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetDisplayLayoutResponse.java @@ -0,0 +1,120 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCResponse; +import com.ford.syncV4.proxy.constants.Names; + +import java.util.Hashtable; +import java.util.Vector; + +public class SetDisplayLayoutResponse extends RPCResponse { + + public SetDisplayLayoutResponse() { + super("SetDisplayLayout"); + } + + public SetDisplayLayoutResponse(Hashtable hash) { + super(hash); + } + + public DisplayCapabilities getDisplayCapabilities() { + Object obj = parameters.get(Names.displayCapabilities); + if (obj instanceof DisplayCapabilities) { + return (DisplayCapabilities) obj; + } else if (obj instanceof Hashtable) { + return new DisplayCapabilities((Hashtable) obj); + } + return null; + } + + public void setDisplayCapabilities( + DisplayCapabilities displayCapabilities) { + if (displayCapabilities != null) { + parameters.put(Names.displayCapabilities, displayCapabilities); + } else { + parameters.remove(Names.displayCapabilities); + } + } + + public Vector<ButtonCapabilities> getButtonCapabilities() { + final Object o = parameters.get(Names.buttonCapabilities); + if (o instanceof Vector<?>) { + Vector<?> list = (Vector<?>) o; + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof ButtonCapabilities) { + return (Vector<ButtonCapabilities>) list; + } else if (obj instanceof Hashtable) { + Vector<ButtonCapabilities> newList = + new Vector<ButtonCapabilities>(); + for (Object hashObj : list) { + newList.add( + new ButtonCapabilities((Hashtable) hashObj)); + } + return newList; + } + } + } + return null; + } + + public void setButtonCapabilities( + Vector<ButtonCapabilities> buttonCapabilities) { + if (buttonCapabilities != null) { + parameters.put(Names.buttonCapabilities, buttonCapabilities); + } else { + parameters.remove(Names.buttonCapabilities); + } + } + + public Vector<SoftButtonCapabilities> getSoftButtonCapabilities() { + final Object o = parameters.get(Names.softButtonCapabilities); + if (o instanceof Vector<?>) { + Vector<?> list = (Vector<?>) o; + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof SoftButtonCapabilities) { + return (Vector<SoftButtonCapabilities>) list; + } else if (obj instanceof Hashtable) { + Vector<SoftButtonCapabilities> newList = + new Vector<SoftButtonCapabilities>(); + for (Object hashObj : list) { + newList.add(new SoftButtonCapabilities( + (Hashtable) hashObj)); + } + return newList; + } + } + } + return null; + } + + public void setSoftButtonCapabilities( + Vector<SoftButtonCapabilities> softButtonCapabilities) { + if (softButtonCapabilities != null) { + parameters.put(Names.softButtonCapabilities, + softButtonCapabilities); + } else { + parameters.remove(Names.softButtonCapabilities); + } + } + + public PresetBankCapabilities getPresetBankCapabilities() { + Object obj = parameters.get(Names.presetBankCapabilities); + if (obj instanceof PresetBankCapabilities) { + return (PresetBankCapabilities) obj; + } else if (obj instanceof Hashtable) { + return new PresetBankCapabilities((Hashtable) obj); + } + return null; + } + + public void setPresetBankCapabilities( + PresetBankCapabilities presetBankCapabilities) { + if (presetBankCapabilities != null) { + parameters.put(Names.presetBankCapabilities, + presetBankCapabilities); + } else { + parameters.remove(Names.presetBankCapabilities); + } + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetGlobalProperties.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetGlobalProperties.java new file mode 100644 index 000000000..e19bc8848 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetGlobalProperties.java @@ -0,0 +1,140 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class SetGlobalProperties extends RPCRequest {
+
+ public SetGlobalProperties() {
+ super("SetGlobalProperties");
+ }
+ public SetGlobalProperties(Hashtable hash) {
+ super(hash);
+ }
+ public Vector<TTSChunk> getHelpPrompt() {
+ if (parameters.get(Names.helpPrompt) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.helpPrompt);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof TTSChunk) {
+ return (Vector<TTSChunk>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<TTSChunk> newList = new Vector<TTSChunk>();
+ for (Object hashObj : list) {
+ newList.add(new TTSChunk((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setHelpPrompt(Vector<TTSChunk> helpPrompt) {
+ if (helpPrompt != null) {
+ parameters.put(Names.helpPrompt, helpPrompt);
+ }
+ }
+ public Vector<TTSChunk> getTimeoutPrompt() {
+ if (parameters.get(Names.timeoutPrompt) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.timeoutPrompt);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof TTSChunk) {
+ return (Vector<TTSChunk>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<TTSChunk> newList = new Vector<TTSChunk>();
+ for (Object hashObj : list) {
+ newList.add(new TTSChunk((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setTimeoutPrompt(Vector<TTSChunk> timeoutPrompt) {
+ if (timeoutPrompt != null) {
+ parameters.put(Names.timeoutPrompt, timeoutPrompt);
+ }
+ }
+ public String getVrHelpTitle() {
+ return (String) parameters.get(Names.vrHelpTitle);
+ }
+ public void setVrHelpTitle(String vrHelpTitle) {
+ if (vrHelpTitle != null) {
+ parameters.put(Names.vrHelpTitle, vrHelpTitle);
+ } else {
+ parameters.remove(Names.vrHelpTitle);
+ }
+ }
+ public Vector<VrHelpItem> getVrHelp() {
+ if (parameters.get(Names.vrHelp) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.vrHelp);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof VrHelpItem) {
+ return (Vector<VrHelpItem>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<VrHelpItem> newList = new Vector<VrHelpItem>();
+ for (Object hashObj : list) {
+ newList.add(new VrHelpItem((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setVrHelp(Vector<VrHelpItem> vrHelp) {
+ if (vrHelp != null) {
+ parameters.put(Names.vrHelp, vrHelp);
+ } else {
+ parameters.remove(Names.vrHelp);
+ }
+ }
+ public String getMenuTitle() {
+ final Object obj = parameters.get(Names.menuTitle);
+ if (obj instanceof String) {
+ return (String) obj;
+ }
+ return null;
+ }
+ public void setMenuTitle(String menuTitle) {
+ if (menuTitle != null) {
+ parameters.put(Names.menuTitle, menuTitle);
+ } else {
+ parameters.remove(Names.menuTitle);
+ }
+ }
+ public Image getMenuIcon() {
+ final Object obj = parameters.get(Names.menuIcon);
+ if (obj instanceof Image) {
+ return (Image) obj;
+ }
+ return null;
+ }
+ public void setMenuIcon(Image menuIcon) {
+ if (menuIcon != null) {
+ parameters.put(Names.menuIcon, menuIcon);
+ } else {
+ parameters.remove(Names.menuIcon);
+ }
+ }
+ public KeyboardProperties getKeyboardProperties() {
+ final Object obj = parameters.get(Names.keyboardProperties);
+ if (obj instanceof KeyboardProperties) {
+ return (KeyboardProperties) obj;
+ }
+ return null;
+ }
+ public void setKeyboardProperties(KeyboardProperties keyboardProperties) {
+ if (keyboardProperties != null) {
+ parameters.put(Names.keyboardProperties, keyboardProperties);
+ } else {
+ parameters.remove(Names.keyboardProperties);
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetGlobalPropertiesResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetGlobalPropertiesResponse.java new file mode 100644 index 000000000..4b6c79366 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetGlobalPropertiesResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class SetGlobalPropertiesResponse extends RPCResponse {
+
+ public SetGlobalPropertiesResponse() {
+ super("SetGlobalProperties");
+ }
+ public SetGlobalPropertiesResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetMediaClockTimer.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetMediaClockTimer.java new file mode 100644 index 000000000..1dfd6e367 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetMediaClockTimer.java @@ -0,0 +1,71 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.UpdateMode;
+import com.ford.syncV4.util.DebugTool;
+
+public class SetMediaClockTimer extends RPCRequest {
+
+ public SetMediaClockTimer() {
+ super("SetMediaClockTimer");
+ }
+ public SetMediaClockTimer(Hashtable hash) {
+ super(hash);
+ }
+ public StartTime getStartTime() {
+ Object obj = parameters.get(Names.startTime);
+ if (obj instanceof StartTime) {
+ return (StartTime)obj;
+ } else if (obj instanceof Hashtable) {
+ return new StartTime((Hashtable)obj);
+ }
+ return null;
+ }
+ public void setStartTime( StartTime startTime ) {
+ if (startTime != null) {
+ parameters.put(Names.startTime, startTime );
+ }
+ }
+
+ public StartTime getEndTime() {
+ Object obj = parameters.get(Names.endTime);
+ if (obj instanceof StartTime) {
+ return (StartTime) obj;
+ } else if (obj instanceof Hashtable) {
+ return new StartTime((Hashtable) obj);
+ }
+ return null;
+ }
+
+ public void setEndTime(StartTime endTime) {
+ if (endTime != null) {
+ parameters.put(Names.endTime, endTime);
+ } else {
+ parameters.remove(Names.endTime);
+ }
+ }
+
+ public UpdateMode getUpdateMode() {
+ Object obj = parameters.get(Names.updateMode);
+ if (obj instanceof UpdateMode) {
+ return (UpdateMode) obj;
+ } else if (obj instanceof String) {
+ UpdateMode theCode = null;
+ try {
+ theCode = UpdateMode.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.updateMode, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setUpdateMode( UpdateMode updateMode ) {
+ if (updateMode != null) {
+ parameters.put(Names.updateMode, updateMode );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetMediaClockTimerResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetMediaClockTimerResponse.java new file mode 100644 index 000000000..e62ea9323 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SetMediaClockTimerResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class SetMediaClockTimerResponse extends RPCResponse {
+
+ public SetMediaClockTimerResponse() {
+ super("SetMediaClockTimer");
+ }
+ public SetMediaClockTimerResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Show.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Show.java new file mode 100644 index 000000000..d2008bb82 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Show.java @@ -0,0 +1,200 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.TextAlignment;
+import com.ford.syncV4.util.DebugTool;
+
+public class Show extends RPCRequest {
+
+ public Show() {
+ super("Show");
+ }
+ public Show(Hashtable hash) {
+ super(hash);
+ }
+ public String getMainField1() {
+ return (String) parameters.get(Names.mainField1);
+ }
+ public void setMainField1(String mainField1) {
+ if (mainField1 != null) {
+ parameters.put(Names.mainField1, mainField1);
+ } else {
+ parameters.remove(Names.mainField1);
+ }
+ }
+ public String getMainField2() {
+ return (String) parameters.get(Names.mainField2);
+ }
+ public void setMainField2(String mainField2) {
+ if (mainField2 != null) {
+ parameters.put(Names.mainField2, mainField2);
+ } else {
+ parameters.remove(Names.mainField2);
+ }
+ }
+ public String getMainField3() {
+ return (String) parameters.get(Names.mainField3);
+ }
+ public void setMainField3(String mainField3) {
+ if (mainField3 != null) {
+ parameters.put(Names.mainField3, mainField3);
+ } else {
+ parameters.remove(Names.mainField3);
+ }
+ }
+ public String getMainField4() {
+ return (String) parameters.get(Names.mainField4);
+ }
+ public void setMainField4(String mainField4) {
+ if (mainField4 != null) {
+ parameters.put(Names.mainField4, mainField4);
+ } else {
+ parameters.remove(Names.mainField4);
+ }
+ }
+ public TextAlignment getAlignment() {
+ Object obj = parameters.get(Names.alignment);
+ if (obj instanceof TextAlignment) {
+ return (TextAlignment) obj;
+ } else if (obj instanceof String) {
+ TextAlignment theCode = null;
+ try {
+ theCode = TextAlignment.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.alignment, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setAlignment(TextAlignment alignment) {
+ if (alignment != null) {
+ parameters.put(Names.alignment, alignment);
+ } else {
+ parameters.remove(Names.alignment);
+ }
+ }
+ public String getStatusBar() {
+ return (String) parameters.get(Names.statusBar);
+ }
+ public void setStatusBar(String statusBar) {
+ if (statusBar != null) {
+ parameters.put(Names.statusBar, statusBar);
+ } else {
+ parameters.remove(Names.statusBar);
+ }
+ }
+ public String getMediaClock() {
+ return (String) parameters.get(Names.mediaClock);
+ }
+ public void setMediaClock(String mediaClock) {
+ if (mediaClock != null) {
+ parameters.put(Names.mediaClock, mediaClock);
+ } else {
+ parameters.remove(Names.mediaClock);
+ }
+ }
+ public String getMediaTrack() {
+ return (String) parameters.get(Names.mediaTrack);
+ }
+ public void setMediaTrack(String mediaTrack) {
+ if (mediaTrack != null) {
+ parameters.put(Names.mediaTrack, mediaTrack);
+ } else {
+ parameters.remove(Names.mediaTrack);
+ }
+ }
+ public void setGraphic(Image graphic) {
+ if (graphic != null) {
+ parameters.put(Names.graphic, graphic);
+ } else {
+ parameters.remove(Names.graphic);
+ }
+ }
+ public Image getGraphic() {
+ Object obj = parameters.get(Names.graphic);
+ if (obj instanceof Image) {
+ return (Image) obj;
+ } else if (obj instanceof Hashtable) {
+ try {
+ return new Image((Hashtable) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.graphic, e);
+ }
+ }
+ return null;
+ }
+
+ public void setSecondaryGraphic(Image secondaryGraphic) {
+ if (secondaryGraphic != null) {
+ parameters.put(Names.secondaryGraphic, secondaryGraphic);
+ } else {
+ parameters.remove(Names.secondaryGraphic);
+ }
+ }
+
+ public Image getSecondaryGraphic() {
+ Object obj = parameters.get(Names.secondaryGraphic);
+ if (obj instanceof Image) {
+ return (Image) obj;
+ } else if (obj instanceof Hashtable) {
+ try {
+ return new Image((Hashtable) obj);
+ } catch (Exception e) {
+ DebugTool.logError(
+ "Failed to parse " + getClass().getSimpleName() + "." +
+ Names.secondaryGraphic, e);
+ }
+ }
+ return null;
+ }
+
+ public Vector<SoftButton> getSoftButtons() {
+ if (parameters.get(Names.softButtons) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.softButtons);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof SoftButton) {
+ return (Vector<SoftButton>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<SoftButton> newList = new Vector<SoftButton>();
+ for (Object hashObj : list) {
+ newList.add(new SoftButton((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setSoftButtons(Vector<SoftButton> softButtons) {
+ if (softButtons != null) {
+ parameters.put(Names.softButtons, softButtons);
+ } else {
+ parameters.remove(Names.softButtons);
+ }
+ }
+ public Vector<String> getCustomPresets() {
+ if (parameters.get(Names.customPresets) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.customPresets);
+ if (list != null && list.size()>0) {
+ Object obj = list.get(0);
+ if (obj instanceof String) {
+ return (Vector<String>) list;
+ }
+ }
+ }
+ return null;
+ }
+ public void setCustomPresets(Vector<String> customPresets) {
+ if (customPresets != null) {
+ parameters.put(Names.customPresets, customPresets);
+ } else {
+ parameters.remove(Names.customPresets);
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ShowConstantTBT.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ShowConstantTBT.java new file mode 100644 index 000000000..2e9f35e15 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ShowConstantTBT.java @@ -0,0 +1,157 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; + +import java.util.Hashtable; +import java.util.Vector; + +public class ShowConstantTBT extends RPCRequest { + + public ShowConstantTBT() { + super("ShowConstantTBT"); + } + public ShowConstantTBT(Hashtable hash) { + super(hash); + } + public void setNavigationText1(String navigationText1) { + if (navigationText1 != null) { + parameters.put(Names.navigationText1, navigationText1); + } else { + parameters.remove(Names.navigationText1); + } + } + public String getNavigationText1() { + return (String) parameters.get(Names.navigationText1); + } + public void setNavigationText2(String navigationText2) { + if (navigationText2 != null) { + parameters.put(Names.navigationText2, navigationText2); + } else { + parameters.remove(Names.navigationText2); + } + } + public String getNavigationText2() { + return (String) parameters.get(Names.navigationText2); + } + public void setEta(String eta) { + if (eta != null) { + parameters.put(Names.eta, eta); + } else { + parameters.remove(Names.eta); + } + } + public String getEta() { + return (String) parameters.get(Names.eta); + } + public void setTimeToDestination(String timeToDestination) { + if (timeToDestination != null) { + parameters.put(Names.timeToDestination, timeToDestination); + } else { + parameters.remove(Names.timeToDestination); + } + } + public String getTimeToDestination() { + return (String) parameters.get(Names.timeToDestination); + } + public void setTotalDistance(String totalDistance) { + if (totalDistance != null) { + parameters.put(Names.totalDistance, totalDistance); + } else { + parameters.remove(Names.totalDistance); + } + } + public String getTotalDistance() { + return (String) parameters.get(Names.totalDistance); + } + public void setTurnIcon(Image turnIcon) { + if (turnIcon != null) { + parameters.put(Names.turnIcon, turnIcon); + } else { + parameters.remove(Names.turnIcon); + } + } + public Image getTurnIcon() { + Object obj = parameters.get(Names.turnIcon); + if (obj instanceof Image) { + return (Image) obj; + } else { + return new Image((Hashtable) obj); + } + } + public void setNextTurnIcon(Image nextTurnIcon) { + if (nextTurnIcon != null) { + parameters.put(Names.nextTurnIcon, nextTurnIcon); + } else { + parameters.remove(Names.nextTurnIcon); + } + } + public Image getNextTurnIcon() { + Object obj = parameters.get(Names.nextTurnIcon); + if (obj == null) { + // TODO: add this if to all messages' getters? + // TODO: 28.02.2014: Really? Are you sure? + return null; + } + if (obj instanceof Image) { + return (Image) obj; + } else { + return new Image((Hashtable) obj); + } + } + public void setDistanceToManeuver(Float distanceToManeuver) { + if (distanceToManeuver != null) { + parameters.put(Names.distanceToManeuver, distanceToManeuver); + } else { + parameters.remove(Names.distanceToManeuver); + } + } + public Float getDistanceToManeuver() { + return (Float) parameters.get(Names.distanceToManeuver); + } + public void setDistanceToManeuverScale(Float distanceToManeuverScale) { + if (distanceToManeuverScale != null) { + parameters.put(Names.distanceToManeuverScale, distanceToManeuverScale); + } else { + parameters.remove(Names.distanceToManeuverScale); + } + } + public Float getDistanceToManeuverScale() { + return (Float) parameters.get(Names.distanceToManeuverScale); + } + public void setManeuverComplete(Boolean maneuverComplete) { + if (maneuverComplete != null) { + parameters.put(Names.maneuverComplete, maneuverComplete); + } else { + parameters.remove(Names.maneuverComplete); + } + } + public Boolean getManeuverComplete() { + return (Boolean) parameters.get(Names.maneuverComplete); + } + public void setSoftButtons(Vector<SoftButton> softButtons) { + if (softButtons != null) { + parameters.put(Names.softButtons, softButtons); + } else { + parameters.remove(Names.softButtons); + } + } + public Vector<SoftButton> getSoftButtons() { + if (parameters.get(Names.softButtons) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)parameters.get(Names.softButtons); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof SoftButton) { + return (Vector<SoftButton>) list; + } else if (obj instanceof Hashtable) { + Vector<SoftButton> newList = new Vector<SoftButton>(); + for (Object hashObj : list) { + newList.add(new SoftButton((Hashtable)hashObj)); + } + return newList; + } + } + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ShowConstantTBTResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ShowConstantTBTResponse.java new file mode 100644 index 000000000..112ffb8bc --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ShowConstantTBTResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCResponse; + +public class ShowConstantTBTResponse extends RPCResponse { + + public ShowConstantTBTResponse() { + super("ShowConstantTBT"); + } + public ShowConstantTBTResponse(Hashtable hash) { + super(hash); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ShowResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ShowResponse.java new file mode 100644 index 000000000..819a48455 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/ShowResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class ShowResponse extends RPCResponse {
+
+ public ShowResponse() {
+ super("Show");
+ }
+ public ShowResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SingleTireStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SingleTireStatus.java new file mode 100644 index 000000000..5f7dfe048 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SingleTireStatus.java @@ -0,0 +1,48 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.SingleTirePressureStatus; +import com.ford.syncV4.util.DebugTool; + +public class SingleTireStatus extends RPCStruct { + + public SingleTireStatus() { } + public SingleTireStatus(Hashtable hash) { + super(hash); + } + public void setStatus(SingleTirePressureStatus status) { + if (status != null) { + store.put(Names.status, status); + } else { + store.remove(Names.status); + } + } + public SingleTirePressureStatus getStatus() { + Object obj = store.get(Names.status); + if (obj instanceof SingleTirePressureStatus) { + return (SingleTirePressureStatus) obj; + } else if (obj instanceof String) { + SingleTirePressureStatus theCode = null; + try { + theCode = SingleTirePressureStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.status, e); + } + return theCode; + } + return null; + } + public void setPressure(Integer pressure) { + if (pressure != null) { + store.put(Names.pressure, pressure); + } else { + store.remove(Names.pressure); + } + } + public Integer getPressure() { + return (Integer) store.get(Names.pressure); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Slider.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Slider.java new file mode 100644 index 000000000..165698027 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Slider.java @@ -0,0 +1,76 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; + +public class Slider extends RPCRequest { + + public Slider() { + super("Slider"); + } + public Slider(Hashtable hash) { + super(hash); + } + public void setNumTicks(Integer numTicks) { + if (numTicks != null) { + parameters.put(Names.numTicks, numTicks); + } else { + parameters.remove(Names.numTicks); + } + } + public Integer getNumTicks() { + return (Integer) parameters.get(Names.numTicks); + } + public void setPosition(Integer position) { + if (position != null) { + parameters.put(Names.position, position); + } else { + parameters.remove(Names.position); + } + } + public Integer getPosition() { + return (Integer) parameters.get(Names.position); + } + public void setSliderHeader(String sliderHeader) { + if (sliderHeader != null) { + parameters.put(Names.sliderHeader, sliderHeader); + } else { + parameters.remove(Names.sliderHeader); + } + } + public String getSliderHeader() { + return (String) parameters.get(Names.sliderHeader); + } + public void setSliderFooter(Vector<String> sliderFooter) { + if (sliderFooter != null) { + parameters.put(Names.sliderFooter, sliderFooter); + } else { + parameters.remove(Names.sliderFooter); + } + } + public Vector<String> getSliderFooter() { + if (parameters.get(Names.sliderFooter) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)parameters.get(Names.sliderFooter); + if (list != null && list.size()>0) { + Object obj = list.get(0); + if (obj instanceof String) { + return (Vector<String>) list; + } + } + } + return null; + } + public void setTimeout(Integer timeout) { + if (timeout != null) { + parameters.put(Names.timeout, timeout); + } else { + parameters.remove(Names.timeout); + } + } + public Integer getTimeout() { + return (Integer) parameters.get(Names.timeout); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SliderResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SliderResponse.java new file mode 100644 index 000000000..997dbeddd --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SliderResponse.java @@ -0,0 +1,26 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCResponse; +import com.ford.syncV4.proxy.constants.Names; + +public class SliderResponse extends RPCResponse { + + public SliderResponse() { + super("Slider"); + } + public SliderResponse(Hashtable hash) { + super(hash); + } + public void setSliderPosition(Integer sliderPosition) { + if (sliderPosition != null) { + parameters.put(Names.sliderPosition, sliderPosition); + } else { + parameters.remove(Names.sliderPosition); + } + } + public Integer getSliderPosition() { + return (Integer) parameters.get(Names.sliderPosition); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SoftButton.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SoftButton.java new file mode 100644 index 000000000..075cdaf19 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SoftButton.java @@ -0,0 +1,111 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.SoftButtonType; +import com.ford.syncV4.proxy.rpc.enums.SystemAction; +import com.ford.syncV4.util.DebugTool; + +public class SoftButton extends RPCStruct { + + public SoftButton() { } + public SoftButton(Hashtable hash) { + super(hash); + } + public void setType(SoftButtonType type) { + if (type != null) { + store.put(Names.type, type); + } else { + store.remove(Names.type); + } + } + public SoftButtonType getType() { + Object obj = store.get(Names.type); + if (obj instanceof SoftButtonType) { + return (SoftButtonType) obj; + } else if (obj instanceof String) { + SoftButtonType theCode = null; + try { + theCode = SoftButtonType.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.type, e); + } + return theCode; + } + return null; + } + public void setText(String text) { + if (text != null) { + store.put(Names.text, text); + } else { + store.remove(Names.text); + } + } + public String getText() { + return (String) store.get(Names.text); + } + public void setImage(Image image) { + if (image != null) { + store.put(Names.image, image); + } else { + store.remove(Names.image); + } + } + public Image getImage() { + Object obj = store.get(Names.image); + if (obj instanceof Image) { + return (Image) obj; + } else if (obj instanceof Hashtable) { + try { + return new Image((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.image, e); + } + } + return null; + } + public void setIsHighlighted(Boolean isHighlighted) { + if (isHighlighted != null) { + store.put(Names.isHighlighted, isHighlighted); + } else { + store.remove(Names.isHighlighted); + } + } + public Boolean getIsHighlighted() { + return (Boolean) store.get(Names.isHighlighted); + } + public void setSoftButtonID(Integer softButtonID) { + if (softButtonID != null) { + store.put(Names.softButtonID, softButtonID); + } else { + store.remove(Names.softButtonID); + } + } + public Integer getSoftButtonID() { + return (Integer) store.get(Names.softButtonID); + } + public void setSystemAction(SystemAction systemAction) { + if (systemAction != null) { + store.put(Names.systemAction, systemAction); + } else { + store.remove(Names.systemAction); + } + } + public SystemAction getSystemAction() { + Object obj = store.get(Names.systemAction); + if (obj instanceof SystemAction) { + return (SystemAction) obj; + } else if (obj instanceof String) { + SystemAction theCode = null; + try { + theCode = SystemAction.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.systemAction, e); + } + return theCode; + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SoftButtonCapabilities.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SoftButtonCapabilities.java new file mode 100644 index 000000000..7a8581e1e --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SoftButtonCapabilities.java @@ -0,0 +1,54 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; + +public class SoftButtonCapabilities extends RPCStruct { + + public SoftButtonCapabilities() { } + public SoftButtonCapabilities(Hashtable hash) { + super(hash); + } + public void setShortPressAvailable(Boolean shortPressAvailable) { + if (shortPressAvailable != null) { + store.put(Names.shortPressAvailable, shortPressAvailable); + } else { + store.remove(Names.shortPressAvailable); + } + } + public Boolean getShortPressAvailable() { + return (Boolean) store.get( Names.shortPressAvailable); + } + public void setLongPressAvailable(Boolean longPressAvailable) { + if (longPressAvailable != null) { + store.put(Names.longPressAvailable, longPressAvailable); + } else { + store.remove(Names.longPressAvailable); + } + } + public Boolean getLongPressAvailable() { + return (Boolean) store.get( Names.longPressAvailable); + } + public void setUpDownAvailable(Boolean upDownAvailable) { + if (upDownAvailable != null) { + store.put(Names.upDownAvailable, upDownAvailable); + } else { + store.remove(Names.upDownAvailable); + } + } + public Boolean getUpDownAvailable() { + return (Boolean) store.get( Names.upDownAvailable); + } + public void setImageSupported(Boolean imageSupported) { + if (imageSupported != null) { + store.put(Names.imageSupported, imageSupported); + } else { + store.remove(Names.imageSupported); + } + } + public Boolean getImageSupported() { + return (Boolean) store.get( Names.imageSupported); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Speak.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Speak.java new file mode 100644 index 000000000..84152a5f8 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Speak.java @@ -0,0 +1,40 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+import java.util.Vector;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class Speak extends RPCRequest {
+
+ public Speak() {
+ super("Speak");
+ }
+ public Speak(Hashtable hash) {
+ super(hash);
+ }
+ public Vector<TTSChunk> getTtsChunks() {
+ if (parameters.get(Names.ttsChunks) instanceof Vector<?>) {
+ Vector<?> list = (Vector<?>)parameters.get(Names.ttsChunks);
+ if (list != null && list.size() > 0) {
+ Object obj = list.get(0);
+ if (obj instanceof TTSChunk) {
+ return (Vector<TTSChunk>) list;
+ } else if (obj instanceof Hashtable) {
+ Vector<TTSChunk> newList = new Vector<TTSChunk>();
+ for (Object hashObj : list) {
+ newList.add(new TTSChunk((Hashtable)hashObj));
+ }
+ return newList;
+ }
+ }
+ }
+ return null;
+ }
+ public void setTtsChunks( Vector<TTSChunk> ttsChunks ) {
+ if (ttsChunks != null) {
+ parameters.put(Names.ttsChunks, ttsChunks );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SpeakResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SpeakResponse.java new file mode 100644 index 000000000..55ca7ccc4 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SpeakResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class SpeakResponse extends RPCResponse {
+
+ public SpeakResponse() {
+ super("Speak");
+ }
+ public SpeakResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/StartTime.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/StartTime.java new file mode 100644 index 000000000..99057645a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/StartTime.java @@ -0,0 +1,38 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCStruct;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class StartTime extends RPCStruct {
+
+ public StartTime() { }
+ public StartTime(Hashtable hash) {
+ super(hash);
+ }
+ public Integer getHours() {
+ return (Integer) store.get( Names.hours );
+ }
+ public void setHours( Integer hours ) {
+ if (hours != null) {
+ store.put(Names.hours, hours );
+ }
+ }
+ public Integer getMinutes() {
+ return (Integer) store.get( Names.minutes );
+ }
+ public void setMinutes( Integer minutes ) {
+ if (minutes != null) {
+ store.put(Names.minutes, minutes );
+ }
+ }
+ public Integer getSeconds() {
+ return (Integer) store.get( Names.seconds );
+ }
+ public void setSeconds( Integer seconds ) {
+ if (seconds != null) {
+ store.put(Names.seconds, seconds );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SubscribeButton.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SubscribeButton.java new file mode 100644 index 000000000..6fa0770ed --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SubscribeButton.java @@ -0,0 +1,38 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.ButtonName;
+import com.ford.syncV4.util.DebugTool;
+
+public class SubscribeButton extends RPCRequest {
+
+ public SubscribeButton() {
+ super("SubscribeButton");
+ }
+ public SubscribeButton(Hashtable hash) {
+ super(hash);
+ }
+ public ButtonName getButtonName() {
+ Object obj = parameters.get(Names.buttonName);
+ if (obj instanceof ButtonName) {
+ return (ButtonName) obj;
+ } else if (obj instanceof String) {
+ ButtonName theCode = null;
+ try {
+ theCode = ButtonName.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.buttonName, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setButtonName( ButtonName buttonName ) {
+ if (buttonName != null) {
+ parameters.put(Names.buttonName, buttonName );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SubscribeButtonResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SubscribeButtonResponse.java new file mode 100644 index 000000000..0164aad68 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SubscribeButtonResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class SubscribeButtonResponse extends RPCResponse {
+
+ public SubscribeButtonResponse() {
+ super("SubscribeButton");
+ }
+ public SubscribeButtonResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SubscribeVehicleData.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SubscribeVehicleData.java new file mode 100644 index 000000000..e72d2a8e5 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SubscribeVehicleData.java @@ -0,0 +1,273 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; + +import java.util.Hashtable; + +public class SubscribeVehicleData extends RPCRequest { + + public SubscribeVehicleData() { + super("SubscribeVehicleData"); + } + public SubscribeVehicleData(Hashtable hash) { + super(hash); + } + public void setGps(Boolean gps) { + if (gps != null) { + parameters.put(Names.gps, gps); + } else { + parameters.remove(Names.gps); + } + } + public Boolean getGps() { + return (Boolean) parameters.get(Names.gps); + } + public void setSpeed(Boolean speed) { + if (speed != null) { + parameters.put(Names.speed, speed); + } else { + parameters.remove(Names.speed); + } + } + public Boolean getSpeed() { + return (Boolean) parameters.get(Names.speed); + } + public void setRpm(Boolean rpm) { + if (rpm != null) { + parameters.put(Names.rpm, rpm); + } else { + parameters.remove(Names.rpm); + } + } + public Boolean getRpm() { + return (Boolean) parameters.get(Names.rpm); + } + public void setFuelLevel(Boolean fuelLevel) { + if (fuelLevel != null) { + parameters.put(Names.fuelLevel, fuelLevel); + } else { + parameters.remove(Names.fuelLevel); + } + } + public Boolean getFuelLevel() { + return (Boolean) parameters.get(Names.fuelLevel); + } + public void setFuelLevel_State(Boolean fuelLevel_State) { + if (fuelLevel_State != null) { + parameters.put(Names.fuelLevel_State, fuelLevel_State); + } else { + parameters.remove(Names.fuelLevel_State); + } + } + public Boolean getFuelLevel_State() { + return (Boolean) parameters.get(Names.fuelLevel_State); + } + public void setInstantFuelConsumption(Boolean instantFuelConsumption) { + if (instantFuelConsumption != null) { + parameters.put(Names.instantFuelConsumption, instantFuelConsumption); + } else { + parameters.remove(Names.instantFuelConsumption); + } + } + public Boolean getInstantFuelConsumption() { + return (Boolean) parameters.get(Names.instantFuelConsumption); + } + public void setExternalTemperature(Boolean externalTemperature) { + if (externalTemperature != null) { + parameters.put(Names.externalTemperature, externalTemperature); + } else { + parameters.remove(Names.externalTemperature); + } + } + public Boolean getExternalTemperature() { + return (Boolean) parameters.get(Names.externalTemperature); + } + public void setPrndl(Boolean prndl) { + if (prndl != null) { + parameters.put(Names.prndl, prndl); + } else { + parameters.remove(Names.prndl); + } + } + public Boolean getPrndl() { + return (Boolean) parameters.get(Names.prndl); + } + public void setTirePressure(Boolean tirePressure) { + if (tirePressure != null) { + parameters.put(Names.tirePressure, tirePressure); + } else { + parameters.remove(Names.tirePressure); + } + } + public Boolean getTirePressure() { + return (Boolean) parameters.get(Names.tirePressure); + } + public void setOdometer(Boolean odometer) { + if (odometer != null) { + parameters.put(Names.odometer, odometer); + } else { + parameters.remove(Names.odometer); + } + } + public Boolean getOdometer() { + return (Boolean) parameters.get(Names.odometer); + } + public void setBeltStatus(Boolean beltStatus) { + if (beltStatus != null) { + parameters.put(Names.beltStatus, beltStatus); + } else { + parameters.remove(Names.beltStatus); + } + } + public Boolean getBeltStatus() { + return (Boolean) parameters.get(Names.beltStatus); + } + public void setBodyInformation(Boolean bodyInformation) { + if (bodyInformation != null) { + parameters.put(Names.bodyInformation, bodyInformation); + } else { + parameters.remove(Names.bodyInformation); + } + } + public Boolean getBodyInformation() { + return (Boolean) parameters.get(Names.bodyInformation); + } + public void setDeviceStatus(Boolean deviceStatus) { + if (deviceStatus != null) { + parameters.put(Names.deviceStatus, deviceStatus); + } else { + parameters.remove(Names.deviceStatus); + } + } + public Boolean getDeviceStatus() { + return (Boolean) parameters.get(Names.deviceStatus); + } + public void setDriverBraking(Boolean driverBraking) { + if (driverBraking != null) { + parameters.put(Names.driverBraking, driverBraking); + } else { + parameters.remove(Names.driverBraking); + } + } + public Boolean getDriverBraking() { + return (Boolean) parameters.get(Names.driverBraking); + } + public void setWiperStatus(Boolean wiperStatus) { + if (wiperStatus != null) { + parameters.put(Names.wiperStatus, wiperStatus); + } else { + parameters.remove(Names.wiperStatus); + } + } + public Boolean getWiperStatus() { + return (Boolean) parameters.get(Names.wiperStatus); + } + public void setHeadLampStatus(Boolean headLampStatus) { + if (headLampStatus != null) { + parameters.put(Names.headLampStatus, headLampStatus); + } else { + parameters.remove(Names.headLampStatus); + } + } + public Boolean getHeadLampStatus() { + return (Boolean) parameters.get(Names.headLampStatus); + } + public void setBatteryVoltage(Boolean batteryVoltage) { + if (batteryVoltage != null) { + parameters.put(Names.batteryVoltage, batteryVoltage); + } else { + parameters.remove(Names.batteryVoltage); + } + } + public Boolean getBatteryVoltage() { + return (Boolean) parameters.get(Names.batteryVoltage); + } + public void setEngineTorque(Boolean engineTorque) { + if (engineTorque != null) { + parameters.put(Names.engineTorque, engineTorque); + } else { + parameters.remove(Names.engineTorque); + } + } + public Boolean getEngineTorque() { + return (Boolean) parameters.get(Names.engineTorque); + } + public void setAccPedalPosition(Boolean accPedalPosition) { + if (accPedalPosition != null) { + parameters.put(Names.accPedalPosition, accPedalPosition); + } else { + parameters.remove(Names.accPedalPosition); + } + } + public Boolean getAccPedalPosition() { + return (Boolean) parameters.get(Names.accPedalPosition); + } + + public void setSteeringWheelAngle(Boolean steeringWheelAngle) { + if (steeringWheelAngle != null) { + parameters.put(Names.steeringWheelAngle, steeringWheelAngle); + } else { + parameters.remove(Names.steeringWheelAngle); + } + } + + public Boolean getSteeringWheelAngle() { + final Object o = parameters.get(Names.steeringWheelAngle); + if (o instanceof Boolean) { + return (Boolean) o; + } + return null; + } + + public void setECallInfo(Boolean eCallInfo) { + if (eCallInfo != null) { + parameters.put(Names.eCallInfo, eCallInfo); + } else { + parameters.remove(Names.eCallInfo); + } + } + public Boolean getECallInfo() { + return (Boolean) parameters.get(Names.eCallInfo); + } + public void setAirbagStatus(Boolean airbagStatus) { + if (airbagStatus != null) { + parameters.put(Names.airbagStatus, airbagStatus); + } else { + parameters.remove(Names.airbagStatus); + } + } + public Boolean getAirbagStatus() { + return (Boolean) parameters.get(Names.airbagStatus); + } + public void setEmergencyEvent(Boolean emergencyEvent) { + if (emergencyEvent != null) { + parameters.put(Names.emergencyEvent, emergencyEvent); + } else { + parameters.remove(Names.emergencyEvent); + } + } + public Boolean getEmergencyEvent() { + return (Boolean) parameters.get(Names.emergencyEvent); + } + public void setClusterModeStatus(Boolean clusterModeStatus) { + if (clusterModeStatus != null) { + parameters.put(Names.clusterModeStatus, clusterModeStatus); + } else { + parameters.remove(Names.clusterModeStatus); + } + } + public Boolean getClusterModeStatus() { + return (Boolean) parameters.get(Names.clusterModeStatus); + } + public void setMyKey(Boolean myKey) { + if (myKey != null) { + parameters.put(Names.myKey, myKey); + } else { + parameters.remove(Names.myKey); + } + } + public Boolean getMyKey() { + return (Boolean) parameters.get(Names.myKey); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SubscribeVehicleDataResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SubscribeVehicleDataResponse.java new file mode 100644 index 000000000..080ffe634 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SubscribeVehicleDataResponse.java @@ -0,0 +1,525 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCResponse; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.FileType; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataType; +import com.ford.syncV4.util.DebugTool; + +public class SubscribeVehicleDataResponse extends RPCResponse { + + public SubscribeVehicleDataResponse() { + super("SubscribeVehicleData"); + } + public SubscribeVehicleDataResponse(Hashtable hash) { + super(hash); + } + public void setGps(VehicleDataResult gps) { + if (gps != null) { + parameters.put(Names.gps, gps); + } else { + parameters.remove(Names.gps); + } + } + public VehicleDataResult getGps() { + Object obj = parameters.get(Names.gps); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.gps, e); + } + } + return null; + } + public void setSpeed(VehicleDataResult speed) { + if (speed != null) { + parameters.put(Names.speed, speed); + } else { + parameters.remove(Names.speed); + } + } + public VehicleDataResult getSpeed() { + Object obj = parameters.get(Names.speed); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.speed, e); + } + } + return null; + } + public void setRpm(VehicleDataResult rpm) { + if (rpm != null) { + parameters.put(Names.rpm, rpm); + } else { + parameters.remove(Names.rpm); + } + } + public VehicleDataResult getRpm() { + Object obj = parameters.get(Names.rpm); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.rpm, e); + } + } + return null; + } + public void setFuelLevel(VehicleDataResult fuelLevel) { + if (fuelLevel != null) { + parameters.put(Names.fuelLevel, fuelLevel); + } else { + parameters.remove(Names.fuelLevel); + } + } + public VehicleDataResult getFuelLevel() { + Object obj = parameters.get(Names.fuelLevel); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.fuelLevel, e); + } + } + return null; + } + public void setFuelLevel_State(VehicleDataResult fuelLevel_State) { + if (fuelLevel_State != null) { + parameters.put(Names.fuelLevel_State, fuelLevel_State); + } else { + parameters.remove(Names.fuelLevel_State); + } + } + public VehicleDataResult getFuelLevel_State() { + Object obj = parameters.get(Names.fuelLevel_State); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.fuelLevel_State, e); + } + } + return null; + } + public void setInstantFuelConsumption(VehicleDataResult instantFuelConsumption) { + if (instantFuelConsumption != null) { + parameters.put(Names.instantFuelConsumption, instantFuelConsumption); + } else { + parameters.remove(Names.instantFuelConsumption); + } + } + public VehicleDataResult getInstantFuelConsumption() { + Object obj = parameters.get(Names.instantFuelConsumption); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.instantFuelConsumption, e); + } + } + return null; + } + public void setExternalTemperature(VehicleDataResult externalTemperature) { + if (externalTemperature != null) { + parameters.put(Names.externalTemperature, externalTemperature); + } else { + parameters.remove(Names.externalTemperature); + } + } + public VehicleDataResult getExternalTemperature() { + Object obj = parameters.get(Names.externalTemperature); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.externalTemperature, e); + } + } + return null; + } + public void setPrndl(VehicleDataResult prndl) { + if (prndl != null) { + parameters.put(Names.prndl, prndl); + } else { + parameters.remove(Names.prndl); + } + } + public VehicleDataResult getPrndl() { + Object obj = parameters.get(Names.prndl); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.prndl, e); + } + } + return null; + } + public void setTirePressure(VehicleDataResult tirePressure) { + if (tirePressure != null) { + parameters.put(Names.tirePressure, tirePressure); + } else { + parameters.remove(Names.tirePressure); + } + } + public VehicleDataResult getTirePressure() { + Object obj = parameters.get(Names.tirePressure); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.tirePressure, e); + } + } + return null; + } + public void setOdometer(VehicleDataResult odometer) { + if (odometer != null) { + parameters.put(Names.odometer, odometer); + } else { + parameters.remove(Names.odometer); + } + } + public VehicleDataResult getOdometer() { + Object obj = parameters.get(Names.odometer); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.odometer, e); + } + } + return null; + } + public void setBeltStatus(VehicleDataResult beltStatus) { + if (beltStatus != null) { + parameters.put(Names.beltStatus, beltStatus); + } else { + parameters.remove(Names.beltStatus); + } + } + public VehicleDataResult getBeltStatus() { + Object obj = parameters.get(Names.beltStatus); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.beltStatus, e); + } + } + return null; + } + public void setBodyInformation(VehicleDataResult bodyInformation) { + if (bodyInformation != null) { + parameters.put(Names.bodyInformation, bodyInformation); + } else { + parameters.remove(Names.bodyInformation); + } + } + public VehicleDataResult getBodyInformation() { + Object obj = parameters.get(Names.bodyInformation); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.bodyInformation, e); + } + } + return null; + } + public void setDeviceStatus(VehicleDataResult deviceStatus) { + if (deviceStatus != null) { + parameters.put(Names.deviceStatus, deviceStatus); + } else { + parameters.remove(Names.deviceStatus); + } + } + public VehicleDataResult getDeviceStatus() { + Object obj = parameters.get(Names.deviceStatus); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.deviceStatus, e); + } + } + return null; + } + public void setDriverBraking(VehicleDataResult driverBraking) { + if (driverBraking != null) { + parameters.put(Names.driverBraking, driverBraking); + } else { + parameters.remove(Names.driverBraking); + } + } + public VehicleDataResult getDriverBraking() { + Object obj = parameters.get(Names.driverBraking); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.driverBraking, e); + } + } + return null; + } + public void setWiperStatus(VehicleDataResult wiperStatus) { + if (wiperStatus != null) { + parameters.put(Names.wiperStatus, wiperStatus); + } else { + parameters.remove(Names.wiperStatus); + } + } + public VehicleDataResult getWiperStatus() { + Object obj = parameters.get(Names.wiperStatus); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.wiperStatus, e); + } + } + return null; + } + public void setHeadLampStatus(VehicleDataResult headLampStatus) { + if (headLampStatus != null) { + parameters.put(Names.headLampStatus, headLampStatus); + } else { + parameters.remove(Names.headLampStatus); + } + } + public VehicleDataResult getHeadLampStatus() { + Object obj = parameters.get(Names.headLampStatus); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.headLampStatus, e); + } + } + return null; + } + public void setBatteryVoltage(VehicleDataResult batteryVoltage) { + if (batteryVoltage != null) { + parameters.put(Names.batteryVoltage, batteryVoltage); + } else { + parameters.remove(Names.batteryVoltage); + } + } + public VehicleDataResult getBatteryVoltage() { + Object obj = parameters.get(Names.batteryVoltage); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.batteryVoltage, e); + } + } + return null; + } + public void setEngineTorque(VehicleDataResult engineTorque) { + if (engineTorque != null) { + parameters.put(Names.engineTorque, engineTorque); + } else { + parameters.remove(Names.engineTorque); + } + } + public VehicleDataResult getEngineTorque() { + Object obj = parameters.get(Names.engineTorque); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.engineTorque, e); + } + } + return null; + } + public void setAccPedalPosition(VehicleDataResult accPedalPosition) { + if (accPedalPosition != null) { + parameters.put(Names.accPedalPosition, accPedalPosition); + } else { + parameters.remove(Names.accPedalPosition); + } + } + public VehicleDataResult getAccPedalPosition() { + Object obj = parameters.get(Names.accPedalPosition); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.accPedalPosition, e); + } + } + return null; + } + + public void setSteeringWheelAngle(VehicleDataResult steeringWheelAngle) { + if (steeringWheelAngle != null) { + parameters.put(Names.steeringWheelAngle, steeringWheelAngle); + } else { + parameters.remove(Names.steeringWheelAngle); + } + } + + public VehicleDataResult getSteeringWheelAngle() { + Object obj = parameters.get(Names.steeringWheelAngle); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.steeringWheelAngle, e); + } + } + return null; + } + + public void setECallInfo(VehicleDataResult eCallInfo) { + if (eCallInfo != null) { + parameters.put(Names.eCallInfo, eCallInfo); + } else { + parameters.remove(Names.eCallInfo); + } + } + public VehicleDataResult getECallInfo() { + Object obj = parameters.get(Names.eCallInfo); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.eCallInfo, e); + } + } + return null; + } + public void setAirbagStatus(VehicleDataResult airbagStatus) { + if (airbagStatus != null) { + parameters.put(Names.airbagStatus, airbagStatus); + } else { + parameters.remove(Names.airbagStatus); + } + } + public VehicleDataResult getAirbagStatus() { + Object obj = parameters.get(Names.airbagStatus); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.airbagStatus, e); + } + } + return null; + } + public void setEmergencyEvent(VehicleDataResult emergencyEvent) { + if (emergencyEvent != null) { + parameters.put(Names.emergencyEvent, emergencyEvent); + } else { + parameters.remove(Names.emergencyEvent); + } + } + public VehicleDataResult getEmergencyEvent() { + Object obj = parameters.get(Names.emergencyEvent); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.emergencyEvent, e); + } + } + return null; + } + public void setClusterModeStatus(VehicleDataResult clusterModeStatus) { + if (clusterModeStatus != null) { + parameters.put(Names.clusterModeStatus, clusterModeStatus); + } else { + parameters.remove(Names.clusterModeStatus); + } + } + public VehicleDataResult getClusterModeStatus() { + Object obj = parameters.get(Names.clusterModeStatus); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.clusterModeStatus, e); + } + } + return null; + } + public void setMyKey(VehicleDataResult myKey) { + if (myKey != null) { + parameters.put(Names.myKey, myKey); + } else { + parameters.remove(Names.myKey); + } + } + public VehicleDataResult getMyKey() { + Object obj = parameters.get(Names.myKey); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.myKey, e); + } + } + return null; + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SyncMsgVersion.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SyncMsgVersion.java new file mode 100644 index 000000000..6dffe1062 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SyncMsgVersion.java @@ -0,0 +1,30 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCStruct;
+import com.ford.syncV4.proxy.constants.Names;
+
+public class SyncMsgVersion extends RPCStruct {
+
+ public SyncMsgVersion() { }
+ public SyncMsgVersion(Hashtable hash) {
+ super(hash);
+ }
+ public Integer getMajorVersion() {
+ return (Integer) store.get( Names.majorVersion );
+ }
+ public void setMajorVersion( Integer majorVersion ) {
+ if (majorVersion != null) {
+ store.put(Names.majorVersion, majorVersion );
+ }
+ }
+ public Integer getMinorVersion() {
+ return (Integer) store.get( Names.minorVersion );
+ }
+ public void setMinorVersion( Integer minorVersion ) {
+ if (minorVersion != null) {
+ store.put(Names.minorVersion, minorVersion );
+ }
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SyncPData.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SyncPData.java new file mode 100644 index 000000000..dc9db27a4 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SyncPData.java @@ -0,0 +1,25 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; + +public class SyncPData extends RPCRequest { + public SyncPData() { + super("SyncPData"); + } + public SyncPData(Hashtable hash) { + super(hash); + } + public void setSyncPData(byte[] syncPData) { + if (syncPData != null) { + parameters.put(Names.bulkData, syncPData); + } else { + parameters.remove(Names.bulkData); + } + } + public byte[] getSyncPData() { + return (byte[]) parameters.get(Names.bulkData); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SyncPDataResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SyncPDataResponse.java new file mode 100644 index 000000000..b2e22f209 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SyncPDataResponse.java @@ -0,0 +1,14 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCResponse; + +public class SyncPDataResponse extends RPCResponse { + public SyncPDataResponse() { + super("SyncPDataResponse"); + } + public SyncPDataResponse(Hashtable hash) { + super(hash); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SystemRequest.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SystemRequest.java new file mode 100644 index 000000000..e250de785 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SystemRequest.java @@ -0,0 +1,48 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.RequestType; +import com.ford.syncV4.util.DebugTool; + +import java.util.Hashtable; + +public class SystemRequest extends RPCRequest { + public SystemRequest() { + super("SystemRequest"); + } + + public SystemRequest(Hashtable hash) { + super(hash); + } + + public SystemRequest(SystemRequest that) { + super(that); + } + + public RequestType getRequestType() { + Object obj = parameters.get(Names.requestType); + if (obj instanceof RequestType) { + return (RequestType) obj; + } else if (obj instanceof String) { + RequestType theCode = null; + try { + theCode = RequestType.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.requestType, e); + } + return theCode; + } + return null; + } + + public void setRequestType(RequestType requestType) { + if (requestType != null) { + parameters.put(Names.requestType, requestType); + } else { + parameters.remove(Names.requestType); + } + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SystemRequestResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SystemRequestResponse.java new file mode 100644 index 000000000..b5c171ddf --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/SystemRequestResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCResponse; + +import java.util.Hashtable; + +public class SystemRequestResponse extends RPCResponse { + public SystemRequestResponse() { + super("SystemRequest"); + } + + public SystemRequestResponse(Hashtable hash) { + super(hash); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TTSChunk.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TTSChunk.java new file mode 100644 index 000000000..a23678863 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TTSChunk.java @@ -0,0 +1,44 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCStruct;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.SpeechCapabilities;
+import com.ford.syncV4.util.DebugTool;
+
+public class TTSChunk extends RPCStruct {
+
+ public TTSChunk() { }
+ public TTSChunk(Hashtable hash) {
+ super(hash);
+ }
+ public String getText() {
+ return (String) store.get( Names.text );
+ }
+ public void setText( String text ) {
+ if (text != null) {
+ store.put(Names.text, text );
+ }
+ }
+ public SpeechCapabilities getType() {
+ Object obj = store.get(Names.type);
+ if (obj instanceof SpeechCapabilities) {
+ return (SpeechCapabilities) obj;
+ } else if (obj instanceof String) {
+ SpeechCapabilities theCode = null;
+ try {
+ theCode = SpeechCapabilities.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.type, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setType( SpeechCapabilities type ) {
+ if (type != null) {
+ store.put(Names.type, type );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TextField.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TextField.java new file mode 100644 index 000000000..16a729944 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TextField.java @@ -0,0 +1,73 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCStruct;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.CharacterSet;
+import com.ford.syncV4.proxy.rpc.enums.TextFieldName;
+import com.ford.syncV4.util.DebugTool;
+
+public class TextField extends RPCStruct {
+
+ public TextField() { }
+ public TextField(Hashtable hash) {
+ super(hash);
+ }
+ public TextFieldName getName() {
+ Object obj = store.get(Names.name);
+ if (obj instanceof TextFieldName) {
+ return (TextFieldName) obj;
+ } else if (obj instanceof String) {
+ TextFieldName theCode = null;
+ try {
+ theCode = TextFieldName.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.name, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setName( TextFieldName name ) {
+ if (name != null) {
+ store.put(Names.name, name );
+ }
+ }
+ public CharacterSet getCharacterSet() {
+ Object obj = store.get(Names.characterSet);
+ if (obj instanceof CharacterSet) {
+ return (CharacterSet) obj;
+ } else if (obj instanceof String) {
+ CharacterSet theCode = null;
+ try {
+ theCode = CharacterSet.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.characterSet, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setCharacterSet( CharacterSet characterSet ) {
+ if (characterSet != null) {
+ store.put(Names.characterSet, characterSet );
+ }
+ }
+ public Integer getWidth() {
+ return (Integer) store.get( Names.width );
+ }
+ public void setWidth( Integer width ) {
+ if (width != null) {
+ store.put(Names.width, width );
+ }
+ }
+ public Integer getRows() {
+ return (Integer) store.get( Names.rows );
+ }
+ public void setRows( Integer rows ) {
+ if (rows != null) {
+ store.put(Names.rows, rows );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TireStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TireStatus.java new file mode 100644 index 000000000..adbb680c2 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TireStatus.java @@ -0,0 +1,163 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.WarningLightStatus; +import com.ford.syncV4.util.DebugTool; + +public class TireStatus extends RPCStruct { + + public TireStatus() { } + public TireStatus(Hashtable hash) { + super(hash); + } + + public void setPressureTelltale(WarningLightStatus pressureTellTale) { + if (pressureTellTale != null) { + store.put(Names.pressureTelltale, pressureTellTale); + } else { + store.remove(Names.pressureTelltale); + } + } + + public WarningLightStatus getPressureTelltale() { + Object obj = store.get(Names.pressureTelltale); + if (obj instanceof WarningLightStatus) { + return (WarningLightStatus) obj; + } else if (obj instanceof String) { + WarningLightStatus theCode = null; + try { + theCode = WarningLightStatus.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.pressureTelltale, e); + } + return theCode; + } + return null; + } + + public void setLeftFront(SingleTireStatus leftFront) { + if (leftFront != null) { + store.put(Names.leftFront, leftFront); + } else { + store.remove(Names.leftFront); + } + } + public SingleTireStatus getLeftFront() { + Object obj = store.get(Names.leftFront); + if (obj instanceof SingleTireStatus) { + return (SingleTireStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new SingleTireStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.leftFront, e); + } + } + return null; + } + public void setRightFront(SingleTireStatus rightFront) { + if (rightFront != null) { + store.put(Names.rightFront, rightFront); + } else { + store.remove(Names.rightFront); + } + } + public SingleTireStatus getRightFront() { + Object obj = store.get(Names.rightFront); + if (obj instanceof SingleTireStatus) { + return (SingleTireStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new SingleTireStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.rightFront, e); + } + } + return null; + } + public void setLeftRear(SingleTireStatus leftRear) { + if (leftRear != null) { + store.put(Names.leftRear, leftRear); + } else { + store.remove(Names.leftRear); + } + } + public SingleTireStatus getLeftRear() { + Object obj = store.get(Names.leftRear); + if (obj instanceof SingleTireStatus) { + return (SingleTireStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new SingleTireStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.leftRear, e); + } + } + return null; + } + public void setRightRear(SingleTireStatus rightRear) { + if (rightRear != null) { + store.put(Names.rightRear, rightRear); + } else { + store.remove(Names.rightRear); + } + } + public SingleTireStatus getRightRear() { + Object obj = store.get(Names.rightRear); + if (obj instanceof SingleTireStatus) { + return (SingleTireStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new SingleTireStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.rightRear, e); + } + } + return null; + } + public void setInnerLeftRear(SingleTireStatus innerLeftRear) { + if (innerLeftRear != null) { + store.put(Names.innerLeftRear, innerLeftRear); + } else { + store.remove(Names.innerLeftRear); + } + } + public SingleTireStatus getInnerLeftRear() { + Object obj = store.get(Names.innerLeftRear); + if (obj instanceof SingleTireStatus) { + return (SingleTireStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new SingleTireStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.innerLeftRear, e); + } + } + return null; + } + public void setInnerRightRear(SingleTireStatus innerRightRear) { + if (innerRightRear != null) { + store.put(Names.innerRightRear, innerRightRear); + } else { + store.remove(Names.innerRightRear); + } + } + public SingleTireStatus getInnerRightRear() { + Object obj = store.get(Names.innerRightRear); + if (obj instanceof SingleTireStatus) { + return (SingleTireStatus) obj; + } else if (obj instanceof Hashtable) { + try { + return new SingleTireStatus((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.innerRightRear, e); + } + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TouchCoord.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TouchCoord.java new file mode 100755 index 000000000..fabeb6e28 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TouchCoord.java @@ -0,0 +1,39 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; + +import java.util.Hashtable; + +public class TouchCoord extends RPCStruct { + public TouchCoord() {} + + public TouchCoord(Hashtable hash) { + super(hash); + } + + public void setX(Integer x) { + if (x != null) { + store.put(Names.x, x); + } else { + store.remove(Names.x); + } + } + + public Integer getX() { + return (Integer) store.get(Names.x); + } + + public void setY(Integer y) { + if (y != null) { + store.put(Names.y, y); + } else { + store.remove(Names.y); + } + } + + public Integer getY() { + return (Integer) store.get(Names.y); + } + +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TouchEventCapabilities.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TouchEventCapabilities.java new file mode 100755 index 000000000..bbb849f09 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/TouchEventCapabilities.java @@ -0,0 +1,50 @@ +package com.ford.syncV4.proxy.rpc; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; + +import java.util.Hashtable; + +public class TouchEventCapabilities extends RPCStruct { + public TouchEventCapabilities() {} + + public TouchEventCapabilities(Hashtable hash) { + super(hash); + } + + public void setPressAvailable(Boolean pressAvailable) { + if (pressAvailable != null) { + store.put(Names.pressAvailable, pressAvailable); + } else { + store.remove(Names.pressAvailable); + } + } + + public Boolean getPressAvailable() { + return (Boolean) store.get(Names.pressAvailable); + } + + public void setMultiTouchAvailable(Boolean multiTouchAvailable) { + if (multiTouchAvailable != null) { + store.put(Names.multiTouchAvailable, multiTouchAvailable); + } else { + store.remove(Names.multiTouchAvailable); + } + } + + public Boolean getMultiTouchAvailable() { + return (Boolean) store.get(Names.multiTouchAvailable); + } + + public void setDoublePressAvailable(Boolean doublePressAvailable) { + if (doublePressAvailable != null) { + store.put(Names.doublePressAvailable, doublePressAvailable); + } else { + store.remove(Names.doublePressAvailable); + } + } + + public Boolean getDoublePressAvailable() { + return (Boolean) store.get(Names.doublePressAvailable); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Turn.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Turn.java new file mode 100644 index 000000000..9be9de2dc --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/Turn.java @@ -0,0 +1,39 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; + +public class Turn extends RPCStruct { + + public Turn() { } + public Turn(Hashtable hash) { + super(hash); + } + public void setNavigationText(String navigationText) { + if (navigationText != null) { + store.put(Names.navigationText, navigationText); + } else { + store.remove(Names.navigationText); + } + } + public String getNavigationText() { + return (String) store.get(Names.navigationText); + } + public void setTurnIcon(Image turnIcon) { + if (turnIcon != null) { + store.put(Names.turnIcon, turnIcon); + } else { + store.remove(Names.turnIcon); + } + } + public Image getTurnIcon() { + Object obj = store.get(Names.turnIcon); + if (obj instanceof Image) { + return (Image) obj; + } else { + return new Image((Hashtable) obj); + } + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnregisterAppInterface.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnregisterAppInterface.java new file mode 100644 index 000000000..6a18ed23a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnregisterAppInterface.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCRequest;
+
+public class UnregisterAppInterface extends RPCRequest {
+
+ public UnregisterAppInterface() {
+ super("UnregisterAppInterface");
+ }
+ public UnregisterAppInterface(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnregisterAppInterfaceResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnregisterAppInterfaceResponse.java new file mode 100644 index 000000000..7449b21ca --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnregisterAppInterfaceResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class UnregisterAppInterfaceResponse extends RPCResponse {
+
+ public UnregisterAppInterfaceResponse() {
+ super("UnregisterAppInterface");
+ }
+ public UnregisterAppInterfaceResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnsubscribeButton.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnsubscribeButton.java new file mode 100644 index 000000000..5dd704144 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnsubscribeButton.java @@ -0,0 +1,38 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCRequest;
+import com.ford.syncV4.proxy.constants.Names;
+import com.ford.syncV4.proxy.rpc.enums.ButtonName;
+import com.ford.syncV4.util.DebugTool;
+
+public class UnsubscribeButton extends RPCRequest {
+
+ public UnsubscribeButton() {
+ super("UnsubscribeButton");
+ }
+ public UnsubscribeButton(Hashtable hash) {
+ super(hash);
+ }
+ public ButtonName getButtonName() {
+ Object obj = parameters.get(Names.buttonName);
+ if (obj instanceof ButtonName) {
+ return (ButtonName) obj;
+ } else if (obj instanceof String) {
+ ButtonName theCode = null;
+ try {
+ theCode = ButtonName.valueForString((String) obj);
+ } catch (Exception e) {
+ DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.buttonName, e);
+ }
+ return theCode;
+ }
+ return null;
+ }
+ public void setButtonName( ButtonName buttonName ) {
+ if (buttonName != null) {
+ parameters.put(Names.buttonName, buttonName );
+ }
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnsubscribeButtonResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnsubscribeButtonResponse.java new file mode 100644 index 000000000..2ec11e4cb --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnsubscribeButtonResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc;
+
+import java.util.Hashtable;
+
+import com.ford.syncV4.proxy.RPCResponse;
+
+public class UnsubscribeButtonResponse extends RPCResponse {
+
+ public UnsubscribeButtonResponse() {
+ super("UnsubscribeButton");
+ }
+ public UnsubscribeButtonResponse(Hashtable hash) {
+ super(hash);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnsubscribeVehicleData.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnsubscribeVehicleData.java new file mode 100644 index 000000000..e86d67853 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnsubscribeVehicleData.java @@ -0,0 +1,276 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataType; +import com.ford.syncV4.util.DebugTool; + +public class UnsubscribeVehicleData extends RPCRequest { + + public UnsubscribeVehicleData() { + super("UnsubscribeVehicleData"); + } + public UnsubscribeVehicleData(Hashtable hash) { + super(hash); + } + public void setGps(Boolean gps) { + if (gps != null) { + parameters.put(Names.gps, gps); + } else { + parameters.remove(Names.gps); + } + } + public Boolean getGps() { + return (Boolean) parameters.get(Names.gps); + } + public void setSpeed(Boolean speed) { + if (speed != null) { + parameters.put(Names.speed, speed); + } else { + parameters.remove(Names.speed); + } + } + public Boolean getSpeed() { + return (Boolean) parameters.get(Names.speed); + } + public void setRpm(Boolean rpm) { + if (rpm != null) { + parameters.put(Names.rpm, rpm); + } else { + parameters.remove(Names.rpm); + } + } + public Boolean getRpm() { + return (Boolean) parameters.get(Names.rpm); + } + public void setFuelLevel(Boolean fuelLevel) { + if (fuelLevel != null) { + parameters.put(Names.fuelLevel, fuelLevel); + } else { + parameters.remove(Names.fuelLevel); + } + } + public Boolean getFuelLevel() { + return (Boolean) parameters.get(Names.fuelLevel); + } + public void setFuelLevel_State(Boolean fuelLevel_State) { + if (fuelLevel_State != null) { + parameters.put(Names.fuelLevel_State, fuelLevel_State); + } else { + parameters.remove(Names.fuelLevel_State); + } + } + public Boolean getFuelLevel_State() { + return (Boolean) parameters.get(Names.fuelLevel_State); + } + public void setInstantFuelConsumption(Boolean instantFuelConsumption) { + if (instantFuelConsumption != null) { + parameters.put(Names.instantFuelConsumption, instantFuelConsumption); + } else { + parameters.remove(Names.instantFuelConsumption); + } + } + public Boolean getInstantFuelConsumption() { + return (Boolean) parameters.get(Names.instantFuelConsumption); + } + public void setExternalTemperature(Boolean externalTemperature) { + if (externalTemperature != null) { + parameters.put(Names.externalTemperature, externalTemperature); + } else { + parameters.remove(Names.externalTemperature); + } + } + public Boolean getExternalTemperature() { + return (Boolean) parameters.get(Names.externalTemperature); + } + public void setPrndl(Boolean prndl) { + if (prndl != null) { + parameters.put(Names.prndl, prndl); + } else { + parameters.remove(Names.prndl); + } + } + public Boolean getPrndl() { + return (Boolean) parameters.get(Names.prndl); + } + public void setTirePressure(Boolean tirePressure) { + if (tirePressure != null) { + parameters.put(Names.tirePressure, tirePressure); + } else { + parameters.remove(Names.tirePressure); + } + } + public Boolean getTirePressure() { + return (Boolean) parameters.get(Names.tirePressure); + } + public void setOdometer(Boolean odometer) { + if (odometer != null) { + parameters.put(Names.odometer, odometer); + } else { + parameters.remove(Names.odometer); + } + } + public Boolean getOdometer() { + return (Boolean) parameters.get(Names.odometer); + } + public void setBeltStatus(Boolean beltStatus) { + if (beltStatus != null) { + parameters.put(Names.beltStatus, beltStatus); + } else { + parameters.remove(Names.beltStatus); + } + } + public Boolean getBeltStatus() { + return (Boolean) parameters.get(Names.beltStatus); + } + public void setBodyInformation(Boolean bodyInformation) { + if (bodyInformation != null) { + parameters.put(Names.bodyInformation, bodyInformation); + } else { + parameters.remove(Names.bodyInformation); + } + } + public Boolean getBodyInformation() { + return (Boolean) parameters.get(Names.bodyInformation); + } + public void setDeviceStatus(Boolean deviceStatus) { + if (deviceStatus != null) { + parameters.put(Names.deviceStatus, deviceStatus); + } else { + parameters.remove(Names.deviceStatus); + } + } + public Boolean getDeviceStatus() { + return (Boolean) parameters.get(Names.deviceStatus); + } + public void setDriverBraking(Boolean driverBraking) { + if (driverBraking != null) { + parameters.put(Names.driverBraking, driverBraking); + } else { + parameters.remove(Names.driverBraking); + } + } + public Boolean getDriverBraking() { + return (Boolean) parameters.get(Names.driverBraking); + } + public void setWiperStatus(Boolean wiperStatus) { + if (wiperStatus != null) { + parameters.put(Names.wiperStatus, wiperStatus); + } else { + parameters.remove(Names.wiperStatus); + } + } + public Boolean getWiperStatus() { + return (Boolean) parameters.get(Names.wiperStatus); + } + public void setHeadLampStatus(Boolean headLampStatus) { + if (headLampStatus != null) { + parameters.put(Names.headLampStatus, headLampStatus); + } else { + parameters.remove(Names.headLampStatus); + } + } + public Boolean getHeadLampStatus() { + return (Boolean) parameters.get(Names.headLampStatus); + } + public void setBatteryVoltage(Boolean batteryVoltage) { + if (batteryVoltage != null) { + parameters.put(Names.batteryVoltage, batteryVoltage); + } else { + parameters.remove(Names.batteryVoltage); + } + } + public Boolean getBatteryVoltage() { + return (Boolean) parameters.get(Names.batteryVoltage); + } + public void setEngineTorque(Boolean engineTorque) { + if (engineTorque != null) { + parameters.put(Names.engineTorque, engineTorque); + } else { + parameters.remove(Names.engineTorque); + } + } + public Boolean getEngineTorque() { + return (Boolean) parameters.get(Names.engineTorque); + } + public void setAccPedalPosition(Boolean accPedalPosition) { + if (accPedalPosition != null) { + parameters.put(Names.accPedalPosition, accPedalPosition); + } else { + parameters.remove(Names.accPedalPosition); + } + } + public Boolean getAccPedalPosition() { + return (Boolean) parameters.get(Names.accPedalPosition); + } + + public void setSteeringWheelAngle(Boolean steeringWheelAngle) { + if (steeringWheelAngle != null) { + parameters.put(Names.steeringWheelAngle, steeringWheelAngle); + } else { + parameters.remove(Names.steeringWheelAngle); + } + } + + public Boolean getSteeringWheelAngle() { + final Object o = parameters.get(Names.steeringWheelAngle); + if (o instanceof Boolean) { + return (Boolean) o; + } + return null; + } + + public void setECallInfo(Boolean eCallInfo) { + if (eCallInfo != null) { + parameters.put(Names.eCallInfo, eCallInfo); + } else { + parameters.remove(Names.eCallInfo); + } + } + public Boolean getECallInfo() { + return (Boolean) parameters.get(Names.eCallInfo); + } + public void setAirbagStatus(Boolean airbagStatus) { + if (airbagStatus != null) { + parameters.put(Names.airbagStatus, airbagStatus); + } else { + parameters.remove(Names.airbagStatus); + } + } + public Boolean getAirbagStatus() { + return (Boolean) parameters.get(Names.airbagStatus); + } + public void setEmergencyEvent(Boolean emergencyEvent) { + if (emergencyEvent != null) { + parameters.put(Names.emergencyEvent, emergencyEvent); + } else { + parameters.remove(Names.emergencyEvent); + } + } + public Boolean getEmergencyEvent() { + return (Boolean) parameters.get(Names.emergencyEvent); + } + public void setClusterModeStatus(Boolean clusterModeStatus) { + if (clusterModeStatus != null) { + parameters.put(Names.clusterModeStatus, clusterModeStatus); + } else { + parameters.remove(Names.clusterModeStatus); + } + } + public Boolean getClusterModeStatus() { + return (Boolean) parameters.get(Names.clusterModeStatus); + } + public void setMyKey(Boolean myKey) { + if (myKey != null) { + parameters.put(Names.myKey, myKey); + } else { + parameters.remove(Names.myKey); + } + } + public Boolean getMyKey() { + return (Boolean) parameters.get(Names.myKey); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnsubscribeVehicleDataResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnsubscribeVehicleDataResponse.java new file mode 100644 index 000000000..a0cb7ebba --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UnsubscribeVehicleDataResponse.java @@ -0,0 +1,524 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCResponse; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataType; +import com.ford.syncV4.util.DebugTool; + +public class UnsubscribeVehicleDataResponse extends RPCResponse { + + public UnsubscribeVehicleDataResponse() { + super("UnsubscribeVehicleData"); + } + public UnsubscribeVehicleDataResponse(Hashtable hash) { + super(hash); + } + public void setGps(VehicleDataResult gps) { + if (gps != null) { + parameters.put(Names.gps, gps); + } else { + parameters.remove(Names.gps); + } + } + public VehicleDataResult getGps() { + Object obj = parameters.get(Names.gps); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.gps, e); + } + } + return null; + } + public void setSpeed(VehicleDataResult speed) { + if (speed != null) { + parameters.put(Names.speed, speed); + } else { + parameters.remove(Names.speed); + } + } + public VehicleDataResult getSpeed() { + Object obj = parameters.get(Names.speed); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.speed, e); + } + } + return null; + } + public void setRpm(VehicleDataResult rpm) { + if (rpm != null) { + parameters.put(Names.rpm, rpm); + } else { + parameters.remove(Names.rpm); + } + } + public VehicleDataResult getRpm() { + Object obj = parameters.get(Names.rpm); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.rpm, e); + } + } + return null; + } + public void setFuelLevel(VehicleDataResult fuelLevel) { + if (fuelLevel != null) { + parameters.put(Names.fuelLevel, fuelLevel); + } else { + parameters.remove(Names.fuelLevel); + } + } + public VehicleDataResult getFuelLevel() { + Object obj = parameters.get(Names.fuelLevel); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.fuelLevel, e); + } + } + return null; + } + public void setFuelLevel_State(VehicleDataResult fuelLevel_State) { + if (fuelLevel_State != null) { + parameters.put(Names.fuelLevel_State, fuelLevel_State); + } else { + parameters.remove(Names.fuelLevel_State); + } + } + public VehicleDataResult getFuelLevel_State() { + Object obj = parameters.get(Names.fuelLevel_State); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.fuelLevel_State, e); + } + } + return null; + } + public void setInstantFuelConsumption(VehicleDataResult instantFuelConsumption) { + if (instantFuelConsumption != null) { + parameters.put(Names.instantFuelConsumption, instantFuelConsumption); + } else { + parameters.remove(Names.instantFuelConsumption); + } + } + public VehicleDataResult getInstantFuelConsumption() { + Object obj = parameters.get(Names.instantFuelConsumption); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.instantFuelConsumption, e); + } + } + return null; + } + public void setExternalTemperature(VehicleDataResult externalTemperature) { + if (externalTemperature != null) { + parameters.put(Names.externalTemperature, externalTemperature); + } else { + parameters.remove(Names.externalTemperature); + } + } + public VehicleDataResult getExternalTemperature() { + Object obj = parameters.get(Names.externalTemperature); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.externalTemperature, e); + } + } + return null; + } + public void setPrndl(VehicleDataResult prndl) { + if (prndl != null) { + parameters.put(Names.prndl, prndl); + } else { + parameters.remove(Names.prndl); + } + } + public VehicleDataResult getPrndl() { + Object obj = parameters.get(Names.prndl); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.prndl, e); + } + } + return null; + } + public void setTirePressure(VehicleDataResult tirePressure) { + if (tirePressure != null) { + parameters.put(Names.tirePressure, tirePressure); + } else { + parameters.remove(Names.tirePressure); + } + } + public VehicleDataResult getTirePressure() { + Object obj = parameters.get(Names.tirePressure); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.tirePressure, e); + } + } + return null; + } + public void setOdometer(VehicleDataResult odometer) { + if (odometer != null) { + parameters.put(Names.odometer, odometer); + } else { + parameters.remove(Names.odometer); + } + } + public VehicleDataResult getOdometer() { + Object obj = parameters.get(Names.odometer); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.odometer, e); + } + } + return null; + } + public void setBeltStatus(VehicleDataResult beltStatus) { + if (beltStatus != null) { + parameters.put(Names.beltStatus, beltStatus); + } else { + parameters.remove(Names.beltStatus); + } + } + public VehicleDataResult getBeltStatus() { + Object obj = parameters.get(Names.beltStatus); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.beltStatus, e); + } + } + return null; + } + public void setBodyInformation(VehicleDataResult bodyInformation) { + if (bodyInformation != null) { + parameters.put(Names.bodyInformation, bodyInformation); + } else { + parameters.remove(Names.bodyInformation); + } + } + public VehicleDataResult getBodyInformation() { + Object obj = parameters.get(Names.bodyInformation); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.bodyInformation, e); + } + } + return null; + } + public void setDeviceStatus(VehicleDataResult deviceStatus) { + if (deviceStatus != null) { + parameters.put(Names.deviceStatus, deviceStatus); + } else { + parameters.remove(Names.deviceStatus); + } + } + public VehicleDataResult getDeviceStatus() { + Object obj = parameters.get(Names.deviceStatus); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.deviceStatus, e); + } + } + return null; + } + public void setDriverBraking(VehicleDataResult driverBraking) { + if (driverBraking != null) { + parameters.put(Names.driverBraking, driverBraking); + } else { + parameters.remove(Names.driverBraking); + } + } + public VehicleDataResult getDriverBraking() { + Object obj = parameters.get(Names.driverBraking); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.driverBraking, e); + } + } + return null; + } + public void setWiperStatus(VehicleDataResult wiperStatus) { + if (wiperStatus != null) { + parameters.put(Names.wiperStatus, wiperStatus); + } else { + parameters.remove(Names.wiperStatus); + } + } + public VehicleDataResult getWiperStatus() { + Object obj = parameters.get(Names.wiperStatus); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.wiperStatus, e); + } + } + return null; + } + public void setHeadLampStatus(VehicleDataResult headLampStatus) { + if (headLampStatus != null) { + parameters.put(Names.headLampStatus, headLampStatus); + } else { + parameters.remove(Names.headLampStatus); + } + } + public VehicleDataResult getHeadLampStatus() { + Object obj = parameters.get(Names.headLampStatus); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.headLampStatus, e); + } + } + return null; + } + public void setBatteryVoltage(VehicleDataResult batteryVoltage) { + if (batteryVoltage != null) { + parameters.put(Names.batteryVoltage, batteryVoltage); + } else { + parameters.remove(Names.batteryVoltage); + } + } + public VehicleDataResult getBatteryVoltage() { + Object obj = parameters.get(Names.batteryVoltage); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.batteryVoltage, e); + } + } + return null; + } + public void setEngineTorque(VehicleDataResult engineTorque) { + if (engineTorque != null) { + parameters.put(Names.engineTorque, engineTorque); + } else { + parameters.remove(Names.engineTorque); + } + } + public VehicleDataResult getEngineTorque() { + Object obj = parameters.get(Names.engineTorque); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.engineTorque, e); + } + } + return null; + } + public void setAccPedalPosition(VehicleDataResult accPedalPosition) { + if (accPedalPosition != null) { + parameters.put(Names.accPedalPosition, accPedalPosition); + } else { + parameters.remove(Names.accPedalPosition); + } + } + public VehicleDataResult getAccPedalPosition() { + Object obj = parameters.get(Names.accPedalPosition); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.accPedalPosition, e); + } + } + return null; + } + + public void setSteeringWheelAngle(VehicleDataResult steeringWheelAngle) { + if (steeringWheelAngle != null) { + parameters.put(Names.steeringWheelAngle, steeringWheelAngle); + } else { + parameters.remove(Names.steeringWheelAngle); + } + } + + public VehicleDataResult getSteeringWheelAngle() { + Object obj = parameters.get(Names.steeringWheelAngle); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError( + "Failed to parse " + getClass().getSimpleName() + "." + + Names.steeringWheelAngle, e); + } + } + return null; + } + + public void setECallInfo(VehicleDataResult eCallInfo) { + if (eCallInfo != null) { + parameters.put(Names.eCallInfo, eCallInfo); + } else { + parameters.remove(Names.eCallInfo); + } + } + public VehicleDataResult getECallInfo() { + Object obj = parameters.get(Names.eCallInfo); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.eCallInfo, e); + } + } + return null; + } + public void setAirbagStatus(VehicleDataResult airbagStatus) { + if (airbagStatus != null) { + parameters.put(Names.airbagStatus, airbagStatus); + } else { + parameters.remove(Names.airbagStatus); + } + } + public VehicleDataResult getAirbagStatus() { + Object obj = parameters.get(Names.airbagStatus); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.airbagStatus, e); + } + } + return null; + } + public void setEmergencyEvent(VehicleDataResult emergencyEvent) { + if (emergencyEvent != null) { + parameters.put(Names.emergencyEvent, emergencyEvent); + } else { + parameters.remove(Names.emergencyEvent); + } + } + public VehicleDataResult getEmergencyEvent() { + Object obj = parameters.get(Names.emergencyEvent); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.emergencyEvent, e); + } + } + return null; + } + public void setClusterModeStatus(VehicleDataResult clusterModeStatus) { + if (clusterModeStatus != null) { + parameters.put(Names.clusterModeStatus, clusterModeStatus); + } else { + parameters.remove(Names.clusterModeStatus); + } + } + public VehicleDataResult getClusterModeStatus() { + Object obj = parameters.get(Names.clusterModeStatus); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.clusterModeStatus, e); + } + } + return null; + } + public void setMyKey(VehicleDataResult myKey) { + if (myKey != null) { + parameters.put(Names.myKey, myKey); + } else { + parameters.remove(Names.myKey); + } + } + public VehicleDataResult getMyKey() { + Object obj = parameters.get(Names.myKey); + if (obj instanceof VehicleDataResult) { + return (VehicleDataResult) obj; + } else if (obj instanceof Hashtable) { + try { + return new VehicleDataResult((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.myKey, e); + } + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UpdateTurnList.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UpdateTurnList.java new file mode 100644 index 000000000..6911a93ad --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UpdateTurnList.java @@ -0,0 +1,67 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; +import java.util.Vector; + +import com.ford.syncV4.proxy.RPCRequest; +import com.ford.syncV4.proxy.constants.Names; + +public class UpdateTurnList extends RPCRequest { + + public UpdateTurnList() { + super("UpdateTurnList"); + } + public UpdateTurnList(Hashtable hash) { + super(hash); + } + public void setTurnList(Vector<Turn> turnList) { + if (turnList != null) { + parameters.put(Names.turnList, turnList); + } else { + parameters.remove(Names.turnList); + } + } + public Vector<Turn> getTurnList() { + if (parameters.get(Names.turnList) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)parameters.get(Names.turnList); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof Turn) { + return (Vector<Turn>) list; + } else if (obj instanceof Hashtable) { + Vector<Turn> newList = new Vector<Turn>(); + for (Object hashObj : list) { + newList.add(new Turn((Hashtable)hashObj)); + } + return newList; + } + } + } + return null; + } + public void setSoftButtons(Vector<SoftButton> softButtons) { + if (softButtons != null) { + parameters.put(Names.softButtons, softButtons); + } else { + parameters.remove(Names.softButtons); + } + } + public Vector<SoftButton> getSoftButtons() { + if (parameters.get(Names.softButtons) instanceof Vector<?>) { + Vector<?> list = (Vector<?>)parameters.get(Names.softButtons); + if (list != null && list.size() > 0) { + Object obj = list.get(0); + if (obj instanceof SoftButton) { + return (Vector<SoftButton>) list; + } else if (obj instanceof Hashtable) { + Vector<SoftButton> newList = new Vector<SoftButton>(); + for (Object hashObj : list) { + newList.add(new SoftButton((Hashtable)hashObj)); + } + return newList; + } + } + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UpdateTurnListResponse.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UpdateTurnListResponse.java new file mode 100644 index 000000000..ffa09e08b --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/UpdateTurnListResponse.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCResponse; + +public class UpdateTurnListResponse extends RPCResponse { + + public UpdateTurnListResponse() { + super("UpdateTurnList"); + } + public UpdateTurnListResponse(Hashtable hash) { + super(hash); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/VehicleDataResult.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/VehicleDataResult.java new file mode 100644 index 000000000..b6a9c8503 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/VehicleDataResult.java @@ -0,0 +1,62 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.proxy.rpc.enums.DisplayType; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataResultCode; +import com.ford.syncV4.proxy.rpc.enums.VehicleDataType; +import com.ford.syncV4.util.DebugTool; + +public class VehicleDataResult extends RPCStruct { + + public VehicleDataResult() { } + public VehicleDataResult(Hashtable hash) { + super(hash); + } + public void setDataType(VehicleDataType dataType) { + if (dataType != null) { + store.put(Names.dataType, dataType); + } else { + store.remove(Names.dataType); + } + } + public VehicleDataType getDataType() { + Object obj = store.get(Names.dataType); + if (obj instanceof VehicleDataType) { + return (VehicleDataType) obj; + } else if (obj instanceof String) { + VehicleDataType theCode = null; + try { + theCode = VehicleDataType.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.dataType, e); + } + return theCode; + } + return null; + } + public void setResultCode(VehicleDataResultCode resultCode) { + if (resultCode != null) { + store.put(Names.resultCode, resultCode); + } else { + store.remove(Names.resultCode); + } + } + public VehicleDataResultCode getResultCode() { + Object obj = store.get(Names.resultCode); + if (obj instanceof VehicleDataResultCode) { + return (VehicleDataResultCode) obj; + } else if (obj instanceof String) { + VehicleDataResultCode theCode = null; + try { + theCode = VehicleDataResultCode.valueForString((String) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.resultCode, e); + } + return theCode; + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/VehicleType.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/VehicleType.java new file mode 100644 index 000000000..ce0d2727c --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/VehicleType.java @@ -0,0 +1,54 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; + +public class VehicleType extends RPCStruct { + + public VehicleType() { } + public VehicleType(Hashtable hash) { + super(hash); + } + public String getMake() { + return (String) store.get(Names.make); + } + public void setMake(String make) { + if (make != null) { + store.put(Names.make, make); + } else { + store.remove(Names.make); + } + } + public String getModel() { + return (String) store.get(Names.model); + } + public void setModel(String model) { + if (model != null) { + store.put(Names.model, model); + } else { + store.remove(Names.model); + } + } + public String getModelYear() { + return (String) store.get(Names.modelYear); + } + public void setModelYear(String modelYear) { + if (modelYear != null) { + store.put(Names.modelYear, modelYear); + } else { + store.remove(Names.modelYear); + } + } + public String getTrim() { + return (String) store.get(Names.trim); + } + public void setTrim(String trim) { + if (trim != null) { + store.put(Names.trim, trim); + } else { + store.remove(Names.trim); + } + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/VrHelpItem.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/VrHelpItem.java new file mode 100644 index 000000000..add4e74ed --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/VrHelpItem.java @@ -0,0 +1,55 @@ +package com.ford.syncV4.proxy.rpc; + +import java.util.Hashtable; + +import com.ford.syncV4.proxy.RPCStruct; +import com.ford.syncV4.proxy.constants.Names; +import com.ford.syncV4.util.DebugTool; + +public class VrHelpItem extends RPCStruct { + + public VrHelpItem() { } + public VrHelpItem(Hashtable hash) { + super(hash); + } + public void setText(String text) { + if (text != null) { + store.put(Names.text, text); + } else { + store.remove(Names.text); + } + } + public String getText() { + return (String) store.get(Names.menuName); + } + public void setImage(Image image) { + if (image != null) { + store.put(Names.image, image); + } else { + store.remove(Names.image); + } + } + public Image getImage() { + Object obj = store.get(Names.image); + if (obj instanceof Image) { + return (Image) obj; + } else if (obj instanceof Hashtable) { + try { + return new Image((Hashtable) obj); + } catch (Exception e) { + DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.image, e); + } + } + return null; + } + public void setPosition(Integer position) { + if (position != null) { + store.put(Names.position, position); + } else { + store.remove(Names.position); + } + } + public Integer getPosition() { + return (Integer) store.get(Names.position); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AmbientLightStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AmbientLightStatus.java new file mode 100644 index 000000000..ff1cf6246 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AmbientLightStatus.java @@ -0,0 +1,16 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum AmbientLightStatus { + NIGHT, + TWILIGHT_1, + TWILIGHT_2, + TWILIGHT_3, + TWILIGHT_4, + DAY, + UNKNOWN, + INVALID; + + public static AmbientLightStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AppHMIType.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AppHMIType.java new file mode 100644 index 000000000..f5676495e --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AppHMIType.java @@ -0,0 +1,18 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum AppHMIType { + DEFAULT, + COMMUNICATION, + MEDIA, + MESSAGING, + NAVIGATION, + INFORMATION, + SOCIAL, + BACKGROUND_PROCESS, + TESTING, + SYSTEM; + + public static AppHMIType valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AppInterfaceUnregisteredReason.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AppInterfaceUnregisteredReason.java new file mode 100644 index 000000000..5d43e37d8 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AppInterfaceUnregisteredReason.java @@ -0,0 +1,20 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+
+public enum AppInterfaceUnregisteredReason {
+ USER_EXIT,
+ IGNITION_OFF,
+ BLUETOOTH_OFF,
+ USB_DISCONNECTED,
+ REQUEST_WHILE_IN_NONE_HMI_LEVEL,
+ TOO_MANY_REQUESTS,
+ DRIVER_DISTRACTION_VIOLATION,
+ LANGUAGE_CHANGE,
+ MASTER_RESET,
+ FACTORY_DEFAULTS,
+ APP_UNAUTHORIZED;
+
+ public static AppInterfaceUnregisteredReason valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AudioStreamingState.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AudioStreamingState.java new file mode 100644 index 000000000..b54bb6399 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AudioStreamingState.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum AudioStreamingState {
+ AUDIBLE,
+ ATTENUATED,
+ NOT_AUDIBLE;
+
+ public static AudioStreamingState valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AudioType.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AudioType.java new file mode 100644 index 000000000..85f87d491 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/AudioType.java @@ -0,0 +1,9 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum AudioType { + PCM; + + public static AudioType valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/BitsPerSample.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/BitsPerSample.java new file mode 100644 index 000000000..8389bb32b --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/BitsPerSample.java @@ -0,0 +1,27 @@ +package com.ford.syncV4.proxy.rpc.enums; + +import java.util.EnumSet; + +public enum BitsPerSample { + _8_BIT("8_BIT"), + _16_BIT("16_BIT"); + + String internalName; + + private BitsPerSample(String internalName) { + this.internalName = internalName; + } + + public String toString() { + return this.internalName; + } + + public static BitsPerSample valueForString(String value) { + for (BitsPerSample anEnum : EnumSet.allOf(BitsPerSample.class)) { + if (anEnum.toString().equals(value)) { + return anEnum; + } + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ButtonEventMode.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ButtonEventMode.java new file mode 100644 index 000000000..4d0a096d0 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ButtonEventMode.java @@ -0,0 +1,10 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum ButtonEventMode {
+ BUTTONUP,
+ BUTTONDOWN;
+
+ public static ButtonEventMode valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ButtonName.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ButtonName.java new file mode 100644 index 000000000..a00359115 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ButtonName.java @@ -0,0 +1,78 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum ButtonName{
+ OK,
+ SEEKLEFT,
+ SEEKRIGHT,
+ TUNEUP,
+ TUNEDOWN,
+ PRESET_0,
+ PRESET_1,
+ PRESET_2,
+ PRESET_3,
+ PRESET_4,
+ PRESET_5,
+ PRESET_6,
+ PRESET_7,
+ PRESET_8,
+ PRESET_9,
+ CUSTOM_BUTTON,
+ SEARCH;
+
+ public static ButtonName valueForString(String value) {
+ try {
+ return valueOf(value);
+ } catch (IllegalArgumentException e) {
+ return null;
+ }
+ }
+
+ /**
+ * indexForPresetButton returns the integer index for preset buttons
+ * which match the preset order. E.G.: indexForPresetButton(PRESET_1)
+ * returns the value 1. If the buttonName given is not a preset button,
+ * the method will return null.
+ *
+ * @param buttonName
+ * @return Integer
+ */
+ public static Integer indexForPresetButton(ButtonName buttonName) {
+
+ Integer returnIndex = null;
+
+ switch(buttonName) {
+ case PRESET_0:
+ returnIndex = 0;
+ break;
+ case PRESET_1:
+ returnIndex = 1;
+ break;
+ case PRESET_2:
+ returnIndex = 2;
+ break;
+ case PRESET_3:
+ returnIndex = 3;
+ break;
+ case PRESET_4:
+ returnIndex = 4;
+ break;
+ case PRESET_5:
+ returnIndex = 5;
+ break;
+ case PRESET_6:
+ returnIndex = 6;
+ break;
+ case PRESET_7:
+ returnIndex = 7;
+ break;
+ case PRESET_8:
+ returnIndex = 8;
+ break;
+ case PRESET_9:
+ returnIndex = 9;
+ break;
+ }
+
+ return returnIndex;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ButtonPressMode.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ButtonPressMode.java new file mode 100644 index 000000000..ca0d7c3d0 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ButtonPressMode.java @@ -0,0 +1,10 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum ButtonPressMode {
+ LONG,
+ SHORT;
+
+ public static ButtonPressMode valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/CarModeStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/CarModeStatus.java new file mode 100644 index 000000000..91a559d5b --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/CarModeStatus.java @@ -0,0 +1,12 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum CarModeStatus { + NORMAL, + FACTORY, + TRANSPORT, + CRASH; + + public static CarModeStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/CharacterSet.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/CharacterSet.java new file mode 100644 index 000000000..1f71211e3 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/CharacterSet.java @@ -0,0 +1,12 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum CharacterSet {
+ TYPE2SET,
+ TYPE5SET,
+ CID1SET,
+ CID2SET;
+
+ public static CharacterSet valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/CompassDirection.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/CompassDirection.java new file mode 100644 index 000000000..891e5188f --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/CompassDirection.java @@ -0,0 +1,16 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum CompassDirection { + NORTH, + NORTHWEST, + WEST, + SOUTHWEST, + SOUTH, + SOUTHEAST, + EAST, + NORTHEAST; + + public static CompassDirection valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ComponentVolumeStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ComponentVolumeStatus.java new file mode 100644 index 000000000..279e54b0d --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ComponentVolumeStatus.java @@ -0,0 +1,14 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum ComponentVolumeStatus { + UNKNOWN, + NORMAL, + LOW, + FAULT, + ALERT, + NOT_SUPPORTED; + + public static ComponentVolumeStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/DeviceLevelStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/DeviceLevelStatus.java new file mode 100644 index 000000000..82b663c94 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/DeviceLevelStatus.java @@ -0,0 +1,14 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum DeviceLevelStatus { + ZERO_LEVEL_BARS, + ONE_LEVEL_BARS, + TWO_LEVEL_BARS, + THREE_LEVEL_BARS, + FOUR_LEVEL_BARS, + NOT_PROVIDED; + + public static DeviceLevelStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/Dimension.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/Dimension.java new file mode 100644 index 000000000..2fb500e7d --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/Dimension.java @@ -0,0 +1,28 @@ +package com.ford.syncV4.proxy.rpc.enums; + +import java.util.EnumSet; + +public enum Dimension { + NO_FIX("NO_FIX"), + _2D("2D"), + _3D("3D"); + + String internalName; + + private Dimension(String internalName) { + this.internalName = internalName; + } + + public String toString() { + return this.internalName; + } + + public static Dimension valueForString(String value) { + for (Dimension anEnum : EnumSet.allOf(Dimension.class)) { + if (anEnum.toString().equals(value)) { + return anEnum; + } + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/DisplayType.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/DisplayType.java new file mode 100644 index 000000000..c40be746a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/DisplayType.java @@ -0,0 +1,35 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum DisplayType {
+ CID("CID"),
+ TYPE2("TYPE2"),
+ TYPE5("TYPE5"),
+ NGN("NGN"),
+ GEN2_8_DMA("GEN2_8_DMA"),
+ GEN2_6_DMA("GEN2_6_DMA"),
+ MFD3("MFD3"),
+ MFD4("MFD4"),
+ MFD5("MFD5"),
+ GEN3_8_INCH("GEN3_8-INCH");
+
+ final String internalName;
+
+ private DisplayType(String internalName) {
+ this.internalName = internalName;
+ }
+
+ public static DisplayType valueForString(String value) {
+ for (DisplayType type : DisplayType.values()) {
+ if (type.toString().equals(value)) {
+ return type;
+ }
+ }
+
+ throw new IllegalArgumentException("Unknown value " + value);
+ }
+
+ @Override
+ public String toString() {
+ return internalName;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/DriverDistractionState.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/DriverDistractionState.java new file mode 100644 index 000000000..e18ca3ca2 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/DriverDistractionState.java @@ -0,0 +1,17 @@ +/**
+ *
+ */
+package com.ford.syncV4.proxy.rpc.enums;
+
+/**
+ * @author skhare3
+ *Enumeration that describes possible states of driver distraction.
+ */
+public enum DriverDistractionState {
+ DD_ON,
+ DD_OFF;
+
+ public static DriverDistractionState valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ECallConfirmationStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ECallConfirmationStatus.java new file mode 100644 index 000000000..1c5a1dc84 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ECallConfirmationStatus.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum ECallConfirmationStatus { + NORMAL, + CALL_IN_PROGRESS, + CALL_CANCELLED, + CALL_COMPLETED, + CALL_UNSUCCESSFUL, + ECALL_CONFIGURED_OFF, + CALL_COMPLETE_DTMF_TIMEOUT; + + public static ECallConfirmationStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/EmergencyEventType.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/EmergencyEventType.java new file mode 100644 index 000000000..8468e2fcd --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/EmergencyEventType.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum EmergencyEventType { + NO_EVENT, + FRONTAL, + SIDE, + REAR, + ROLLOVER, + NOT_SUPPORTED, + FAULT; + + public static EmergencyEventType valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/FileType.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/FileType.java new file mode 100644 index 000000000..5c482fb4d --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/FileType.java @@ -0,0 +1,16 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum FileType { + GRAPHIC_BMP, + GRAPHIC_JPEG, + GRAPHIC_PNG, + AUDIO_WAVE, + AUDIO_MP3, + AUDIO_AAC, + BINARY, + JSON; + + public static FileType valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/FuelCutoffStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/FuelCutoffStatus.java new file mode 100644 index 000000000..462d76e78 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/FuelCutoffStatus.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum FuelCutoffStatus { + TERMINATE_FUEL, + NORMAL_OPERATION, + FAULT; + + public static FuelCutoffStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/GearShiftAdviceStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/GearShiftAdviceStatus.java new file mode 100644 index 000000000..4b847e2c1 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/GearShiftAdviceStatus.java @@ -0,0 +1,14 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum GearShiftAdviceStatus { + NO_INDICATION, + UPSHIFT_FUEL_ECONOMY, + UPSHIFT_PERFORMANCE, + UPSHIFT_WARNING, + DOWNSHIFT_RECOMMENDATION, + SHIFT_TO_NEUTRAL; + + public static GearShiftAdviceStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/GlobalProperty.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/GlobalProperty.java new file mode 100644 index 000000000..75dac2dbe --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/GlobalProperty.java @@ -0,0 +1,14 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum GlobalProperty{
+ HELPPROMPT,
+ TIMEOUTPROMPT,
+ VRHELPTITLE,
+ KEYBOARDPROPERTIES,
+ VRHELPITEMS,
+ MENUNAME, MENUICON;
+
+ public static GlobalProperty valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/HMILevel.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/HMILevel.java new file mode 100644 index 000000000..e13f485ac --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/HMILevel.java @@ -0,0 +1,29 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+public enum HMILevel {
+ HMI_FULL("FULL"),
+ HMI_LIMITED("LIMITED"),
+ HMI_BACKGROUND("BACKGROUND"),
+ HMI_NONE("NONE");
+
+ String internalName;
+
+ private HMILevel(String internalName) {
+ this.internalName = internalName;
+ }
+
+ public String toString() {
+ return this.internalName;
+ }
+
+ public static HMILevel valueForString(String value) {
+ for (HMILevel anEnum : EnumSet.allOf(HMILevel.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/HmiZoneCapabilities.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/HmiZoneCapabilities.java new file mode 100644 index 000000000..87b74b5bd --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/HmiZoneCapabilities.java @@ -0,0 +1,10 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum HmiZoneCapabilities {
+ FRONT,
+ BACK;
+
+ public static HmiZoneCapabilities valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/IgnitionStableStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/IgnitionStableStatus.java new file mode 100644 index 000000000..eeb0f4bf3 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/IgnitionStableStatus.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum IgnitionStableStatus { + IGNITION_SWITCH_NOT_STABLE, + IGNITION_SWITCH_STABLE, + MISSING_FROM_TRANSMITTER; + + public static IgnitionStableStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/IgnitionStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/IgnitionStatus.java new file mode 100644 index 000000000..9485464a0 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/IgnitionStatus.java @@ -0,0 +1,14 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum IgnitionStatus { + UNKNOWN, + OFF, + ACCESSORY, + RUN, + START, + INVALID; + + public static IgnitionStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ImageFieldName.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ImageFieldName.java new file mode 100644 index 000000000..9a7dc39da --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ImageFieldName.java @@ -0,0 +1,19 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum ImageFieldName { + softButtonImage, + choiceImage, + choiceSecondaryImage, + vrHelpItem, + turnIcon, + menuIcon, + cmdIcon, + appIcon, + graphic, + showConstantTBTIcon, + showConstantTBTNextTurnIcon; + + public static ImageFieldName valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ImageType.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ImageType.java new file mode 100644 index 000000000..0a6fff66e --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/ImageType.java @@ -0,0 +1,10 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum ImageType { + STATIC, + DYNAMIC; + + public static ImageType valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/InteractionMode.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/InteractionMode.java new file mode 100644 index 000000000..9a39ac58e --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/InteractionMode.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum InteractionMode {
+ MANUAL_ONLY,
+ VR_ONLY,
+ BOTH;
+
+ public static InteractionMode valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/KeyboardEvent.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/KeyboardEvent.java new file mode 100644 index 000000000..b477ca49a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/KeyboardEvent.java @@ -0,0 +1,17 @@ +package com.ford.syncV4.proxy.rpc.enums; + +/** + * Created by Andrew Batutin on 9/22/13. + */ +public enum KeyboardEvent { + + KEYPRESS, + ENTRY_SUBMITTED, + ENTRY_CANCELLED, + ENTRY_ABORTED; + + public static KeyboardEvent valueForString(String value) { + return valueOf(value); + } + +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/KeyboardLayout.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/KeyboardLayout.java new file mode 100644 index 000000000..4db678895 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/KeyboardLayout.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum KeyboardLayout { + QWERTY, + QWERTZ, + AZERTY; + + public static KeyboardLayout valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/KeypressMode.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/KeypressMode.java new file mode 100644 index 000000000..c68a1e999 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/KeypressMode.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum KeypressMode { + SINGLE_KEYPRESS, + QUEUE_KEYPRESSES, + RESEND_CURRENT_ENTRY; + + public static KeypressMode valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/Language.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/Language.java new file mode 100644 index 000000000..8e0daeccd --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/Language.java @@ -0,0 +1,49 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+public enum Language {
+ EN_US("EN-US"),
+ ES_MX("ES-MX"),
+ FR_CA("FR-CA"),
+ DE_DE("DE-DE"),
+ ES_ES("ES-ES"),
+ EN_GB("EN-GB"),
+ RU_RU("RU-RU"),
+ TR_TR("TR-TR"),
+ PL_PL("PL-PL"),
+ FR_FR("FR-FR"),
+ IT_IT("IT-IT"),
+ SV_SE("SV-SE"),
+ PT_PT("PT-PT"),
+ NL_NL("NL-NL"),
+ EN_AU("EN-AU"),
+ ZH_CN("ZH-CN"),
+ ZH_TW("ZH-TW"),
+ JA_JP("JA-JP"),
+ AR_SA("AR-SA"),
+ KO_KR("KO-KR"),
+ PT_BR("PT-BR"),
+ CS_CZ("CS-CZ"),
+ DA_DK("DA-DK"),
+ NO_NO("NO-NO");
+
+ String internalName;
+
+ private Language(String internalName) {
+ this.internalName = internalName;
+ }
+
+ public String toString() {
+ return this.internalName;
+ }
+
+ public static Language valueForString(String value) {
+ for (Language anEnum : EnumSet.allOf(Language.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/LayoutMode.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/LayoutMode.java new file mode 100644 index 000000000..086880bd8 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/LayoutMode.java @@ -0,0 +1,13 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum LayoutMode { + ICON_ONLY, + ICON_WITH_SEARCH, + LIST_ONLY, + LIST_WITH_SEARCH, + KEYBOARD; + + public static LayoutMode valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/LightSwitchStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/LightSwitchStatus.java new file mode 100644 index 000000000..ff5f055cc --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/LightSwitchStatus.java @@ -0,0 +1,12 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum LightSwitchStatus { + OFF, + PARKLAMP, + HEADLAMP, + AUTOLAMP; + + public static LightSwitchStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/MaintenanceModeStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/MaintenanceModeStatus.java new file mode 100644 index 000000000..b5480a510 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/MaintenanceModeStatus.java @@ -0,0 +1,12 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum MaintenanceModeStatus { + NORMAL, + NEAR, + ACTIVE, + FEATURE_NOT_PRESENT; + + public static MaintenanceModeStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/MediaClockFormat.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/MediaClockFormat.java new file mode 100644 index 000000000..081b0a2ce --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/MediaClockFormat.java @@ -0,0 +1,13 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum MediaClockFormat {
+ CLOCK1,
+ CLOCK2,
+ CLOCKTEXT1,
+ CLOCKTEXT2,
+ CLOCKTEXT3;
+
+ public static MediaClockFormat valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/MessageType.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/MessageType.java new file mode 100644 index 000000000..c500b927d --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/MessageType.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum MessageType { + request, + response, + notification; + + public static MessageType valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PRNDL.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PRNDL.java new file mode 100644 index 000000000..cdb103186 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PRNDL.java @@ -0,0 +1,24 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum PRNDL { + PARK, + REVERSE, + NEUTRAL, + DRIVE, + SPORT, + LOWGEAR, + FIRST, + SECOND, + THIRD, + FOURTH, + FIFTH, + SIXTH, + SEVENTH, + EIGHTH, + UNKNOWN, + FAULT; + + public static PRNDL valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PermissionStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PermissionStatus.java new file mode 100644 index 000000000..cac3cab8a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PermissionStatus.java @@ -0,0 +1,12 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum PermissionStatus {
+ ALLOWED,
+ DISALLOWED,
+ USER_DISALLOWED,
+ USER_CONSENT_PENDING;
+
+ public static PermissionStatus valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PowerModeQualificationStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PowerModeQualificationStatus.java new file mode 100644 index 000000000..8442514cc --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PowerModeQualificationStatus.java @@ -0,0 +1,12 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum PowerModeQualificationStatus { + POWER_MODE_UNDEFINED, + POWER_MODE_EVALUATION_IN_PROGRESS, + NOT_DEFINED, + POWER_MODE_OK; + + public static PowerModeQualificationStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PowerModeStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PowerModeStatus.java new file mode 100644 index 000000000..da6597619 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PowerModeStatus.java @@ -0,0 +1,17 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum PowerModeStatus { + KEY_OUT, + KEY_RECENTLY_OUT, + KEY_APPROVED_0, + POST_ACCESORY_0, + ACCESORY_1, + POST_IGNITION_1, + IGNITION_ON_2, + RUNNING_2, + CRANK_3; + + public static PowerModeStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PredefinedLayout.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PredefinedLayout.java new file mode 100644 index 000000000..e2c2ca9db --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PredefinedLayout.java @@ -0,0 +1,46 @@ +package com.ford.syncV4.proxy.rpc.enums; + +import java.util.EnumSet; + +public enum PredefinedLayout { + DEFAULT("DEFAULT"), + MEDIA("MEDIA"), + NON_MEDIA("NON-MEDIA"), + ONSCREEN_PRESETS("ONSCREEN_PRESETS"), + NAV_FULLSCREEN_MAP("NAV_FULLSCREEN_MAP"), + NAV_LIST("NAV_LIST"), + NAV_KEYBOARD("NAV_KEYBOARD"), + GRAPHIC_WITH_TEXT("GRAPHIC_WITH_TEXT"), + TEXT_WITH_GRAPHIC("TEXT_WITH_GRAPHIC"), + TILES_ONLY("TILES_ONLY"), + TEXTBUTTONS_ONLY("TEXTBUTTONS_ONLY"), + GRAPHIC_WITH_TILES("GRAPHIC_WITH_TILES"), + TILES_WITH_GRAPHIC("TILES_WITH_GRAPHIC"), + GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS("GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS"), + TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC("TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC"), + GRAPHIC_WITH_TEXTBUTTONS("GRAPHIC_WITH_TEXTBUTTONS"), + TEXTBUTTONS_WITH_GRAPHIC("TEXTBUTTONS_WITH_GRAPHIC"), + LARGE_GRAPHIC_WITH_SOFTBUTTONS("LARGE_GRAPHIC_WITH_SOFTBUTTONS"), + DOUBLE_GRAPHIC_WITH_SOFTBUTTONS("DOUBLE_GRAPHIC_WITH_SOFTBUTTONS"), + LARGE_GRAPHIC_ONLY("LARGE_GRAPHIC_ONLY"); + + String internalName; + + private PredefinedLayout(String internalName) { + this.internalName = internalName; + } + + public static PredefinedLayout valueForString(String value) { + for (PredefinedLayout anEnum : EnumSet.allOf(PredefinedLayout.class)) { + if (anEnum.toString().equals(value)) { + return anEnum; + } + } + + throw new IllegalArgumentException("Unknown value " + value); + } + + public String toString() { + return this.internalName; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PrerecordedSpeech.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PrerecordedSpeech.java new file mode 100755 index 000000000..d449ad2d1 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PrerecordedSpeech.java @@ -0,0 +1,13 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum PrerecordedSpeech { + HELP_JINGLE, + INITIAL_JINGLE, + LISTEN_JINGLE, + POSITIVE_JINGLE, + NEGATIVE_JINGLE; + + public static PrerecordedSpeech valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PrimaryAudioSource.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PrimaryAudioSource.java new file mode 100644 index 000000000..9f5de9d9d --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/PrimaryAudioSource.java @@ -0,0 +1,15 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum PrimaryAudioSource { + NO_SOURCE_SELECTED, + USB, + USB2, + BLUETOOTH_STEREO_BTST, + LINE_IN, + IPOD, + MOBILE_APP; + + public static PrimaryAudioSource valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/RequestType.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/RequestType.java new file mode 100644 index 000000000..4f4503d1a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/RequestType.java @@ -0,0 +1,13 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum RequestType { + HTTP, + FILE_RESUME, + AUTH_REQUEST, + AUTH_CHALLENGE, + AUTH_ACK; + + public static RequestType valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/Result.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/Result.java new file mode 100644 index 000000000..217161fdb --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/Result.java @@ -0,0 +1,173 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+/**
+ * A list of result codes
+ */
+public enum Result {
+ /**
+ * The request succeeded
+ */
+ SUCCESS,
+ /**
+ * The RPC (e.g. {@link com.ford.syncV4.proxy.rpc.Slider}) executed successfully and the user
+ * selected to save the current position / value
+ */
+ SAVED,
+ /**
+ * 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
+ */
+ INVALID_DATA,
+ /**
+ * The request is not supported by Sync
+ */
+ UNSUPPORTED_REQUEST,
+ /**
+ * The system could not process the request because the necessary memory couldn't be allocated
+ */
+ OUT_OF_MEMORY,
+ /**
+ * There are too many requests pending (means, that the response has not been delivered, yet)
+ */
+ TOO_MANY_PENDING_REQUESTS,
+ /**
+ * One of the provided IDs is not valid. For example:
+ * this applies to CorrelationID, SubscriptionID, CommandID, MenuID, etc.
+ */
+ INVALID_ID,
+ /**
+ * There was a conflict with an registered name (application or menu item) or vr command
+ */
+ DUPLICATE_NAME,
+ /**
+ * There are already too many registered applications
+ */
+ TOO_MANY_APPLICATIONS,
+ /**
+ * RegisterApplication has been called again, after a RegisterApplication was successful before
+ */
+ APPLICATION_REGISTERED_ALREADY,
+ /**
+ * Sync doesn't support the protocol that is requested by the mobile application
+ */
+ UNSUPPORTED_VERSION,
+ /**
+ * The requested language is currently not supported. Might be because of a mismatch of the
+ * currently active language on Sync and the requested language
+ */
+ WRONG_LANGUAGE,
+ /**
+ * An command can not be executed because no application has been registered with
+ * RegisterApplication
+ */
+ APPLICATION_NOT_REGISTERED,
+ /**
+ * 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
+ */
+ IN_USE,
+ /**
+ * The user has turned off access to vehicle data, and it is globally unavailable to mobile
+ * applications
+ */
+ VEHICLE_DATA_NOT_ALLOWED,
+ /**
+ * The requested vehicle data is not available on this vehicle or is not published
+ */
+ VEHICLE_DATA_NOT_AVAILABLE,
+ /**
+ * The requested command was rejected, e.g. because mobile app is in background and cannot
+ * perform any HMI commands. Or an HMI command (e.g. {@link com.ford.syncV4.proxy.rpc.Speak})
+ * is rejected because a higher priority HMI command
+ * (e.g. {@link com.ford.syncV4.proxy.rpc.Alert}) is playing
+ */
+ REJECTED,
+ /**
+ * A command was aborted, for example due to user interaction (e.g. user pressed button).
+ * Or an HMI command (e.g. {@link com.ford.syncV4.proxy.rpc.Speak}) is aborted because a
+ * higher priority HMI command (e.g. {@link com.ford.syncV4.proxy.rpc.Alert}) was requested
+ */
+ ABORTED,
+ /**
+ * 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
+ */
+ IGNORED,
+ /**
+ * A button that was requested for subscription is not supported under the current system.
+ * NOTE: could become a more generic
+ * {@link com.ford.syncV4.proxy.rpc.enums.Result#UNSUPPORTED_RESOURCE} by merging with
+ * {@link com.ford.syncV4.proxy.rpc.enums.Result#VEHICLE_DATA_NOT_AVAILABLE}
+ */
+ UNSUPPORTED_RESOURCE,
+ /**
+ * A specified file could not be found on Sync
+ */
+ FILE_NOT_FOUND,
+ /**
+ * Provided data is valid but something went wrong in the lower layers
+ */
+ GENERIC_ERROR,
+ /**
+ * RPC is not authorized in local policy table
+ */
+ DISALLOWED,
+ /**
+ * RPC is included in a functional group explicitly blocked by the user
+ */
+ USER_DISALLOWED,
+ /**
+ * Overlay reached the maximum timeout and closed
+ */
+ TIMED_OUT,
+ /**
+ * User selected to Cancel Route
+ */
+ CANCEL_ROUTE,
+ /**
+ * The RPC (e.g. {@link com.ford.syncV4.proxy.rpc.ReadDID}) executed successfully but the data
+ * exceeded the platform maximum threshold and thus, only part of the data is available
+ */
+ TRUNCATED_DATA,
+ /**
+ * The user interrupted the RPC (e.g. {@link com.ford.syncV4.proxy.rpc.PerformAudioPassThru})
+ * and indicated to start over.
+ * NOTE, the app must issue the new RPC
+ */
+ RETRY,
+ /**
+ * The RPC (e.g. {@link com.ford.syncV4.proxy.rpc.SubscribeVehicleData}) executed successfully
+ * but one or more items have a warning or failure
+ */
+ WARNINGS,
+ /**
+ * The provided hash ID does not match the hash of the current set of registered data or
+ * the core could not resume the previous data
+ */
+ RESUME_FAILED,
+ /**
+ * The certificate provided during authentication is invalid
+ */
+ INVALID_CERT,
+ /**
+ * The certificate provided during authentication is expired
+ */
+ EXPIRED_CERT;
+
+ /**
+ * Convert {@link java.lang.String} value to {@link com.ford.syncV4.proxy.rpc.enums.Result}
+ * object
+ *
+ * @param value {@link java.lang.String}
+ * @return {@link com.ford.syncV4.proxy.rpc.enums.Result} object
+ */
+ public static Result valueForString(String value) {
+ return valueOf(value);
+ }
+}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SamplingRate.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SamplingRate.java new file mode 100644 index 000000000..8308f40fa --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SamplingRate.java @@ -0,0 +1,29 @@ +package com.ford.syncV4.proxy.rpc.enums; + +import java.util.EnumSet; + +public enum SamplingRate { + _8KHZ("8KHZ"), + _16KHZ("16KHZ"), + _22KHZ("22KHZ"), + _44KHZ("44KHZ"); + + String internalName; + + private SamplingRate(String internalName) { + this.internalName = internalName; + } + + public String toString() { + return this.internalName; + } + + public static SamplingRate valueForString(String value) { + for (SamplingRate anEnum : EnumSet.allOf(SamplingRate.class)) { + if (anEnum.toString().equals(value)) { + return anEnum; + } + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SingleTirePressureStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SingleTirePressureStatus.java new file mode 100644 index 000000000..48ed65a57 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SingleTirePressureStatus.java @@ -0,0 +1,13 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum SingleTirePressureStatus { + UNKNOWN, + NORMAL, + LOW, + FAULT, + NOT_SUPPORTED; + + public static SingleTirePressureStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SoftButtonType.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SoftButtonType.java new file mode 100644 index 000000000..ad7efefad --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SoftButtonType.java @@ -0,0 +1,28 @@ +package com.ford.syncV4.proxy.rpc.enums; + +import java.util.EnumSet; + +public enum SoftButtonType { + SBT_TEXT("TEXT"), + SBT_IMAGE("IMAGE"), + SBT_BOTH("BOTH"); + + String internalName; + + private SoftButtonType(String internalName) { + this.internalName = internalName; + } + + public String toString() { + return this.internalName; + } + + public static SoftButtonType valueForString(String value) { + for (SoftButtonType anEnum : EnumSet.allOf(SoftButtonType.class)) { + if (anEnum.toString().equals(value)) { + return anEnum; + } + } + return null; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SpeechCapabilities.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SpeechCapabilities.java new file mode 100644 index 000000000..569de39a1 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SpeechCapabilities.java @@ -0,0 +1,13 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum SpeechCapabilities {
+ TEXT,
+ SAPI_PHONEMES,
+ LHPLUS_PHONEMES,
+ PRE_RECORDED,
+ SILENCE;
+
+ public static SpeechCapabilities valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SyncConnectionState.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SyncConnectionState.java new file mode 100644 index 000000000..b6d1f771a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SyncConnectionState.java @@ -0,0 +1,6 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum SyncConnectionState {
+ SYNC_CONNECTED,
+ SYNC_DISCONNECTED;
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SyncDisconnectedReason.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SyncDisconnectedReason.java new file mode 100644 index 000000000..7a9abebff --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SyncDisconnectedReason.java @@ -0,0 +1,52 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum SyncDisconnectedReason {
+ USER_EXIT,
+ IGNITION_OFF,
+ BLUETOOTH_OFF,
+ USB_DISCONNECTED,
+ REQUEST_WHILE_IN_NONE_HMI_LEVEL,
+ TOO_MANY_REQUESTS,
+ DRIVER_DISTRACTION_VIOLATION,
+ LANGUAGE_CHANGE,
+ MASTER_RESET,
+ FACTORY_DEFAULTS,
+ HEARTBEAT_PAST_DUE,
+ TRANSPORT_ERROR,
+ APPLICATION_REQUESTED_DISCONNECT,
+ DEFAULT;
+
+ public static SyncDisconnectedReason valueForString(String value) {
+ return valueOf(value);
+ }
+
+ public static SyncDisconnectedReason convertAppInterfaceUnregisteredReason(AppInterfaceUnregisteredReason reason) {
+
+ SyncDisconnectedReason returnReason = SyncDisconnectedReason.DEFAULT;
+
+ switch(reason) {
+ case USER_EXIT:
+ returnReason = SyncDisconnectedReason.USER_EXIT;
+ case IGNITION_OFF:
+ returnReason = SyncDisconnectedReason.IGNITION_OFF;
+ case BLUETOOTH_OFF:
+ returnReason = SyncDisconnectedReason.BLUETOOTH_OFF;
+ case USB_DISCONNECTED:
+ returnReason = SyncDisconnectedReason.USB_DISCONNECTED;
+ case REQUEST_WHILE_IN_NONE_HMI_LEVEL:
+ returnReason = SyncDisconnectedReason.REQUEST_WHILE_IN_NONE_HMI_LEVEL;
+ case TOO_MANY_REQUESTS:
+ returnReason = SyncDisconnectedReason.TOO_MANY_REQUESTS;
+ case DRIVER_DISTRACTION_VIOLATION:
+ returnReason = SyncDisconnectedReason.DRIVER_DISTRACTION_VIOLATION;
+ case LANGUAGE_CHANGE:
+ returnReason = SyncDisconnectedReason.LANGUAGE_CHANGE;
+ case MASTER_RESET:
+ returnReason = SyncDisconnectedReason.MASTER_RESET;
+ case FACTORY_DEFAULTS:
+ returnReason = SyncDisconnectedReason.FACTORY_DEFAULTS;
+ }
+
+ return returnReason;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SyncInterfaceAvailability.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SyncInterfaceAvailability.java new file mode 100644 index 000000000..5e6497a72 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SyncInterfaceAvailability.java @@ -0,0 +1,6 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum SyncInterfaceAvailability {
+ SYNC_INTERFACE_AVAILABLE,
+ SYNC_INTERFACE_UNAVAILABLE;
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SystemAction.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SystemAction.java new file mode 100644 index 000000000..54184bf97 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SystemAction.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum SystemAction { + DEFAULT_ACTION, + STEAL_FOCUS, + KEEP_CONTEXT; + + public static SystemAction valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SystemContext.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SystemContext.java new file mode 100644 index 000000000..1462bfa26 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/SystemContext.java @@ -0,0 +1,30 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+public enum SystemContext {
+ SYSCTXT_MAIN("MAIN"),
+ SYSCTXT_VRSESSION("VRSESSION"),
+ SYSCTXT_MENU("MENU"),
+ SYSCTXT_HMI_OBSCURED("HMI_OBSCURED"),
+ SYSCTXT_ALERT("ALERT");
+
+ String internalName;
+
+ private SystemContext(String internalName) {
+ this.internalName = internalName;
+ }
+
+ public String toString() {
+ return this.internalName;
+ }
+
+ public static SystemContext valueForString(String value) {
+ for (SystemContext anEnum : EnumSet.allOf(SystemContext.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TBTState.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TBTState.java new file mode 100644 index 000000000..f9907cc28 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TBTState.java @@ -0,0 +1,18 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum TBTState {
+ ROUTE_UPDATE_REQUEST,
+ ROUTE_ACCEPTED,
+ ROUTE_REFUSED,
+ ROUTE_CANCELLED,
+ ETA_REQUEST,
+ NEXT_TURN_REQUEST,
+ ROUTE_STATUS_REQUEST,
+ ROUTE_SUMMARY_REQUEST,
+ TRIP_STATUS_REQUEST,
+ ROUTE_UPDATE_REQUEST_TIMEOUT; +
+ public static TBTState valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TextAlignment.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TextAlignment.java new file mode 100644 index 000000000..cc9dc4c3a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TextAlignment.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum TextAlignment {
+ LEFT_ALIGNED,
+ RIGHT_ALIGNED,
+ CENTERED;
+
+ public static TextAlignment valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TextFieldName.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TextFieldName.java new file mode 100644 index 000000000..55771cb21 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TextFieldName.java @@ -0,0 +1,31 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum TextFieldName {
+ mainField1,
+ mainField2,
+ mainField3,
+ mainField4,
+ statusBar,
+ mediaClock,
+ mediaTrack,
+ alertText1,
+ alertText2,
+ alertText3,
+ scrollableMessageBody,
+ initialInteractionText,
+ navigationText1,
+ navigationText2,
+ ETA,
+ totalDistance,
+ audioPassThruDisplayText1,
+ audioPassThruDisplayText2,
+ sliderHeader,
+ sliderFooter,
+ menuName,
+ secondaryText,
+ tertiaryText;
+
+ public static TextFieldName valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TouchType.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TouchType.java new file mode 100755 index 000000000..bb42ff5be --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TouchType.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum TouchType { + BEGIN, + MOVE, + END; + + public static TouchType valueForString(String value) { + return valueOf(value); + } +}
\ No newline at end of file diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TriggerSource.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TriggerSource.java new file mode 100644 index 000000000..2f33699c5 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/TriggerSource.java @@ -0,0 +1,28 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+import java.util.EnumSet;
+
+public enum TriggerSource {
+ TS_MENU("MENU"),
+ TS_VR("VR"),
+ TS_KEYBOARD("KEYBOARD");
+
+ String internalName;
+
+ private TriggerSource(String internalName) {
+ this.internalName = internalName;
+ }
+
+ public String toString() {
+ return this.internalName;
+ }
+
+ public static TriggerSource valueForString(String value) {
+ for (TriggerSource anEnum : EnumSet.allOf(TriggerSource.class)) {
+ if (anEnum.toString().equals(value)) {
+ return anEnum;
+ }
+ }
+ return null;
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/UpdateMode.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/UpdateMode.java new file mode 100644 index 000000000..4f3e54a1a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/UpdateMode.java @@ -0,0 +1,13 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum UpdateMode {
+ COUNTUP,
+ COUNTDOWN,
+ PAUSE,
+ RESUME,
+ CLEAR;
+
+ public static UpdateMode valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataActiveStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataActiveStatus.java new file mode 100644 index 000000000..08a98f523 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataActiveStatus.java @@ -0,0 +1,13 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum VehicleDataActiveStatus { + INACTIVE_NOT_CONFIRMED, + INACTIVE_CONFIRMED, + ACTIVE_NOT_CONFIRMED, + ACTIVE_CONFIRMED, + FAULT; + + public static VehicleDataActiveStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataEventStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataEventStatus.java new file mode 100644 index 000000000..329f562a0 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataEventStatus.java @@ -0,0 +1,13 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum VehicleDataEventStatus { + NO_EVENT, + NO, + YES, + NOT_SUPPORTED, + FAULT; + + public static VehicleDataEventStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataNotificationStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataNotificationStatus.java new file mode 100644 index 000000000..ec381d31e --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataNotificationStatus.java @@ -0,0 +1,30 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum VehicleDataNotificationStatus { + NOT_SUPPORTED("VDNS_NOT_SUPPORTED"), + NORMAL("VDNS_NORMAL"), + ACTIVE("VDNS_ACTIVE"), + NOT_USED("VDNS_NOT_USED"); + + final String internalName; + + private VehicleDataNotificationStatus(String internalName) { + this.internalName = internalName; + } + + public static VehicleDataNotificationStatus valueForString(String value) { + for (VehicleDataNotificationStatus status : VehicleDataNotificationStatus + .values()) { + if (status.toString().equals(value)) { + return status; + } + } + + throw new IllegalArgumentException("Unknown value " + value); + } + + @Override + public String toString() { + return internalName; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataResultCode.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataResultCode.java new file mode 100644 index 000000000..2cb9f317f --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataResultCode.java @@ -0,0 +1,16 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum VehicleDataResultCode { + SUCCESS, + DISALLOWED, + USER_DISALLOWED, + INVALID_ID, + DATA_NOT_AVAILABLE, + DATA_ALREADY_SUBSCRIBED, + DATA_NOT_SUBSCRIBED, + IGNORED; + + public static VehicleDataResultCode valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataStatus.java new file mode 100644 index 000000000..b1a4f4865 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataStatus.java @@ -0,0 +1,11 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum VehicleDataStatus { + NO_DATA_EXISTS, + OFF, + ON; + + public static VehicleDataStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataType.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataType.java new file mode 100644 index 000000000..856fe6331 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VehicleDataType.java @@ -0,0 +1,36 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum VehicleDataType { + VEHICLEDATA_GPS, + VEHICLEDATA_SPEED, + VEHICLEDATA_RPM, + VEHICLEDATA_FUELLEVEL, + VEHICLEDATA_FUELLEVEL_STATE, + VEHICLEDATA_FUELCONSUMPTION, + VEHICLEDATA_EXTERNTEMP, + VEHICLEDATA_VIN, + VEHICLEDATA_PRNDL, + VEHICLEDATA_TIREPRESSURE, + VEHICLEDATA_ODOMETER, + VEHICLEDATA_BELTSTATUS, + VEHICLEDATA_BODYINFO, + VEHICLEDATA_DEVICESTATUS, + VEHICLEDATA_BRAKING, + VEHICLEDATA_WIPERSTATUS, + VEHICLEDATA_HEADLAMPSTATUS, + VEHICLEDATA_BATTVOLTAGE, + VEHICLEDATA_ENGINETORQUE, + VEHICLEDATA_ACCPEDAL, + VEHICLEDATA_STEERINGWHEEL, + + // ford specific + VEHICLEDATA_ECALLINFO, + VEHICLEDATA_AIRBAGSTATUS, + VEHICLEDATA_EMERGENCYEVENT, + VEHICLEDATA_CLUSTERMODESTATUS, + VEHICLEDATA_MYKEY; + + public static VehicleDataType valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VrCapabilities.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VrCapabilities.java new file mode 100644 index 000000000..108f33ae2 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/VrCapabilities.java @@ -0,0 +1,9 @@ +package com.ford.syncV4.proxy.rpc.enums;
+
+public enum VrCapabilities {
+ Text,TEXT;
+
+ public static VrCapabilities valueForString(String value) {
+ return valueOf(value);
+ }
+}
diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/WarningLightStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/WarningLightStatus.java new file mode 100644 index 000000000..48c3b263c --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/WarningLightStatus.java @@ -0,0 +1,29 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum WarningLightStatus { + OFF("WLS_OFF"), + ON("WLS_ON"), + FLASH("WLS_FLASH"), + NOT_USED("WLS_NOT_USED"); + + final String internalName; + + private WarningLightStatus(String internalName) { + this.internalName = internalName; + } + + public static WarningLightStatus valueForString(String value) { + for (WarningLightStatus status : WarningLightStatus.values()) { + if (status.toString().equals(value)) { + return status; + } + } + + throw new IllegalArgumentException("Unknown value " + value); + } + + @Override + public String toString() { + return internalName; + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/WiperStatus.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/WiperStatus.java new file mode 100644 index 000000000..4a4a387e9 --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/enums/WiperStatus.java @@ -0,0 +1,23 @@ +package com.ford.syncV4.proxy.rpc.enums; + +public enum WiperStatus { + OFF, + AUTO_OFF, + OFF_MOVING, + MAN_INT_OFF, + MAN_INT_ON, + MAN_LOW, + MAN_HIGH, + MAN_FLICK, + WASH, + AUTO_LOW, + AUTO_HIGH, + COURTESYWIPE, + AUTO_ADJUST, + STALLED, + NO_DATA_EXISTS; + + public static WiperStatus valueForString(String value) { + return valueOf(value); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/session/MobileNavSession.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/session/MobileNavSession.java new file mode 100644 index 000000000..307ee954d --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/session/MobileNavSession.java @@ -0,0 +1,27 @@ +package com.ford.syncV4.proxy.session; + +import com.ford.syncV4.protocol.AbstractProtocol; +import com.ford.syncV4.protocol.enums.ServiceType; +import com.ford.syncV4.session.Session; + +/** + * Created by Andrew Batutin on 8/20/13. + * <p/> + * Abstraction Over Mobile Navigation Session Concept + */ + +public class MobileNavSession { + + private AbstractProtocol _protocol; + + private MobileNavSession() { + } + + public MobileNavSession(AbstractProtocol protocol){ + _protocol = protocol; + } + + public void startSession(Session session) { + _protocol.StartProtocolService(ServiceType.Mobile_Nav, session); + } +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/systemrequest/IOnSystemRequestHandler.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/systemrequest/IOnSystemRequestHandler.java new file mode 100644 index 000000000..4a8543c6d --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/systemrequest/IOnSystemRequestHandler.java @@ -0,0 +1,49 @@ +package com.ford.syncV4.proxy.systemrequest; + +import com.ford.syncV4.proxy.rpc.enums.FileType; + +import java.util.List; + +/** + * Interface for handling special OnSystemRequest notifications. + * + * Created by enikolsky on 2014-02-03. + */ +public interface IOnSystemRequestHandler { + /** + * Requests to download the files from the given URLs. When done, each of + * the files should be uploaded with the {@link ISystemRequestProxy#putSystemFile(String, + * byte[], FileType)} method. + * + * @param proxy the proxy used to upload the downloaded files + * @param urls a list of URLs to download files from + * @param fileType optional file type for HTTP requests + */ + public void onFilesDownloadRequest(ISystemRequestProxy proxy, + List<String> urls, FileType fileType); + + /** + * Requests the rest of the given file ([offset … offset+length] bytes). + * When done, the data should be uploaded with the {@link + * ISystemRequestProxy#putSystemFile(String, byte[], Integer, FileType)} + * method. + * + * @param proxy the proxy used to upload the given file + * @param filename the requested file's name + * @param offset offset of the requested data + * @param length length of the requested data + * @param fileType optional file type + */ + public void onFileResumeRequest(ISystemRequestProxy proxy, String filename, + Integer offset, Integer length, + FileType fileType); + + /** + * Requests to get Policy Table Snapshot file as raw data and process it. When done, result + * should be upload with + * + * @param proxy The proxy used to upload the given file + * @param data Raw bytes data of the Policy Table Snapshot file + */ + public void onPolicyTableSnapshotRequest(final ISystemRequestProxy proxy, byte[] data); +} diff --git a/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/systemrequest/ISystemRequestProxy.java b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/systemrequest/ISystemRequestProxy.java new file mode 100644 index 000000000..ed6b1c87a --- /dev/null +++ b/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/systemrequest/ISystemRequestProxy.java @@ -0,0 +1,48 @@ +package com.ford.syncV4.proxy.systemrequest; + +import com.ford.syncV4.exception.SyncException; +import com.ford.syncV4.proxy.rpc.enums.FileType; + +/** + * Interface to communicate back to the SDL about special OnSystemRequest + * notifications. + * + * Created by enikolsky on 2014-02-03. + */ +public interface ISystemRequestProxy { + /** + * Uploads a requested downloaded file to the SDL. + * + * @param filename filename as received from the server + * @param data file's contents + * @param fileType optional file type + * @throws SyncException if there is an error during preparations to send + * the request + */ + public void putSystemFile(String filename, byte[] data, FileType fileType) + throws SyncException; + + /** + * Uploads a requested part of a downloaded file to the SDL. + * + * @param filename the requested file's name + * @param data file's contents, in the requested range (the length is + * equal to the array's length) + * @param offset the offset at which the data starts + * @param fileType optional file type + * @throws SyncException if there is an error during preparations to send + * the request + */ + public void putSystemFile(String filename, byte[] data, Integer offset, + FileType fileType) throws SyncException; + + /** + * Uploads a updated and processed Policy Table file to the SDL. + * + * @param filename the requested file's name + * @param data file's contents + * @throws SyncException if there is an error during preparations to send the request + */ + public void putPolicyTableUpdateFile(String filename, byte[] data) + throws SyncException; +} |