SDL_Android/SmartDeviceLinkAndroidProxy - added the correct version of the proxy
[profile/ivi/smartdevicelink.git] / SDL_Android / SmartDeviceLinkProxyAndroid / src / com / smartdevicelink / proxy / SmartDeviceLinkProxyBase.java
index fb7ef93..40b4d3b 100755 (executable)
-//
-// Copyright (c) 2013 Ford Motor Company
-//
-package com.smartdevicelink.proxy;
-
-import java.util.Hashtable;
-import java.util.Vector;
-
-import android.os.Handler;
-import android.os.Looper;
-import android.telephony.TelephonyManager;
-
-import com.smartdevicelink.exception.SmartDeviceLinkException;
-import com.smartdevicelink.exception.SmartDeviceLinkExceptionCause;
-import com.smartdevicelink.marshal.JsonRPCMarshaller;
-import com.smartdevicelink.messageDispatcher.IDispatchingStrategy;
-import com.smartdevicelink.messageDispatcher.IncomingProtocolMessageComparitor;
-import com.smartdevicelink.messageDispatcher.InternalProxyMessageComparitor;
-import com.smartdevicelink.messageDispatcher.OutgoingProtocolMessageComparitor;
-import com.smartdevicelink.messageDispatcher.ProxyMessageDispatcher;
-import com.smartdevicelink.protocol.ProtocolMessage;
-import com.smartdevicelink.protocol.enums.FunctionID;
-import com.smartdevicelink.protocol.enums.MessageType;
-import com.smartdevicelink.protocol.enums.SessionType;
-import com.smartdevicelink.proxy.callbacks.InternalProxyMessage;
-import com.smartdevicelink.proxy.callbacks.OnProxyClosed;
-import com.smartdevicelink.proxy.callbacks.OnError;
-import com.smartdevicelink.proxy.constants.Names;
-import com.smartdevicelink.proxy.interfaces.IProxyListenerBase;
-import com.smartdevicelink.proxy.rpc.AddCommand;
-import com.smartdevicelink.proxy.rpc.AddCommandResponse;
-import com.smartdevicelink.proxy.rpc.AddSubMenu;
-import com.smartdevicelink.proxy.rpc.AddSubMenuResponse;
-import com.smartdevicelink.proxy.rpc.Alert;
-import com.smartdevicelink.proxy.rpc.AlertResponse;
-import com.smartdevicelink.proxy.rpc.ButtonCapabilities;
-import com.smartdevicelink.proxy.rpc.Choice;
-import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSet;
-import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse;
-import com.smartdevicelink.proxy.rpc.DeleteCommand;
-import com.smartdevicelink.proxy.rpc.DeleteCommandResponse;
-import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSet;
-import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSetResponse;
-import com.smartdevicelink.proxy.rpc.DeleteSubMenu;
-import com.smartdevicelink.proxy.rpc.DeleteSubMenuResponse;
-import com.smartdevicelink.proxy.rpc.DisplayCapabilities;
-import com.smartdevicelink.proxy.rpc.EncodedSyncPData;
-import com.smartdevicelink.proxy.rpc.EncodedSyncPDataResponse;
-import com.smartdevicelink.proxy.rpc.GenericResponse;
-import com.smartdevicelink.proxy.rpc.OnAppInterfaceUnregistered;
-import com.smartdevicelink.proxy.rpc.OnButtonEvent;
-import com.smartdevicelink.proxy.rpc.OnButtonPress;
-import com.smartdevicelink.proxy.rpc.OnCommand;
-import com.smartdevicelink.proxy.rpc.OnDriverDistraction;
-import com.smartdevicelink.proxy.rpc.OnEncodedSyncPData;
-import com.smartdevicelink.proxy.rpc.OnHMIStatus;
-import com.smartdevicelink.proxy.rpc.OnPermissionsChange;
-import com.smartdevicelink.proxy.rpc.OnTBTClientState;
-import com.smartdevicelink.proxy.rpc.PerformInteraction;
-import com.smartdevicelink.proxy.rpc.PerformInteractionResponse;
-import com.smartdevicelink.proxy.rpc.RegisterAppInterface;
-import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse;
-import com.smartdevicelink.proxy.rpc.ResetGlobalProperties;
-import com.smartdevicelink.proxy.rpc.ResetGlobalPropertiesResponse;
-import com.smartdevicelink.proxy.rpc.SetGlobalProperties;
-import com.smartdevicelink.proxy.rpc.SetGlobalPropertiesResponse;
-import com.smartdevicelink.proxy.rpc.SetMediaClockTimer;
-import com.smartdevicelink.proxy.rpc.SetMediaClockTimerResponse;
-import com.smartdevicelink.proxy.rpc.Show;
-import com.smartdevicelink.proxy.rpc.ShowResponse;
-import com.smartdevicelink.proxy.rpc.Speak;
-import com.smartdevicelink.proxy.rpc.SpeakResponse;
-import com.smartdevicelink.proxy.rpc.SubscribeButton;
-import com.smartdevicelink.proxy.rpc.SubscribeButtonResponse;
-import com.smartdevicelink.proxy.rpc.SyncMsgVersion;
-import com.smartdevicelink.proxy.rpc.TTSChunk;
-import com.smartdevicelink.proxy.rpc.UnregisterAppInterface;
-import com.smartdevicelink.proxy.rpc.UnregisterAppInterfaceResponse;
-import com.smartdevicelink.proxy.rpc.UnsubscribeButton;
-import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse;
-import com.smartdevicelink.proxy.rpc.enums.AudioStreamingState;
-import com.smartdevicelink.proxy.rpc.enums.ButtonName;
-import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;
-import com.smartdevicelink.proxy.rpc.enums.HMILevel;
-import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.InteractionMode;
-import com.smartdevicelink.proxy.rpc.enums.Language;
-import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;
-import com.smartdevicelink.proxy.rpc.enums.SmartDeviceLinkConnectionState;
-import com.smartdevicelink.proxy.rpc.enums.SmartDeviceLinkDisconnectedReason;
-import com.smartdevicelink.proxy.rpc.enums.SmartDeviceLinkInterfaceAvailability;
-import com.smartdevicelink.proxy.rpc.enums.SystemContext;
-import com.smartdevicelink.proxy.rpc.enums.TextAlignment;
-import com.smartdevicelink.proxy.rpc.enums.UpdateMode;
-import com.smartdevicelink.proxy.rpc.enums.VrCapabilities;
-import com.smartdevicelink.syncConnection.ISmartDeviceLinkConnectionListener;
-import com.smartdevicelink.syncConnection.SmartDeviceLinkConnection;
-import com.smartdevicelink.trace.TraceDeviceInfo;
-import com.smartdevicelink.trace.SyncTrace;
-import com.smartdevicelink.trace.enums.InterfaceActivityDirection;
-import com.smartdevicelink.transport.BTTransportConfig;
-import com.smartdevicelink.transport.BaseTransportConfig;
-import com.smartdevicelink.transport.SiphonServer;
-import com.smartdevicelink.transport.TransportType;
-import com.smartdevicelink.util.DebugTool;
-
-public abstract class SmartDeviceLinkProxyBase<proxyListenerType extends IProxyListenerBase> {
-       // Used for calls to Android Log class.
-       public static final String TAG = "SmartDeviceLinkProxy";
-       private static final String SMARTDEVICELINK_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
-       private SmartDeviceLinkConnection _SmartDeviceLinkConnection;
-       private proxyListenerType _proxyListener = null;
-       
-       // Protected Correlation IDs
-       private final int       REGISTER_APP_INTERFACE_CORRELATION_ID = 65529,
-                                               UNREGISTER_APP_INTERFACE_CORRELATION_ID = 65530;
-       
-       // SmartDeviceLinkhronization Objects
-       private static final Object CONNECTION_REFERENCE_LOCK = new Object(),
-                                                               INCOMING_MESSAGE_QUEUE_THREAD_LOCK = new Object(),
-                                                               OUTGOING_MESSAGE_QUEUE_THREAD_LOCK = new Object(),
-                                                               INTERNAL_MESSAGE_QUEUE_THREAD_LOCK = new Object(),
-                                                               APP_INTERFACE_REGISTERED_LOCK = new Object();
-       
-       // RPC Session ID
-       private byte _rpcSessionID = 0;
-       
-       // Device Info for logging
-       private TraceDeviceInfo _traceDeviceInterrogator = null;
-               
-       // Declare Queuing Threads
-       private ProxyMessageDispatcher<ProtocolMessage> _incomingProxyMessageDispatcher;
-       private ProxyMessageDispatcher<ProtocolMessage> _outgoingProxyMessageDispatcher;
-       private ProxyMessageDispatcher<InternalProxyMessage> _internalProxyMessageDispatcher;
-       
-       // Flag indicating if callbacks should be called from UIThread
-       private Boolean _callbackToUIThread = false;
-       // UI Handler
-       private Handler _mainUIHandler = null; 
-       
-       // SmartDeviceLinkProxy Advanced Lifecycle Management
-       protected Boolean _advancedLifecycleManagementEnabled = false;
-       // Parameters passed to the constructor from the app to register an app interface
-       private String _applicationName = null;
-       private String _ngnMediaScreenAppName = null;
-       private Boolean _isMediaApp = null;
-       private Language _SmartDeviceLinkLanguageDesired = null;
-       private String _autoActivateIdDesired = null;
-       private SyncMsgVersion _SyncMsgVersionRequest = null;
-       private Vector<String> _vrSynonyms = null;
-
-       private BaseTransportConfig _transportConfig = null;
-       // Proxy State Variables
-       protected Boolean _appInterfaceRegisterd = false;
-       protected Boolean _haveReceivedFirstFocusLevel = false;
-       protected Boolean _haveReceivedFirstFocusLevelFull = false;
-       protected Boolean _proxyDisposed = false;
-       protected SmartDeviceLinkConnectionState _SmartDeviceLinkConnectionState = null;
-       protected SmartDeviceLinkInterfaceAvailability _SmartDeviceLinkIntefaceAvailablity = null;
-       protected HMILevel _hmiLevel = null;
-       private HMILevel _priorHmiLevel = null;
-       protected AudioStreamingState _audioStreamingState = null;
-       private AudioStreamingState _priorAudioStreamingState = null;
-       protected SystemContext _systemContext = null;
-       // Variables set by RegisterAppInterfaceResponse
-       protected SyncMsgVersion _SyncMsgVersion = null;
-       protected String _autoActivateIdReturned = null;
-       protected Language _SmartDeviceLinkLanguage = null;
-       protected DisplayCapabilities _displayCapabilities = null;
-       protected Vector<ButtonCapabilities> _buttonCapabilities = null;
-       protected Vector<HmiZoneCapabilities> _hmiZoneCapabilities = null;
-       protected Vector<SpeechCapabilities> _speechCapabilities = null;
-       protected Vector<VrCapabilities> _vrCapabilities = null;
-       protected Boolean firstTimeFull = true;
-       
-       protected byte _protocolVersion = 1;
-       
-       // Interface broker
-       private SmartDeviceLinkInterfaceBroker _interfaceBroker = null;
-       
-       // Private Class to Interface with SmartDeviceLinkConnection
-       private class SmartDeviceLinkInterfaceBroker implements ISmartDeviceLinkConnectionListener {
-               
-               @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 SmartDeviceLinkException("Transport disconnected.", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_UNAVAILALBE));
-                       }
-               }
-
-               @Override
-               public void onTransportError(String info, Exception e) {
-                       DebugTool.logError("Transport failure: " + info, e);
-                       
-                       if (_advancedLifecycleManagementEnabled) {                      
-                               // Cycle the proxy
-                               cycleProxy(SmartDeviceLinkDisconnectedReason.TRANSPORT_ERROR);
-                       } else {
-                               notifyProxyClosed(info, e);
-                       }
-               }
-
-               @Override
-               public void onProtocolMessageReceived(ProtocolMessage msg) {
-                       try {if (msg.getData().length > 0) queueIncomingMessage(msg);}
-                       catch (Exception e) {}
-                       try {if (msg.getBulkData().length > 0) queueIncomingMessage(msg);}
-                       catch (Exception e) {}
-               }
-
-               @Override
-               public void onProtocolSessionStarted(SessionType sessionType,
-                               byte sessionID, byte version, String correlationID) {
-                       if (_protocolVersion == 1) {
-                               if (version == 2) setProtocolVersion(version);
-                       }
-                       if (sessionType.eq(SessionType.RPC)) {                  
-                               startRPCProtocolSession(sessionID, correlationID);
-                       } else if (_protocolVersion == 2) {
-                               //If version 2 then don't need to specify a Session Type
-                               startRPCProtocolSession(sessionID, correlationID);
-                       }  else {
-                               // Handle other protocol session types here
-                       }
-               }
-
-               @Override
-               public void onProtocolSessionEnded(SessionType sessionType,
-                               byte sessionID, String correlationID) {
-                       // How to handle protocol session ended?
-                               // How should protocol session management occur? 
-               }
-
-               @Override
-               public void onProtocolError(String info, Exception e) {
-                       passErrorToProxyListener(info, e);
-               }
-       }
-
-       protected SmartDeviceLinkProxyBase(proxyListenerType listener, SmartDeviceLinkProxyConfigurationResources SmartDeviceLinkProxyConfigurationResources, 
-                       boolean enableAdvancedLifecycleManagement, String appName, String ngnMediaScreenAppName, 
-                       Vector<String> vrSynonyms, Boolean isMediaApp, SyncMsgVersion SyncMsgVersion, 
-                       Language languageDesired, String autoActivateID, boolean callbackToUIThread,
-                       BaseTransportConfig transportConfig) 
-                       throws SmartDeviceLinkException {
-               
-               _interfaceBroker = new SmartDeviceLinkInterfaceBroker();
-               
-               _callbackToUIThread = callbackToUIThread;
-               
-               if (_callbackToUIThread) {
-                       _mainUIHandler = new Handler(Looper.getMainLooper());
-               }
-               
-               // Set variables for Advanced Lifecycle Management
-               _advancedLifecycleManagementEnabled = enableAdvancedLifecycleManagement;
-               _applicationName = appName;
-               _ngnMediaScreenAppName = ngnMediaScreenAppName;
-               _isMediaApp = isMediaApp;
-               _SyncMsgVersionRequest = SyncMsgVersion;
-               _vrSynonyms = vrSynonyms; 
-               _SmartDeviceLinkLanguageDesired = languageDesired;
-               _autoActivateIdDesired = autoActivateID;
-               _transportConfig = transportConfig;
-               
-               // Test conditions to invalidate the proxy
-               if (listener == null) {
-                       throw new IllegalArgumentException("IProxyListener listener must be provided to instantiate SmartDeviceLinkProxy object.");
-               }
-               if (_advancedLifecycleManagementEnabled) {
-                       if (_applicationName == null ) {
-                               throw new IllegalArgumentException("To use SmartDeviceLinkProxyALM, 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 SmartDeviceLinkProxyALM.");
-                       }
-               }
-               
-               _proxyListener = listener;
-               
-               // Get information from SmartDeviceLinkProxyConfigurationResources
-               TelephonyManager telephonyManager = null;
-               if (SmartDeviceLinkProxyConfigurationResources != null) {
-                       telephonyManager = SmartDeviceLinkProxyConfigurationResources.getTelephonyManager();
-               } 
-               
-               // Use the telephonyManager to get and log phone info
-               if (telephonyManager != null) {
-                       // Following is not quite thread-safe (because m_traceLogger could test null twice),
-                       // so we need to fix this, but vulnerability (i.e. two instances of listener) is
-                       // likely harmless.
-                       if (_traceDeviceInterrogator == null) {
-                               _traceDeviceInterrogator = new TraceDeviceInfo(SmartDeviceLinkProxyConfigurationResources.getTelephonyManager());
-                       } // end-if
-               } // end-if
-               
-               // Setup Internal ProxyMessage Dispatcher
-               synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {
-                       // Ensure internalProxyMessageDispatcher is null
-                       if (_internalProxyMessageDispatcher != null) {
-                               _internalProxyMessageDispatcher.dispose();
-                               _internalProxyMessageDispatcher = null;
-                       }
-                       
-                       _internalProxyMessageDispatcher = new ProxyMessageDispatcher<InternalProxyMessage>("INTERNAL_MESSAGE_DISPATCHER",
-                                       new InternalProxyMessageComparitor(),
-                                       new IDispatchingStrategy<InternalProxyMessage>() {
-
-                                               @Override
-                                               public void dispatch(InternalProxyMessage message) {
-                                                       dispatchInternalMessage((InternalProxyMessage)message);
-                                               }
-       
-                                               @Override
-                                               public void handleDispatchingError(String info, Exception ex) {
-                                                       handleErrorsFromInternalMessageDispatcher(info, ex);
-                                               }
-       
-                                               @Override
-                                               public void handleQueueingError(String info, Exception ex) {
-                                                       handleErrorsFromInternalMessageDispatcher(info, ex);
-                                               }                       
-                       });
-               }
-               
-               // Setup Incoming ProxyMessage Dispatcher
-               synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {
-                       // Ensure incomingProxyMessageDispatcher is null
-                       if (_incomingProxyMessageDispatcher != null) {
-                               _incomingProxyMessageDispatcher.dispose();
-                               _incomingProxyMessageDispatcher = null;
-                       }
-                       
-                       _incomingProxyMessageDispatcher = new ProxyMessageDispatcher<ProtocolMessage>("INCOMING_MESSAGE_DISPATCHER",
-                                       new 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);
-                                               }                       
-                       });
-               }
-               
-               // 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((ProtocolMessage)message);
-                                               }
-       
-                                               @Override
-                                               public void handleDispatchingError(String info, Exception ex) {
-                                                       handleErrorsFromOutgoingMessageDispatcher(info, ex);
-                                               }
-       
-                                               @Override
-                                               public void handleQueueingError(String info, Exception ex) {
-                                                       handleErrorsFromOutgoingMessageDispatcher(info, ex);
-                                               }
-                       });
-               }
-               
-               // Initialize the proxy
-               try {
-                       initializeProxy();
-               } catch (SmartDeviceLinkException e) {
-                       // Couldn't initialize the proxy 
-                       // Dispose threads and then rethrow exception
-                       
-                       if (_internalProxyMessageDispatcher != null) {
-                               _internalProxyMessageDispatcher.dispose();
-                               _internalProxyMessageDispatcher = null;
-                       }
-                       if (_incomingProxyMessageDispatcher != null) {
-                               _incomingProxyMessageDispatcher.dispose();
-                               _incomingProxyMessageDispatcher = null;
-                       }
-                       if (_outgoingProxyMessageDispatcher != null) {
-                               _outgoingProxyMessageDispatcher.dispose();
-                               _outgoingProxyMessageDispatcher = null;
-                       }
-                       throw e;
-               } 
-               
-               // Trace that ctor has fired
-               SyncTrace.logProxyEvent("SmartDeviceLinkProxy Created, instanceID=" + this.toString(), SMARTDEVICELINK_LIB_TRACE_KEY);
-       }
-       
-       protected SmartDeviceLinkProxyBase(proxyListenerType listener, SmartDeviceLinkProxyConfigurationResources SmartDeviceLinkProxyConfigurationResources, 
-                       boolean enableAdvancedLifecycleManagement, String appName, String ngnMediaScreenAppName, 
-                       Vector<String> vrSynonyms, Boolean isMediaApp, SyncMsgVersion SyncMsgVersion, 
-                       Language languageDesired, String autoActivateID, boolean callbackToUIThread) 
-                       throws SmartDeviceLinkException {
-               
-               _interfaceBroker = new SmartDeviceLinkInterfaceBroker();
-               
-               _callbackToUIThread = callbackToUIThread;
-               
-               if (_callbackToUIThread) {
-                       _mainUIHandler = new Handler(Looper.getMainLooper());
-               }
-               
-               // Set variables for Advanced Lifecycle Management
-               _advancedLifecycleManagementEnabled = enableAdvancedLifecycleManagement;
-               _applicationName = appName;
-               _ngnMediaScreenAppName = ngnMediaScreenAppName;
-               _isMediaApp = isMediaApp;
-               _SyncMsgVersionRequest = SyncMsgVersion;
-               _vrSynonyms = vrSynonyms; 
-               _SmartDeviceLinkLanguageDesired = languageDesired;
-               _autoActivateIdDesired = autoActivateID;
-               _transportConfig = new BTTransportConfig();
-               
-               // Test conditions to invalidate the proxy
-               if (listener == null) {
-                       throw new IllegalArgumentException("IProxyListener listener must be provided to instantiate SmartDeviceLinkProxy object.");
-               }
-               if (_advancedLifecycleManagementEnabled) {
-                       if (_applicationName == null ) {
-                               throw new IllegalArgumentException("To use SmartDeviceLinkProxyALM, 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 SmartDeviceLinkProxyALM.");
-                       }
-               }
-               
-               _proxyListener = listener;
-               
-               // Get information from SmartDeviceLinkProxyConfigurationResources
-               TelephonyManager telephonyManager = null;
-               if (SmartDeviceLinkProxyConfigurationResources != null) {
-                       telephonyManager = SmartDeviceLinkProxyConfigurationResources.getTelephonyManager();
-               } 
-               
-               // Use the telephonyManager to get and log phone info
-               if (telephonyManager != null) {
-                       // Following is not quite thread-safe (because m_traceLogger could test null twice),
-                       // so we need to fix this, but vulnerability (i.e. two instances of listener) is
-                       // likely harmless.
-                       if (_traceDeviceInterrogator == null) {
-                               _traceDeviceInterrogator = new TraceDeviceInfo(SmartDeviceLinkProxyConfigurationResources.getTelephonyManager());
-                       } // end-if
-               } // end-if
-               
-               // Setup Internal ProxyMessage Dispatcher
-               synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {
-                       // Ensure internalProxyMessageDispatcher is null
-                       if (_internalProxyMessageDispatcher != null) {
-                               _internalProxyMessageDispatcher.dispose();
-                               _internalProxyMessageDispatcher = null;
-                       }
-                       
-                       _internalProxyMessageDispatcher = new ProxyMessageDispatcher<InternalProxyMessage>("INTERNAL_MESSAGE_DISPATCHER",
-                                       new InternalProxyMessageComparitor(),
-                                       new IDispatchingStrategy<InternalProxyMessage>() {
-
-                                               @Override
-                                               public void dispatch(InternalProxyMessage message) {
-                                                       dispatchInternalMessage((InternalProxyMessage)message);
-                                               }
-       
-                                               @Override
-                                               public void handleDispatchingError(String info, Exception ex) {
-                                                       handleErrorsFromInternalMessageDispatcher(info, ex);
-                                               }
-       
-                                               @Override
-                                               public void handleQueueingError(String info, Exception ex) {
-                                                       handleErrorsFromInternalMessageDispatcher(info, ex);
-                                               }                       
-                       });
-               }
-               
-               // Setup Incoming ProxyMessage Dispatcher
-               synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {
-                       // Ensure incomingProxyMessageDispatcher is null
-                       if (_incomingProxyMessageDispatcher != null) {
-                               _incomingProxyMessageDispatcher.dispose();
-                               _incomingProxyMessageDispatcher = null;
-                       }
-                       
-                       _incomingProxyMessageDispatcher = new ProxyMessageDispatcher<ProtocolMessage>("INCOMING_MESSAGE_DISPATCHER",
-                                       new 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);
-                                               }                       
-                       });
-               }
-               
-               // 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((ProtocolMessage)message);
-                                               }
-       
-                                               @Override
-                                               public void handleDispatchingError(String info, Exception ex) {
-                                                       handleErrorsFromOutgoingMessageDispatcher(info, ex);
-                                               }
-       
-                                               @Override
-                                               public void handleQueueingError(String info, Exception ex) {
-                                                       handleErrorsFromOutgoingMessageDispatcher(info, ex);
-                                               }
-                       });
-               }
-               
-               // Initialize the proxy
-               try {
-                       initializeProxy();
-               } catch (SmartDeviceLinkException e) {
-                       // Couldn't initialize the proxy 
-                       // Dispose threads and then rethrow exception
-                       
-                       if (_internalProxyMessageDispatcher != null) {
-                               _internalProxyMessageDispatcher.dispose();
-                               _internalProxyMessageDispatcher = null;
-                       }
-                       if (_incomingProxyMessageDispatcher != null) {
-                               _incomingProxyMessageDispatcher.dispose();
-                               _incomingProxyMessageDispatcher = null;
-                       }
-                       if (_outgoingProxyMessageDispatcher != null) {
-                               _outgoingProxyMessageDispatcher.dispose();
-                               _outgoingProxyMessageDispatcher = null;
-                       }
-                       throw e;
-               } 
-               
-               // Trace that ctor has fired
-               SyncTrace.logProxyEvent("SmartDeviceLinkProxy Created, instanceID=" + this.toString(), SMARTDEVICELINK_LIB_TRACE_KEY);
-       }
-
-       // Test correlationID
-       private boolean isCorrelationIDProtected(Integer correlationID) {
-               if (correlationID != null && 
-                               (REGISTER_APP_INTERFACE_CORRELATION_ID == correlationID
-                                               || UNREGISTER_APP_INTERFACE_CORRELATION_ID == correlationID)) {
-                       return true;
-               }
-               
-               return false;
-       }
-       
-       // Protected isConnected method to allow legacy proxy to poll isConnected state
-       public Boolean getIsConnected() {
-               return _SmartDeviceLinkConnection.getIsConnected();
-       }
-       
-       
-       // Function to initialize new proxy connection
-       private void initializeProxy() throws SmartDeviceLinkException {                
-               // Reset all of the flags and state variables
-               _haveReceivedFirstFocusLevel = false;
-               _haveReceivedFirstFocusLevelFull = false;
-               _SmartDeviceLinkIntefaceAvailablity = SmartDeviceLinkInterfaceAvailability.SMARTDEVICELINK_INTERFACE_UNAVAILABLE;
-               
-               // Setup SmartDeviceLinkConnection
-               synchronized(CONNECTION_REFERENCE_LOCK) {
-                       if (_SmartDeviceLinkConnection != null) {
-                               _SmartDeviceLinkConnection.closeConnection(_rpcSessionID);
-                               _SmartDeviceLinkConnection = null;
-                       }
-                       _SmartDeviceLinkConnection = new SmartDeviceLinkConnection(_interfaceBroker, _transportConfig);
-               }
-               
-               synchronized(CONNECTION_REFERENCE_LOCK) {
-                       if (_SmartDeviceLinkConnection != null) {
-                               _SmartDeviceLinkConnection.startTransport();
-                       }
-               }
-       }
-       
-       // 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();
-       }       
-
-       @Deprecated
-       public void close() throws SmartDeviceLinkException {
-               dispose();
-       }
-       
-       private void cleanProxy(SmartDeviceLinkDisconnectedReason disconnectedReason) throws SmartDeviceLinkException {
-               try {
-                       
-                       // ALM Specific Cleanup
-                       if (_advancedLifecycleManagementEnabled) {
-                               _SmartDeviceLinkConnectionState = SmartDeviceLinkConnectionState.SMARTDEVICELINK_DISCONNECTED;
-                               
-                               firstTimeFull = true;
-                       
-                               // Should we wait for the interface to be unregistered?
-                               Boolean waitForInterfaceUnregistered = false;
-                               // Unregister app interface
-                               synchronized(CONNECTION_REFERENCE_LOCK) {
-                                       if (_appInterfaceRegisterd == true && _SmartDeviceLinkConnection != null && _SmartDeviceLinkConnection.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 SmartDeviceLink Connection
-                       synchronized(CONNECTION_REFERENCE_LOCK) {
-                               if (_SmartDeviceLinkConnection != null) {
-                                       _SmartDeviceLinkConnection.closeConnection(_rpcSessionID);
-                                       _SmartDeviceLinkConnection = null;
-                               }
-                       }
-               } catch (SmartDeviceLinkException e) {
-                       throw e;
-               } finally {
-                       SyncTrace.logProxyEvent("SmartDeviceLinkProxy cleaned.", SMARTDEVICELINK_LIB_TRACE_KEY);
-               }
-       }
-       
-       /**
-        * Terminates the App's Interface Registration, closes the transport connection, ends the protocol session, and frees any resources used by the proxy.
-        */
-       public void dispose() throws SmartDeviceLinkException
-       {               
-               if (_proxyDisposed) {
-                       throw new SmartDeviceLinkException("This object has been disposed, it is no long capable of executing methods.", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_PROXY_DISPOSED);
-               }
-               
-               _proxyDisposed = true;
-               
-               SyncTrace.logProxyEvent("Application called dispose() method.", SMARTDEVICELINK_LIB_TRACE_KEY);
-               
-               try{
-                       // Clean the proxy
-                       cleanProxy(SmartDeviceLinkDisconnectedReason.APPLICATION_REQUESTED_DISCONNECT);
-               
-                       // Close IncomingProxyMessageDispatcher thread
-                       synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {
-                               if (_incomingProxyMessageDispatcher != null) {
-                                       _incomingProxyMessageDispatcher.dispose();
-                                       _incomingProxyMessageDispatcher = null;
-                               }
-                       }
-                       
-                       // Close OutgoingProxyMessageDispatcher thread
-                       synchronized(OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) {
-                               if (_outgoingProxyMessageDispatcher != null) {
-                                       _outgoingProxyMessageDispatcher.dispose();
-                                       _outgoingProxyMessageDispatcher = null;
-                               }
-                       }
-                       
-                       // Close InternalProxyMessageDispatcher thread
-                       synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {
-                               if (_internalProxyMessageDispatcher != null) {
-                                       _internalProxyMessageDispatcher.dispose();
-                                       _internalProxyMessageDispatcher = null;
-                               }
-                       }
-                       
-                       _traceDeviceInterrogator = null;
-               } catch (SmartDeviceLinkException e) {
-                       throw e;
-               } finally {
-                       SyncTrace.logProxyEvent("SmartDeviceLinkProxy disposed.", SMARTDEVICELINK_LIB_TRACE_KEY);
-               }
-       } // end-method
-
-       // Method to cycle the proxy, only called in ALM
-       protected void cycleProxy(SmartDeviceLinkDisconnectedReason disconnectedReason) {               
-               try{
-                       cleanProxy(disconnectedReason);
-                       initializeProxy();      
-                       notifyProxyClosed("SmartDeviceLink Proxy Cycled", new SmartDeviceLinkException("SmartDeviceLink Proxy Cycled", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_PROXY_CYCLED));
-               } catch (SmartDeviceLinkException e) {
-                       switch(e.getSmartDeviceLinkExceptionCause()) {
-                       case BLUETOOTH_DISABLED:
-                               notifyProxyClosed("Bluetooth is disabled. Bluetooth must be enabled to connect to SmartDeviceLink. Reattempt a connection once Bluetooth is enabled.", 
-                                               new SmartDeviceLinkException("Bluetooth is disabled. Bluetooth must be enabled to connect to SmartDeviceLink. Reattempt a connection once Bluetooth is enabled.", SmartDeviceLinkExceptionCause.BLUETOOTH_DISABLED));
-                               break;
-                       case BLUETOOTH_ADAPTER_NULL:
-                               notifyProxyClosed("Cannot locate a Bluetooth adapater. A SmartDeviceLink connection is impossible on this device until a Bluetooth adapter is added.", 
-                                               new SmartDeviceLinkException("Cannot locate a Bluetooth adapater. A SmartDeviceLink connection is impossible on this device until a Bluetooth adapter is added.", SmartDeviceLinkExceptionCause.HEARTBEAT_PAST_DUE));
-                               break;
-                       default :
-                               notifyProxyClosed("Cycling the proxy failed.", e);
-                               break;
-                       }
-               } catch (Exception e) { 
-                       notifyProxyClosed("Cycling the proxy failed.", e);
-               }
-       }
-
-       
-       
-       /************* Functions used by the Message Dispatching Queues ****************/
-       private void dispatchIncomingMessage(ProtocolMessage message) {
-               try{
-                       // Dispatching logic
-                       if (message.getSessionType().equals(SessionType.RPC)) {
-                               try {
-                                       if (_protocolVersion == 1) {
-                                               if (message.getVersion() == 2) setProtocolVersion(message.getVersion());
-                                       }
-                                       
-                                       Hashtable hash = new Hashtable();
-                                       if (_protocolVersion == 2) {
-                                               Hashtable hashTemp = new Hashtable();
-                                               hashTemp.put(Names.correlationID, message.getCorrID());
-                                               if (message.getJsonSize() > 0) {
-                                                       final Hashtable<String, Object> mhash = JsonRPCMarshaller.unmarshall(message.getData());
-                                                       hashTemp.put(Names.parameters, mhash);
-                                               }
-                                               FunctionID functionID = new FunctionID();
-                                               hashTemp.put(Names.function_name, functionID.getFunctionName(message.getFunctionID()));
-                                               if (message.getRPCType() == 0x00) {
-                                                       hash.put(Names.request, hashTemp);
-                                               } else if (message.getRPCType() == 0x01) {
-                                                       hash.put(Names.response, hashTemp);
-                                               } else if (message.getRPCType() == 0x02) {
-                                                       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);
-               }
-       }
-       
-       private void setProtocolVersion(byte version) {
-               this._protocolVersion = version;
-       }
-
-       private void handleErrorsFromIncomingMessageDispatcher(String info, Exception e) {
-               passErrorToProxyListener(info, e);
-       }
-       
-       private void dispatchOutgoingMessage(ProtocolMessage message) {
-               synchronized(CONNECTION_REFERENCE_LOCK) {
-                       if (_SmartDeviceLinkConnection != null) {
-                               _SmartDeviceLinkConnection.sendMessage(message);
-                       }
-               }               
-               SyncTrace.logProxyEvent("SmartDeviceLinkProxy sending Protocol Message: " + message.toString(), SMARTDEVICELINK_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.getException());
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onError(msg.getInfo(), msg.getException());
-                               }
-                       /**************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 SmartDeviceLink Proxy.", SMARTDEVICELINK_LIB_TRACE_KEY);
-                               DebugTool.logError("Unknown RPC Message encountered. Check for an updated version of the SmartDeviceLink Proxy.");
-                       }
-                       
-               SyncTrace.logProxyEvent("Proxy fired callback: " + message.getFunctionName(), SMARTDEVICELINK_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 aSmartDeviceLinkhronously,
-               // 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. 
-       private void sendRPCRequestPrivate(RPCRequest request) throws SmartDeviceLinkException {
-               SyncTrace.logRPCEvent(InterfaceActivityDirection.Transmit, request, SMARTDEVICELINK_LIB_TRACE_KEY);
-               
-               byte[] msgBytes = JsonRPCMarshaller.marshall(request, _protocolVersion);
-               
-               ProtocolMessage pm = new ProtocolMessage();
-               pm.setData(msgBytes);
-               pm.setSessionID(_rpcSessionID);
-               pm.setMessageType(MessageType.RPC);
-               pm.setSessionType(SessionType.RPC);
-               FunctionID functionID = new FunctionID();
-               pm.setFunctionID(functionID.getFunctionID(request.getFunctionName()));
-               pm.setCorrID(request.getCorrelationID());
-               
-               // Queue this outgoing message
-               synchronized(OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) {
-                       if (_outgoingProxyMessageDispatcher != null) {
-                               _outgoingProxyMessageDispatcher.queueMessage(pm);
-                       }
-               }
-       }
-       
-       private void handleRPCMessage(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), SMARTDEVICELINK_LIB_TRACE_KEY);
-
-                       // Check to ensure response is not from an internal message (reserved correlation ID)
-                       if (isCorrelationIDProtected((new RPCResponse(hash)).getCorrelationID())) {
-                               // This is a response generated from an internal message, it can be trapped here
-                               // The app should not receive a response for a request it did not send
-                               if ((new RPCResponse(hash)).getCorrelationID() == REGISTER_APP_INTERFACE_CORRELATION_ID 
-                                               && _advancedLifecycleManagementEnabled 
-                                               && functionName.equals(Names.RegisterAppInterface)) {
-                                       final RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse(hash);
-                                       if (msg.getSuccess()) {
-                                               _appInterfaceRegisterd = true;
-                                       }
-                                       
-                                       _autoActivateIdReturned = msg.getAutoActivateID();
-                                       _buttonCapabilities = msg.getButtonCapabilities();
-                                       _displayCapabilities = msg.getDisplayCapabilities();
-                                       _hmiZoneCapabilities = msg.getHmiZoneCapabilities();
-                                       _speechCapabilities = msg.getSpeechCapabilities();
-                                       _SmartDeviceLinkLanguage = msg.getLanguage();
-                                       _SyncMsgVersion = msg.getSyncMsgVersion();
-                                       _vrCapabilities = msg.getVrCapabilities();
-                                       
-                                       // Send onSmartDeviceLinkConnected message in ALM
-                                       _SmartDeviceLinkConnectionState = SmartDeviceLinkConnectionState.SMARTDEVICELINK_CONNECTED;
-                                       
-                                       // If registerAppInterface failed, exit with OnProxyUnusable
-                                       if (!msg.getSuccess()) {
-                                               notifyProxyClosed("Unable to register app interface. Review values passed to the SmartDeviceLinkProxy constructor. RegisterAppInterface result code: ", 
-                                                               new SmartDeviceLinkException("Unable to register app interface. Review values passed to the SmartDeviceLinkProxy constructor. RegisterAppInterface result code: " + msg.getResultCode(), SmartDeviceLinkExceptionCause.SMARTDEVICELINK_REGISTRATION_ERROR));
-                                       }
-                               }
-                               return;
-                       }
-                       
-                       if (functionName.equals(Names.RegisterAppInterface)) {
-                               final RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse(hash);
-                               if (msg.getSuccess()) {
-                                       _appInterfaceRegisterd = true;
-                               }
-                               
-                               _autoActivateIdReturned = msg.getAutoActivateID();
-                               _buttonCapabilities = msg.getButtonCapabilities();
-                               _displayCapabilities = msg.getDisplayCapabilities();
-                               _hmiZoneCapabilities = msg.getHmiZoneCapabilities();
-                               _speechCapabilities = msg.getSpeechCapabilities();
-                               _SmartDeviceLinkLanguage = msg.getLanguage();
-                               _SyncMsgVersion = msg.getSyncMsgVersion();
-                               _vrCapabilities = msg.getVrCapabilities();
-                               
-                               // RegisterAppInterface
-                               if (_advancedLifecycleManagementEnabled) {
-                                       
-                                       // Send onSmartDeviceLinkConnected message in ALM
-                                       _SmartDeviceLinkConnectionState = SmartDeviceLinkConnectionState.SMARTDEVICELINK_CONNECTED;
-                                       
-                                       // If registerAppInterface failed, exit with OnProxyUnusable
-                                       if (!msg.getSuccess()) {
-                                               notifyProxyClosed("Unable to register app interface. Review values passed to the SmartDeviceLinkProxy constructor. RegisterAppInterface result code: ", 
-                                                               new SmartDeviceLinkException("Unable to register app interface. Review values passed to the SmartDeviceLinkProxy constructor. RegisterAppInterface result code: " + msg.getResultCode(), SmartDeviceLinkExceptionCause.SMARTDEVICELINK_REGISTRATION_ERROR));
-                                       }
-                               } else {        
-                                       if (_callbackToUIThread) {
-                                               // Run in UI thread
-                                               _mainUIHandler.post(new Runnable() {
-                                                       @Override
-                                                       public void run() {
-                                                               ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);
-                                                       }
-                                               });
-                                       } else {
-                                               ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);                                                   
-                                       }
-                               }
-                       } else if (functionName.equals(Names.Speak)) {
-                               // SpeakResponse
-                               
-                               final SpeakResponse msg = new SpeakResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onSpeakResponse(msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onSpeakResponse(msg);                                            
-                               }
-                       } else if (functionName.equals(Names.Alert)) {
-                               // AlertResponse
-                               
-                               final AlertResponse msg = new AlertResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onAlertResponse(msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onAlertResponse(msg);                                            
-                               }
-                       } else if (functionName.equals(Names.Show)) {
-                               // ShowResponse
-                               
-                               final ShowResponse msg = new ShowResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onShowResponse((ShowResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onShowResponse((ShowResponse)msg);                                               
-                               }
-                       } else if (functionName.equals(Names.AddCommand)) {
-                               // AddCommand
-                               
-                               final AddCommandResponse msg = new AddCommandResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onAddCommandResponse((AddCommandResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onAddCommandResponse((AddCommandResponse)msg);                                   
-                               }
-                       } else if (functionName.equals(Names.DeleteCommand)) {
-                               // DeleteCommandResponse
-                               
-                               final DeleteCommandResponse msg = new DeleteCommandResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onDeleteCommandResponse((DeleteCommandResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onDeleteCommandResponse((DeleteCommandResponse)msg);                                     
-                               }
-                       } else if (functionName.equals(Names.AddSubMenu)) {
-                               // AddSubMenu
-                               
-                               final AddSubMenuResponse msg = new AddSubMenuResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onAddSubMenuResponse((AddSubMenuResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onAddSubMenuResponse((AddSubMenuResponse)msg);                                   
-                               }
-                       } else if (functionName.equals(Names.DeleteSubMenu)) {
-                               // DeleteSubMenu
-                               
-                               final DeleteSubMenuResponse msg = new DeleteSubMenuResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onDeleteSubMenuResponse((DeleteSubMenuResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onDeleteSubMenuResponse((DeleteSubMenuResponse)msg);                                     
-                               }
-                       } else if (functionName.equals(Names.SubscribeButton)) {
-                               // SubscribeButton
-                               
-                               final SubscribeButtonResponse msg = new SubscribeButtonResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onSubscribeButtonResponse((SubscribeButtonResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onSubscribeButtonResponse((SubscribeButtonResponse)msg);                         
-                               }
-                       } else if (functionName.equals(Names.UnsubscribeButton)) {
-                               // UnsubscribeButton
-                               
-                               final UnsubscribeButtonResponse msg = new UnsubscribeButtonResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onUnsubscribeButtonResponse((UnsubscribeButtonResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onUnsubscribeButtonResponse((UnsubscribeButtonResponse)msg);                     
-                               }
-                       } else if (functionName.equals(Names.SetMediaClockTimer)) {
-                               // SetMediaClockTimer
-                               
-                               final SetMediaClockTimerResponse msg = new SetMediaClockTimerResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onSetMediaClockTimerResponse((SetMediaClockTimerResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onSetMediaClockTimerResponse((SetMediaClockTimerResponse)msg);           
-                               }
-                       } else if (functionName.equals(Names.EncodedSyncPData)) {
-                               // EncodedSyncPData
-                               
-                               final EncodedSyncPDataResponse msg = new EncodedSyncPDataResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onEncodedSyncPDataResponse(msg); 
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onEncodedSyncPDataResponse(msg);                 
-                               }
-                       } else if (functionName.equals(Names.CreateInteractionChoiceSet)) {
-                               // CreateInteractionChoiceSet
-                               
-                               final CreateInteractionChoiceSetResponse msg = new CreateInteractionChoiceSetResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onCreateInteractionChoiceSetResponse((CreateInteractionChoiceSetResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onCreateInteractionChoiceSetResponse((CreateInteractionChoiceSetResponse)msg);           
-                               }
-                       } else if (functionName.equals(Names.DeleteInteractionChoiceSet)) {
-                               // DeleteInteractionChoiceSet
-                               
-                               final DeleteInteractionChoiceSetResponse msg = new DeleteInteractionChoiceSetResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onDeleteInteractionChoiceSetResponse((DeleteInteractionChoiceSetResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onDeleteInteractionChoiceSetResponse((DeleteInteractionChoiceSetResponse)msg);           
-                               }
-                       } else if (functionName.equals(Names.PerformInteraction)) {
-                               // PerformInteraction
-                               
-                               final PerformInteractionResponse msg = new PerformInteractionResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onPerformInteractionResponse((PerformInteractionResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onPerformInteractionResponse((PerformInteractionResponse)msg);           
-                               }
-                       } else if (functionName.equals(Names.SetGlobalProperties)) {
-                               // SetGlobalPropertiesResponse (can also be Heartbeat)
-                               
-                               final SetGlobalPropertiesResponse msg = new SetGlobalPropertiesResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onSetGlobalPropertiesResponse((SetGlobalPropertiesResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onSetGlobalPropertiesResponse((SetGlobalPropertiesResponse)msg);         
-                               }
-                       } else if (functionName.equals(Names.ResetGlobalProperties)) {
-                               // ResetGlobalProperties                                
-                               
-                               final ResetGlobalPropertiesResponse msg = new ResetGlobalPropertiesResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onResetGlobalPropertiesResponse((ResetGlobalPropertiesResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onResetGlobalPropertiesResponse((ResetGlobalPropertiesResponse)msg);             
-                               }
-                       } else if (functionName.equals(Names.UnregisterAppInterface)) {
-                               // 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() {
-                                                       ((IProxyListener)_proxyListener).onUnregisterAppInterfaceResponse(msg);
-                                               }
-                                       });
-                               } else {
-                                       ((IProxyListener)_proxyListener).onUnregisterAppInterfaceResponse(msg); 
-                               }
-                               
-                               notifyProxyClosed("UnregisterAppInterfaceResponse", null);
-                       } else if (functionName.equals(Names.GenericResponse)) {
-                               // GenericResponse (Usually and error)
-                               final GenericResponse msg = new GenericResponse(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onGenericResponse((GenericResponse)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onGenericResponse((GenericResponse)msg); 
-                               }
-                       } else {
-                               if (_SyncMsgVersion != null) {
-                                       DebugTool.logError("Unrecognized response Message: " + functionName.toString() + 
-                                                       "SmartDeviceLink Message Version = " + _SyncMsgVersion);
-                               } else {
-                                       DebugTool.logError("Unrecognized response Message: " + functionName.toString());
-                               }
-                       } // end-if
-               } else if (messageType.equals(Names.notification)) {
-                       SyncTrace.logRPCEvent(InterfaceActivityDirection.Receive, new RPCNotification(rpcMsg), SMARTDEVICELINK_LIB_TRACE_KEY);
-                       if (functionName.equals(Names.OnHMIStatus)) {
-                               // OnHMIStatus
-                               
-                               final OnHMIStatus msg = new OnHMIStatus(hash);
-                               msg.setFirstRun(new Boolean(firstTimeFull));
-                               if (msg.getHmiLevel() == HMILevel.HMI_FULL) firstTimeFull = false;
-                               
-                               if (msg.getHmiLevel() != _priorHmiLevel && msg.getAudioStreamingState() != _priorAudioStreamingState) {
-                                       if (_callbackToUIThread) {
-                                               // Run in UI thread
-                                               _mainUIHandler.post(new Runnable() {
-                                                       @Override
-                                                       public void run() {
-                                                               _proxyListener.onOnHMIStatus((OnHMIStatus)msg);
-                                                       }
-                                               });
-                                       } else {
-                                               _proxyListener.onOnHMIStatus((OnHMIStatus)msg);
-                                       }
-                               }
-                       } else if (functionName.equals(Names.OnCommand)) {
-                               // OnCommand
-                               
-                               final OnCommand msg = new OnCommand(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onOnCommand((OnCommand)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onOnCommand((OnCommand)msg);
-                               }
-                       } else if (functionName.equals(Names.OnDriverDistraction)) {
-                               // OnDriverDistration
-                               
-                               final OnDriverDistraction msg = new OnDriverDistraction(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onOnDriverDistraction(msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onOnDriverDistraction(msg);
-                               }
-                       } else if (functionName.equals(Names.OnEncodedSyncPData)) {
-                               // OnEncodedSyncPData
-                               
-                               final OnEncodedSyncPData msg = new OnEncodedSyncPData(hash);
-                                       
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onOnEncodedSyncPData(msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onOnEncodedSyncPData(msg);
-                               }
-                       } else if (functionName.equals(Names.OnPermissionsChange)) {
-                               //OnPermissionsChange
-                               
-                               final OnPermissionsChange msg = new OnPermissionsChange(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onOnPermissionsChange(msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onOnPermissionsChange(msg);
-                               }
-                       } else if (functionName.equals(Names.OnTBTClientState)) {
-                               // OnTBTClientState
-                               
-                               final OnTBTClientState msg = new OnTBTClientState(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onOnTBTClientState(msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onOnTBTClientState(msg);
-                               }
-                       } else if (functionName.equals(Names.OnButtonPress)) {
-                               // OnButtonPress
-                               
-                               final OnButtonPress msg = new OnButtonPress(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onOnButtonPress((OnButtonPress)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onOnButtonPress((OnButtonPress)msg);
-                               }
-                       } else if (functionName.equals(Names.OnButtonEvent)) {
-                               // OnButtonEvent
-                               
-                               final OnButtonEvent msg = new OnButtonEvent(hash);
-                               if (_callbackToUIThread) {
-                                       // Run in UI thread
-                                       _mainUIHandler.post(new Runnable() {
-                                               @Override
-                                               public void run() {
-                                                       _proxyListener.onOnButtonEvent((OnButtonEvent)msg);
-                                               }
-                                       });
-                               } else {
-                                       _proxyListener.onOnButtonEvent((OnButtonEvent)msg);
-                               }
-                       } else if (functionName.equals(Names.OnAppInterfaceUnregistered)) {
-                               // OnAppInterfaceUnregistered
-                               
-                               _appInterfaceRegisterd = false;
-                               synchronized(APP_INTERFACE_REGISTERED_LOCK) {
-                                       APP_INTERFACE_REGISTERED_LOCK.notify();
-                               }
-                               
-                               final OnAppInterfaceUnregistered msg = new OnAppInterfaceUnregistered(hash);
-                                                               
-                               if (_advancedLifecycleManagementEnabled) {
-                                       // This requires the proxy to be cycled
-                                       cycleProxy(SmartDeviceLinkDisconnectedReason.convertAppInterfaceUnregisteredReason(msg.getReason()));
-                               } else {
-                                       if (_callbackToUIThread) {
-                                               // Run in UI thread
-                                               _mainUIHandler.post(new Runnable() {
-                                                       @Override
-                                                       public void run() {
-                                                               ((IProxyListener)_proxyListener).onOnAppInterfaceUnregistered(msg);
-                                                       }
-                                               });
-                                       } else {
-                                               ((IProxyListener)_proxyListener).onOnAppInterfaceUnregistered(msg);
-                                       }
-                                       
-                                       notifyProxyClosed("OnAppInterfaceUnregistered", null);
-                               }
-                       }
-                       else {
-                               if (_SyncMsgVersion != null) {
-                                       DebugTool.logInfo("Unrecognized notification Message: " + functionName.toString() + 
-                                                       " connected to SmartDeviceLink using message version: " + _SyncMsgVersion.getMajorVersion() + "." + _SyncMsgVersion.getMinorVersion());
-                               } else {
-                                       DebugTool.logInfo("Unrecognized notification Message: " + functionName.toString());
-                               }
-                       } // end-if
-               } // end-if notification
-               
-               SyncTrace.logProxyEvent("Proxy received RPC Message: " + functionName, SMARTDEVICELINK_LIB_TRACE_KEY);
-       }
-       
-       /**
-        * Takes an RPCRequest and sends it to SmartDeviceLink.  Responses are captured through callback on IProxyListener.  
-        * 
-        * @param msg
-        * @throws SmartDeviceLinkException
-        */
-       public void sendRPCRequest(RPCRequest request) throws SmartDeviceLinkException {
-               if (_proxyDisposed) {
-                       throw new SmartDeviceLinkException("This object has been disposed, it is no long capable of executing methods.", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_PROXY_DISPOSED);
-               }
-               
-               // Test if request is null
-               if (request == null) {
-                       SyncTrace.logProxyEvent("Application called sendRPCRequest method with a null RPCRequest.", SMARTDEVICELINK_LIB_TRACE_KEY);
-                       throw new IllegalArgumentException("sendRPCRequest cannot be called with a null request.");
-               }
-               
-               SyncTrace.logProxyEvent("Application called sendRPCRequest method for RPCRequest: ." + request.getFunctionName(), SMARTDEVICELINK_LIB_TRACE_KEY);
-                       
-               // Test if SmartDeviceLinkConnection is null
-               synchronized(CONNECTION_REFERENCE_LOCK) {
-                       if (_SmartDeviceLinkConnection == null || !_SmartDeviceLinkConnection.getIsConnected()) {
-                               SyncTrace.logProxyEvent("Application attempted to send and RPCRequest without a connected transport.", SMARTDEVICELINK_LIB_TRACE_KEY);
-                               throw new SmartDeviceLinkException("There is no valid connection to SmartDeviceLink. sendRPCRequest cannot be called until SmartDeviceLink has been connected.", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_UNAVAILALBE);
-                       }
-               }
-               
-               // Test for illegal correlation ID
-               if (isCorrelationIDProtected(request.getCorrelationID())) {
-                       
-                       SyncTrace.logProxyEvent("Application attempted to use the reserved correlation ID, " + request.getCorrelationID(), SMARTDEVICELINK_LIB_TRACE_KEY);
-                       throw new SmartDeviceLinkException("Invalid correlation ID. The correlation ID, " + request.getCorrelationID()
-                                       + " , is a reserved correlation ID.", SmartDeviceLinkExceptionCause.RESERVED_CORRELATION_ID);
-               }
-               
-               // Throw exception if RPCRequest is sent when SmartDeviceLink is unavailable 
-               if (!_appInterfaceRegisterd && request.getFunctionName() != Names.RegisterAppInterface) {
-                       
-                       SyncTrace.logProxyEvent("Application attempted to send an RPCRequest (non-registerAppInterface), before the interface was registerd.", SMARTDEVICELINK_LIB_TRACE_KEY);
-                       throw new SmartDeviceLinkException("SmartDeviceLink is currently unavailable. RPC Requests cannot be sent.", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_UNAVAILALBE);
-               }
-                               
-               if (_advancedLifecycleManagementEnabled) {
-                       if (               request.getFunctionName() == Names.RegisterAppInterface
-                                       || request.getFunctionName() == Names.UnregisterAppInterface) {
-                               
-                               SyncTrace.logProxyEvent("Application attempted to send a RegisterAppInterface or UnregisterAppInterface while using ALM.", SMARTDEVICELINK_LIB_TRACE_KEY);
-                               throw new SmartDeviceLinkException("The RPCRequest, " + request.getFunctionName() + 
-                                               ", is unnallowed using the Advanced Lifecycle Management Model.", SmartDeviceLinkExceptionCause.INCORRECT_LIFECYCLE_MODEL);
-                       }
-               }
-               
-               sendRPCRequestPrivate(request);
-       } // end-method
-       
-       public void sendRPCRequest(RPCMessage request) throws SmartDeviceLinkException {
-               sendRPCRequest((RPCRequest) request);
-       }
-       
-       protected void notifyProxyClosed(final String info, final Exception e) {                
-               SyncTrace.logProxyEvent("NotifyProxyClose", SMARTDEVICELINK_LIB_TRACE_KEY);
-               
-               OnProxyClosed message = new OnProxyClosed(info, e);
-               queueInternalMessage(message);
-       }
-
-       private void passErrorToProxyListener(final String info, final Exception e) {
-                               
-               OnError message = new OnError(info, e);
-               queueInternalMessage(message);
-       }
-       
-       private void startRPCProtocolSession(byte sessionID, String correlationID) {
-               _rpcSessionID = sessionID;
-               
-               // Set Proxy Lifecyclek Available
-               if (_advancedLifecycleManagementEnabled) {
-                       
-                       try {
-                               registerAppInterfacePrivate(
-                                               _SyncMsgVersionRequest,
-                                               _applicationName,
-                                               _ngnMediaScreenAppName,
-                                               _vrSynonyms,
-                                               _isMediaApp, 
-                                               _SmartDeviceLinkLanguageDesired,
-                                               _autoActivateIdDesired,
-                                               REGISTER_APP_INTERFACE_CORRELATION_ID);
-                               
-                       } catch (Exception e) {
-                               notifyProxyClosed("Failed to register application interface with SmartDeviceLink. Check parameter values given to SmartDeviceLinkProxy constructor.", e);
-                       }
-               } else {
-                       InternalProxyMessage message = new InternalProxyMessage(Names.OnProxyOpened);
-                       queueInternalMessage(message);
-               }
-       }
-       
-       // Queue internal callback message
-       private void queueInternalMessage(InternalProxyMessage message) {
-               synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {
-                       if (_internalProxyMessageDispatcher != null) {
-                               _internalProxyMessageDispatcher.queueMessage(message);
-                       }
-               }
-       }
-       
-       // Queue incoming ProtocolMessage
-       private void queueIncomingMessage(ProtocolMessage message) {
-               synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {
-                       if (_incomingProxyMessageDispatcher != null) {
-                               _incomingProxyMessageDispatcher.queueMessage(message);
-                       }
-               }
-       }
-
-       /******************** Public Helper Methods *************************/
-       
-       /**
-        *Sends an AddCommand RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        *
-        *@param commandID
-        *@param menuText
-        *@param parentID
-        *@param position
-        *@param vrCommands
-        *@param correlationID
-        *@throws SmartDeviceLinkException
-        */
-       public void addCommand(Integer commandID,
-                       String menuText, Integer parentID, Integer position,
-                       Vector<String> vrCommands, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               AddCommand msg = RPCRequestFactory.buildAddCommand(commandID, menuText, parentID, position,
-                       vrCommands, correlationID);
-               
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        *Sends an AddCommand RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        *
-        *@param commandID
-        *@param menuText
-        *@param position
-        *@param vrCommands
-        *@param correlationID
-        *@throws SmartDeviceLinkException
-        */
-       public void addCommand(Integer commandID,
-                       String menuText, Integer position,
-                       Vector<String> vrCommands, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               addCommand(commandID, menuText, null, position, vrCommands, correlationID);
-       }
-       
-       /**
-        *Sends an AddCommand RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        *
-        *@param commandID
-        *@param menuText
-        *@param position
-        *@param correlationID
-        *@throws SmartDeviceLinkException
-        */
-       public void addCommand(Integer commandID,
-                       String menuText, Integer position,
-                       Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               addCommand(commandID, menuText, null, position, null, correlationID);
-       }
-       
-       /**
-        *Sends an AddCommand RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        *
-        *@param commandID
-        *@param menuText
-        *@param correlationID
-        *@throws SmartDeviceLinkException
-        */
-       public void addCommand(Integer commandID,
-                       String menuText, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               addCommand(commandID, menuText, null, null, null, correlationID);
-       }
-       
-       /**
-        * Sends an AddCommand RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param commandID
-        * @param menuText
-        * @param vrCommands
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void addCommand(Integer commandID,
-                       String menuText, Vector<String> vrCommands, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               addCommand(commandID, menuText, null, null, vrCommands, correlationID);
-       }
-       
-       /**
-        * Sends an AddCommand RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param commandID
-        * @param vrCommands
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void addCommand(Integer commandID,
-                       Vector<String> vrCommands, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               addCommand(commandID, null, null, null, vrCommands, correlationID);
-       }
-       
-       /**
-        * Sends an AddSubMenu RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param menuID
-        * @param menuName
-        * @param position
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void addSubMenu(Integer menuID, String menuName,
-                       Integer position, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               AddSubMenu msg = RPCRequestFactory.buildAddSubMenu(menuID, menuName,
-                               position, correlationID);
-               
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends an AddSubMenu RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param menuID
-        * @param menuName
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void addSubMenu(Integer menuID, String menuName,
-                       Integer correlationID) throws SmartDeviceLinkException {
-               
-               addSubMenu(menuID, menuName, null, correlationID);
-       }
-       
-       /**
-        * Sends an EncodedData RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param data
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void encodedSmartDeviceLinkPData(Vector<String> data, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               EncodedSyncPData msg = RPCRequestFactory.buildEncodedSyncPData(data, correlationID);
-
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends an Alert RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param ttsText
-        * @param alertText1
-        * @param alertText2
-        * @param playTone
-        * @param duration
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void alert(String ttsText, String alertText1,
-                       String alertText2, Boolean playTone, Integer duration,
-                       Integer correlationID) throws SmartDeviceLinkException {
-
-               Alert msg = RPCRequestFactory.buildAlert(ttsText, alertText1, alertText2, 
-                               playTone, duration, correlationID);
-
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends an Alert RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param ttsChunks
-        * @param alertText1
-        * @param alertText2
-        * @param playTone
-        * @param duration
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void alert(Vector<TTSChunk> ttsChunks,
-                       String alertText1, String alertText2, Boolean playTone,
-                       Integer duration, Integer correlationID) throws SmartDeviceLinkException {
-               
-               Alert msg = RPCRequestFactory.buildAlert(ttsChunks, alertText1, alertText2, playTone,
-                               duration, correlationID);
-
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends an Alert RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param ttsText
-        * @param playTone
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void alert(String ttsText, Boolean playTone,
-                       Integer correlationID) throws SmartDeviceLinkException {
-               
-               alert(ttsText, null, null, playTone, null, correlationID);
-       }
-       
-       /**
-        * Sends an Alert RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param chunks
-        * @param playTone
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void alert(Vector<TTSChunk> chunks, Boolean playTone,
-                       Integer correlationID) throws SmartDeviceLinkException {
-               
-               alert(chunks, null, null, playTone, null, correlationID);
-       }
-       
-       /**
-        * Sends an Alert RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param alertText1
-        * @param alertText2
-        * @param playTone
-        * @param duration
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void alert(String alertText1, String alertText2,
-                       Boolean playTone, Integer duration, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               alert((Vector<TTSChunk>)null, alertText1, alertText2, playTone, duration, correlationID);
-       }
-       
-       /**
-        * Sends a CreateInteractionChoiceSet RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param choiceSet
-        * @param interactionChoiceSetID
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void createInteractionChoiceSet(
-                       Vector<Choice> choiceSet, Integer interactionChoiceSetID,
-                       Integer correlationID) throws SmartDeviceLinkException {
-               
-               CreateInteractionChoiceSet msg = RPCRequestFactory.buildCreateInteractionChoiceSet(
-                               choiceSet, interactionChoiceSetID, correlationID);
-
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends a DeleteCommand RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param commandID
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void deleteCommand(Integer commandID,
-                       Integer correlationID) throws SmartDeviceLinkException {
-               
-               DeleteCommand msg = RPCRequestFactory.buildDeleteCommand(commandID, correlationID);
-
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends a DeleteInteractionChoiceSet RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param interactionChoiceSetID
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void deleteInteractionChoiceSet(
-                       Integer interactionChoiceSetID, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               DeleteInteractionChoiceSet msg = RPCRequestFactory.buildDeleteInteractionChoiceSet(
-                               interactionChoiceSetID, correlationID);
-
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends a DeleteSubMenu RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param menuID
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void deleteSubMenu(Integer menuID,
-                       Integer correlationID) throws SmartDeviceLinkException {
-               
-               DeleteSubMenu msg = RPCRequestFactory.buildDeleteSubMenu(menuID, correlationID);
-
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends a PerformInteraction RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param initPrompt
-        * @param displayText
-        * @param interactionChoiceSetID
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void performInteraction(String initPrompt,
-                       String displayText, Integer interactionChoiceSetID,
-                       Integer correlationID) throws SmartDeviceLinkException {
-               
-               PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(initPrompt,
-                               displayText, interactionChoiceSetID, correlationID);
-               
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends a PerformInteraction RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param initPrompt
-        * @param displayText
-        * @param interactionChoiceSetID
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void performInteraction(String initPrompt,
-                       String displayText, Integer interactionChoiceSetID,
-                       String helpPrompt, String timeoutPrompt,
-                       InteractionMode interactionMode, Integer timeout,
-                       Integer correlationID) throws SmartDeviceLinkException {
-               
-               PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(
-                               initPrompt, displayText, interactionChoiceSetID,
-                               helpPrompt, timeoutPrompt, interactionMode, 
-                               timeout, correlationID);
-               
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends a PerformInteraction RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param initPrompt
-        * @param displayText
-        * @param interactionChoiceSetIDList
-        * @param helpPrompt
-        * @param timeoutPrompt
-        * @param interactionMode
-        * @param timeout
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void performInteraction(String initPrompt,
-                       String displayText, Vector<Integer> interactionChoiceSetIDList,
-                       String helpPrompt, String timeoutPrompt,
-                       InteractionMode interactionMode, Integer timeout,
-                       Integer correlationID) throws SmartDeviceLinkException {
-               
-               PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(initPrompt,
-                               displayText, interactionChoiceSetIDList,
-                               helpPrompt, timeoutPrompt, interactionMode, timeout,
-                               correlationID);
-
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends a PerformInteraction RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param initChunks
-        * @param displayText
-        * @param interactionChoiceSetIDList
-        * @param helpChunks
-        * @param timeoutChunks
-        * @param interactionMode
-        * @param timeout
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void performInteraction(
-                       Vector<TTSChunk> initChunks, String displayText,
-                       Vector<Integer> interactionChoiceSetIDList,
-                       Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
-                       InteractionMode interactionMode, Integer timeout,
-                       Integer correlationID) throws SmartDeviceLinkException {
-               
-               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, String ngnMediaScreenAppName,
-                       Vector<String> vrSynonyms, Boolean isMediaApp, Language languageDesired, 
-                       String autoActivateID, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               RegisterAppInterface msg = RPCRequestFactory.buildRegisterAppInterface(
-                               SyncMsgVersion, appName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, 
-                               languageDesired, autoActivateID, correlationID);
-
-               sendRPCRequestPrivate(msg);
-       }
-       
-       /**
-        * Sends a SetGlobalProperties RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param helpPrompt
-        * @param timeoutPrompt
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void setGlobalProperties(
-                       String helpPrompt, String timeoutPrompt, Integer correlationID) 
-               throws SmartDeviceLinkException {
-               
-               SetGlobalProperties req = RPCRequestFactory.buildSetGlobalProperties(helpPrompt, 
-                               timeoutPrompt, correlationID);
-               
-               sendRPCRequest(req);
-       }
-       
-       /**
-        * Sends a SetGlobalProperties RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param helpChunks
-        * @param timeoutChunks
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void setGlobalProperties(
-                       Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,
-                       Integer correlationID) throws SmartDeviceLinkException {
-               
-               SetGlobalProperties req = RPCRequestFactory.buildSetGlobalProperties(
-                               helpChunks, timeoutChunks, correlationID);
-
-               sendRPCRequest(req);
-       }
-       
-       public void resetGlobalProperties(Vector<GlobalProperty> properties,
-                       Integer correlationID) throws SmartDeviceLinkException {
-               
-               ResetGlobalProperties req = new ResetGlobalProperties();
-               
-               req.setCorrelationID(correlationID);
-               req.setProperties(properties);
-               
-               sendRPCRequest(req);
-       }
-                                                               
-       
-       /**
-        * Sends a SetMediaClockTimer RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param hours
-        * @param minutes
-        * @param seconds
-        * @param updateMode
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void setMediaClockTimer(Integer hours,
-                       Integer minutes, Integer seconds, UpdateMode updateMode,
-                       Integer correlationID) throws SmartDeviceLinkException {
-
-               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 SmartDeviceLinkException
-        */
-       public void pauseMediaClockTimer(Integer correlationID) 
-                       throws SmartDeviceLinkException {
-
-               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 SmartDeviceLinkException
-        */
-       public void resumeMediaClockTimer(Integer correlationID) 
-                       throws SmartDeviceLinkException {
-
-               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 SmartDeviceLinkException
-        */
-       public void clearMediaClockTimer(Integer correlationID) 
-                       throws SmartDeviceLinkException {
-
-               Show msg = RPCRequestFactory.buildShow(null, null, null, "     ", null, null, correlationID);
-
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends a Show RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param mainText1
-        * @param mainText2
-        * @param statusBar
-        * @param mediaClock
-        * @param mediaTrack
-        * @param alignment
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void show(String mainText1, String mainText2,
-                       String statusBar, String mediaClock, String mediaTrack,
-                       TextAlignment alignment, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               Show msg = RPCRequestFactory.buildShow(mainText1, mainText2,
-                               statusBar, mediaClock, mediaTrack,
-                               alignment, correlationID);
-
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends a Show RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param mainText1
-        * @param mainText2
-        * @param alignment
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void show(String mainText1, String mainText2,
-                       TextAlignment alignment, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               show(mainText1, mainText2, null, null, null, alignment, correlationID);
-       }
-       
-       /**
-        * Sends a Speak RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param ttsText
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void speak(String ttsText, Integer correlationID) 
-                       throws SmartDeviceLinkException {
-               
-               Speak msg = RPCRequestFactory.buildSpeak(TTSChunkFactory.createSimpleTTSChunks(ttsText),
-                               correlationID);
-
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends a Speak RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param ttsChunks
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void speak(Vector<TTSChunk> ttsChunks,
-                       Integer correlationID) throws SmartDeviceLinkException {
-
-               Speak msg = RPCRequestFactory.buildSpeak(ttsChunks, correlationID);
-
-               sendRPCRequest(msg);
-       }
-       
-       /**
-        * Sends a SubscribeButton RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param buttonName
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void subscribeButton(ButtonName buttonName,
-                       Integer correlationID) throws SmartDeviceLinkException {
-
-               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 SmartDeviceLinkException {
-
-               UnregisterAppInterface msg = 
-                               RPCRequestFactory.buildUnregisterAppInterface(correlationID);
-               
-               sendRPCRequestPrivate(msg);
-       }
-       
-       /**
-        * Sends an UnsubscribeButton RPCRequest to SmartDeviceLink. Responses are captured through callback on IProxyListener.
-        * 
-        * @param buttonName
-        * @param correlationID
-        * @throws SmartDeviceLinkException
-        */
-       public void unsubscribeButton(ButtonName buttonName, 
-                       Integer correlationID) throws SmartDeviceLinkException {
-
-               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 SmartDeviceLinkException 
-        */
-       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;
-       }
-       
-       /******************** END Public Helper Methods *************************/
-
-       public TransportType getCurrentTransportType() throws IllegalStateException {
-               if (_SmartDeviceLinkConnection == null) {
-                       throw new IllegalStateException("Incorrect state of SmartDeviceLinkProxyBase: Calling for getCurrentTransportType() while connection is not initialized");
-               }
-                       
-               return _SmartDeviceLinkConnection.getCurrentTransportType();
-       }
-} // end-class
+package com.smartdevicelink.proxy;\r
+\r
+import java.lang.reflect.Constructor;\r
+import java.lang.reflect.Method;\r
+import java.util.Hashtable;\r
+import java.util.Vector;\r
+\r
+import android.app.Service;\r
+import android.content.Context;\r
+import android.content.Intent;\r
+import android.os.Handler;\r
+import android.os.Looper;\r
+import android.telephony.TelephonyManager;\r
+import android.util.Log;\r
+\r
+import com.smartdevicelink.exception.SmartDeviceLinkException;\r
+import com.smartdevicelink.exception.SmartDeviceLinkExceptionCause;\r
+import com.smartdevicelink.marshal.JsonRPCMarshaller;\r
+import com.smartdevicelink.messageDispatcher.IDispatchingStrategy;\r
+import com.smartdevicelink.messageDispatcher.IncomingProtocolMessageComparitor;\r
+import com.smartdevicelink.messageDispatcher.InternalProxyMessageComparitor;\r
+import com.smartdevicelink.messageDispatcher.OutgoingProtocolMessageComparitor;\r
+import com.smartdevicelink.messageDispatcher.ProxyMessageDispatcher;\r
+import com.smartdevicelink.protocol.ProtocolMessage;\r
+import com.smartdevicelink.protocol.SmartDeviceLinkProtocol;\r
+import com.smartdevicelink.protocol.enums.FunctionID;\r
+import com.smartdevicelink.protocol.enums.MessageType;\r
+import com.smartdevicelink.protocol.enums.SessionType;\r
+import com.smartdevicelink.proxy.callbacks.InternalProxyMessage;\r
+import com.smartdevicelink.proxy.callbacks.OnError;\r
+import com.smartdevicelink.proxy.callbacks.OnProxyClosed;\r
+import com.smartdevicelink.proxy.constants.Names;\r
+import com.smartdevicelink.proxy.interfaces.IProxyListenerALM;\r
+import com.smartdevicelink.proxy.interfaces.IProxyListenerBase;\r
+import com.smartdevicelink.proxy.rpc.*;\r
+import com.smartdevicelink.proxy.rpc.enums.AppHMIType;\r
+import com.smartdevicelink.proxy.rpc.enums.AudioStreamingState;\r
+import com.smartdevicelink.proxy.rpc.enums.AudioType;\r
+import com.smartdevicelink.proxy.rpc.enums.BitsPerSample;\r
+import com.smartdevicelink.proxy.rpc.enums.ButtonName;\r
+import com.smartdevicelink.proxy.rpc.enums.FileType;\r
+import com.smartdevicelink.proxy.rpc.enums.GlobalProperty;\r
+import com.smartdevicelink.proxy.rpc.enums.HMILevel;\r
+import com.smartdevicelink.proxy.rpc.enums.HmiZoneCapabilities;\r
+import com.smartdevicelink.proxy.rpc.enums.ImageType;\r
+import com.smartdevicelink.proxy.rpc.enums.InteractionMode;\r
+import com.smartdevicelink.proxy.rpc.enums.Language;\r
+import com.smartdevicelink.proxy.rpc.enums.SamplingRate;\r
+import com.smartdevicelink.proxy.rpc.enums.SpeechCapabilities;\r
+import com.smartdevicelink.proxy.rpc.enums.SmartDeviceLinkConnectionState;\r
+import com.smartdevicelink.proxy.rpc.enums.SmartDeviceLinkDisconnectedReason;\r
+import com.smartdevicelink.proxy.rpc.enums.SmartDeviceLinkInterfaceAvailability;\r
+import com.smartdevicelink.proxy.rpc.enums.SystemContext;\r
+import com.smartdevicelink.proxy.rpc.enums.TextAlignment;\r
+import com.smartdevicelink.proxy.rpc.enums.UpdateMode;\r
+import com.smartdevicelink.proxy.rpc.enums.VrCapabilities;\r
+import com.smartdevicelink.smartDeviceLinkConnection.IsmartDeviceLinkConnectionListener;\r
+import com.smartdevicelink.smartDeviceLinkConnection.smartDeviceLinkConnection;\r
+import com.smartdevicelink.trace.SmartDeviceLinkTrace;\r
+import com.smartdevicelink.trace.TraceDeviceInfo;\r
+import com.smartdevicelink.trace.enums.InterfaceActivityDirection;\r
+import com.smartdevicelink.transport.BaseTransportConfig;\r
+import com.smartdevicelink.transport.SiphonServer;\r
+import com.smartdevicelink.transport.TransportType;\r
+import com.smartdevicelink.util.DebugTool;\r
+\r
+public abstract class SmartDeviceLinkProxyBase<proxyListenerType extends IProxyListenerBase> {\r
+       // Used for calls to Android Log class.\r
+       public static final String TAG = "SmartDeviceLinkProxy";\r
+       private static final String SMARTDEVICELINK_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";\r
+       private static final int PROX_PROT_VER_ONE = 1;\r
+       \r
+       private smartDeviceLinkConnection _smartDeviceLinkConnection;\r
+       private proxyListenerType _proxyListener = null;\r
+       \r
+       protected Service _appService = null;\r
+       \r
+       // Protected Correlation IDs\r
+       private final int       REGISTER_APP_INTERFACE_CORRELATION_ID = 65529,\r
+                                               UNREGISTER_APP_INTERFACE_CORRELATION_ID = 65530,\r
+                                               POLICIES_CORRELATION_ID = 65535;\r
+       \r
+       // SmartDeviceLinkhronization Objects\r
+       private static final Object CONNECTION_REFERENCE_LOCK = new Object(),\r
+                                                               INCOMING_MESSAGE_QUEUE_THREAD_LOCK = new Object(),\r
+                                                               OUTGOING_MESSAGE_QUEUE_THREAD_LOCK = new Object(),\r
+                                                               INTERNAL_MESSAGE_QUEUE_THREAD_LOCK = new Object(),\r
+                                                               APP_INTERFACE_REGISTERED_LOCK = new Object();\r
+               \r
+       // RPC Session ID\r
+       private byte _rpcSessionID = 0;\r
+       \r
+       private int iFileCount = 0;\r
+\r
+       // Device Info for logging\r
+       private TraceDeviceInfo _traceDeviceInterrogator = null;\r
+               \r
+       // Declare Queuing Threads\r
+       private ProxyMessageDispatcher<ProtocolMessage> _incomingProxyMessageDispatcher;\r
+       private ProxyMessageDispatcher<ProtocolMessage> _outgoingProxyMessageDispatcher;\r
+       private ProxyMessageDispatcher<InternalProxyMessage> _internalProxyMessageDispatcher;\r
+       \r
+       // Flag indicating if callbacks should be called from UIThread\r
+       private Boolean _callbackToUIThread = false;\r
+       // UI Handler\r
+       private Handler _mainUIHandler = null; \r
+       \r
+       // SmartDeviceLinkProxy Advanced Lifecycle Management\r
+       protected Boolean _advancedLifecycleManagementEnabled = false;\r
+       // Parameters passed to the constructor from the app to register an app interface\r
+       private String _applicationName = null;\r
+       private Vector<TTSChunk> _ttsName = null;\r
+       private String _ngnMediaScreenAppName = null;\r
+       private Boolean _isMediaApp = null;\r
+       private Language _smartDeviceLinkLanguageDesired = null;\r
+       private Language _hmiDisplayLanguageDesired = null;\r
+       private Vector<AppHMIType> _appType = null;\r
+       private String _appID = null;\r
+       private String _autoActivateIdDesired = null;\r
+       private smartdevicelinkMsgVersion _smartDeviceLinkMsgVersionRequest = null;\r
+       private Vector<String> _vrSynonyms = null;\r
+       \r
+       /**\r
+        * Contains current configuration for the transport that was selected during \r
+        * construction of this object\r
+        */\r
+       private BaseTransportConfig _transportConfig = null;\r
+       // Proxy State Variables\r
+       protected Boolean _appInterfaceRegisterd = false;\r
+       private Boolean _haveReceivedFirstNonNoneHMILevel = false;\r
+       protected Boolean _haveReceivedFirstFocusLevel = false;\r
+       protected Boolean _haveReceivedFirstFocusLevelFull = false;\r
+       protected Boolean _proxyDisposed = false;\r
+       protected SmartDeviceLinkConnectionState _smartDeviceLinkConnectionState = null;\r
+       protected SmartDeviceLinkInterfaceAvailability _smartDeviceLinkIntefaceAvailablity = null;\r
+       protected HMILevel _hmiLevel = null;\r
+       private HMILevel _priorHmiLevel = null;\r
+       protected AudioStreamingState _audioStreamingState = null;\r
+       private AudioStreamingState _priorAudioStreamingState = null;\r
+       protected SystemContext _systemContext = null;\r
+       // Variables set by RegisterAppInterfaceResponse\r
+       protected smartdevicelinkMsgVersion _smartDeviceLinkMsgVersion = null;\r
+       protected String _autoActivateIdReturned = null;\r
+       protected Language _smartDeviceLinkLanguage = null;\r
+       protected Language _hmiDisplayLanguage = null;\r
+       protected DisplayCapabilities _displayCapabilities = null;\r
+       protected Vector<ButtonCapabilities> _buttonCapabilities = null;\r
+       protected Vector<SoftButtonCapabilities> _softButtonCapabilities = null;\r
+       protected PresetBankCapabilities _presetBankCapabilities = null;\r
+       protected Vector<HmiZoneCapabilities> _hmiZoneCapabilities = null;\r
+       protected Vector<SpeechCapabilities> _speechCapabilities = null;\r
+       protected Vector<VrCapabilities> _vrCapabilities = null;\r
+       protected VehicleType _vehicleType = null;\r
+       protected Boolean firstTimeFull = true;\r
+       protected String _proxyVersionInfo = null;\r
+       \r
+       protected byte _sdlproVersion = 1;\r
+       \r
+       // Interface broker\r
+       private SmartDeviceLinkInterfaceBroker _interfaceBroker = null;\r
+       \r
+       // Private Class to Interface with smartDeviceLinkConnection\r
+       private class SmartDeviceLinkInterfaceBroker implements IsmartDeviceLinkConnectionListener {\r
+               \r
+               @Override\r
+               public void onTransportDisconnected(String info) {\r
+                       // proxyOnTransportDisconnect is called to alert the proxy that a requested\r
+                       // disconnect has completed\r
+                       \r
+                       if (_advancedLifecycleManagementEnabled) {\r
+                               // If ALM, nothing is required to be done here\r
+                       } else {\r
+                               // If original model, notify app the proxy is closed so it will delete and reinstanciate \r
+                               notifyProxyClosed(info, new SmartDeviceLinkException("Transport disconnected.", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_UNAVAILALBE));\r
+                       }\r
+               }\r
+\r
+               @Override\r
+               public void onTransportError(String info, Exception e) {\r
+                       DebugTool.logError("Transport failure: " + info, e);\r
+                       \r
+                       if (_advancedLifecycleManagementEnabled) {                      \r
+                               // Cycle the proxy\r
+                               cycleProxy(SmartDeviceLinkDisconnectedReason.TRANSPORT_ERROR);\r
+                       } else {\r
+                               notifyProxyClosed(info, e);\r
+                       }\r
+               }\r
+\r
+               @Override\r
+               public void onProtocolMessageReceived(ProtocolMessage msg) {\r
+                       \r
+                       try {if (msg.getData().length > 0) queueIncomingMessage(msg);}\r
+                       catch (Exception e) {}\r
+                       try {if (msg.getBulkData().length > 0) queueIncomingMessage(msg);}\r
+                       catch (Exception e) {}\r
+               }\r
+\r
+               @Override\r
+               public void onProtocolSessionStarted(SessionType sessionType,\r
+                               byte sessionID, byte version, String correlationID) {\r
+                       if (_sdlproVersion == 1) {\r
+                               if (version == 2) setsdlproVersion(version);\r
+                       }\r
+                       if (sessionType.eq(SessionType.RPC)) {                  \r
+                               startRPCProtocolSession(sessionID, correlationID);\r
+                       } else if (_sdlproVersion == 2) {\r
+                               //If version 2 then don't need to specify a Session Type\r
+                               startRPCProtocolSession(sessionID, correlationID);\r
+                       }  else {\r
+                               // Handle other protocol session types here\r
+                       }\r
+               }\r
+\r
+               @Override\r
+               public void onProtocolSessionEnded(SessionType sessionType,\r
+                               byte sessionID, String correlationID) {\r
+                       // How to handle protocol session ended?\r
+                               // How should protocol session management occur? \r
+               }\r
+\r
+               @Override\r
+               public void onProtocolError(String info, Exception e) {\r
+                       passErrorToProxyListener(info, e);\r
+               }\r
+       }\r
+       \r
+       /**\r
+        * Constructor.\r
+        * \r
+        * @param listener Type of listener for this proxy base.\r
+        * @param smartDeviceLinkProxyConfigurationResources Configuration resources for this proxy.\r
+        * @param enableAdvancedLifecycleManagement Flag that ALM should be enabled or not.\r
+        * @param appName Client application name.\r
+        * @param ttsName TTS name.\r
+        * @param ngnMediaScreenAppName Media Screen Application name.\r
+        * @param vrSynonyms List of synonyms.\r
+        * @param isMediaApp Flag that indicates that client application if media application or not.\r
+        * @param smartDeviceLinkMsgVersion Version of SmartDeviceLink Message.\r
+        * @param languageDesired Desired language.\r
+        * @param hmiDisplayLanguageDesired Desired language for HMI. \r
+        * @param appType Type of application.\r
+        * @param appID Application identifier.\r
+        * @param autoActivateID Auto activation identifier.\r
+        * @param callbackToUIThread Flag that indicates that this proxy should send callback to UI thread or not.\r
+        * @param transportConfig Configuration of transport to be used by underlying connection.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       protected SmartDeviceLinkProxyBase(proxyListenerType listener, SmartDeviceLinkProxyConfigurationResources smartDeviceLinkProxyConfigurationResources, \r
+                       boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName, \r
+                       String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, smartdevicelinkMsgVersion smartDeviceLinkMsgVersion, \r
+                       Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID, \r
+                       String autoActivateID, boolean callbackToUIThread, BaseTransportConfig transportConfig) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               setsdlproVersion((byte)PROX_PROT_VER_ONE);\r
+               \r
+               _interfaceBroker = new SmartDeviceLinkInterfaceBroker();\r
+               \r
+               _callbackToUIThread = callbackToUIThread;\r
+               \r
+               if (_callbackToUIThread) {\r
+                       _mainUIHandler = new Handler(Looper.getMainLooper());\r
+               }\r
+               \r
+               // Set variables for Advanced Lifecycle Management\r
+               _advancedLifecycleManagementEnabled = enableAdvancedLifecycleManagement;\r
+               _applicationName = appName;\r
+               _ttsName = ttsName;\r
+               _ngnMediaScreenAppName = ngnMediaScreenAppName;\r
+               _isMediaApp = isMediaApp;\r
+               _smartDeviceLinkMsgVersionRequest = smartDeviceLinkMsgVersion;\r
+               _vrSynonyms = vrSynonyms; \r
+               _smartDeviceLinkLanguageDesired = languageDesired;\r
+               _hmiDisplayLanguageDesired = hmiDisplayLanguageDesired;\r
+               _appType = appType;\r
+               _appID = appID;\r
+               _autoActivateIdDesired = autoActivateID;\r
+               _transportConfig = transportConfig;\r
+               \r
+               // Test conditions to invalidate the proxy\r
+               if (listener == null) {\r
+                       throw new IllegalArgumentException("IProxyListener listener must be provided to instantiate SmartDeviceLinkProxy object.");\r
+               }\r
+               if (_advancedLifecycleManagementEnabled) {\r
+                       if (_applicationName == null ) {\r
+                               throw new IllegalArgumentException("To use SmartDeviceLinkProxyALM, an application name, appName, must be provided");\r
+                       }\r
+                       if (_applicationName.length() < 1 || _applicationName.length() > 100) {\r
+                               throw new IllegalArgumentException("A provided application name, appName, must be between 1 and 100 characters in length.");\r
+                       }\r
+                       if (_isMediaApp == null) {\r
+                               throw new IllegalArgumentException("isMediaApp must not be null when using SmartDeviceLinkProxyALM.");\r
+                       }\r
+               }\r
+               \r
+               _proxyListener = listener;\r
+               \r
+               // Get information from smartDeviceLinkProxyConfigurationResources\r
+               TelephonyManager telephonyManager = null;\r
+               if (smartDeviceLinkProxyConfigurationResources != null) {\r
+                       telephonyManager = smartDeviceLinkProxyConfigurationResources.getTelephonyManager();\r
+               } \r
+               \r
+               // Use the telephonyManager to get and log phone info\r
+               if (telephonyManager != null) {\r
+                       // Following is not quite thread-safe (because m_traceLogger could test null twice),\r
+                       // so we need to fix this, but vulnerability (i.e. two instances of listener) is\r
+                       // likely harmless.\r
+                       if (_traceDeviceInterrogator == null) {\r
+                               _traceDeviceInterrogator = new TraceDeviceInfo(smartDeviceLinkProxyConfigurationResources.getTelephonyManager());\r
+                       } // end-if\r
+               } // end-if\r
+               \r
+               // Setup Internal ProxyMessage Dispatcher\r
+               synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {\r
+                       // Ensure internalProxyMessageDispatcher is null\r
+                       if (_internalProxyMessageDispatcher != null) {\r
+                               _internalProxyMessageDispatcher.dispose();\r
+                               _internalProxyMessageDispatcher = null;\r
+                       }\r
+                       \r
+                       _internalProxyMessageDispatcher = new ProxyMessageDispatcher<InternalProxyMessage>("INTERNAL_MESSAGE_DISPATCHER",\r
+                                       new InternalProxyMessageComparitor(),\r
+                                       new IDispatchingStrategy<InternalProxyMessage>() {\r
+\r
+                                               @Override\r
+                                               public void dispatch(InternalProxyMessage message) {\r
+                                                       dispatchInternalMessage((InternalProxyMessage)message);\r
+                                               }\r
+       \r
+                                               @Override\r
+                                               public void handleDispatchingError(String info, Exception ex) {\r
+                                                       handleErrorsFromInternalMessageDispatcher(info, ex);\r
+                                               }\r
+       \r
+                                               @Override\r
+                                               public void handleQueueingError(String info, Exception ex) {\r
+                                                       handleErrorsFromInternalMessageDispatcher(info, ex);\r
+                                               }                       \r
+                       });\r
+               }\r
+               \r
+               // Setup Incoming ProxyMessage Dispatcher\r
+               synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {\r
+                       // Ensure incomingProxyMessageDispatcher is null\r
+                       if (_incomingProxyMessageDispatcher != null) {\r
+                               _incomingProxyMessageDispatcher.dispose();\r
+                               _incomingProxyMessageDispatcher = null;\r
+                       }\r
+                       \r
+                       _incomingProxyMessageDispatcher = new ProxyMessageDispatcher<ProtocolMessage>("INCOMING_MESSAGE_DISPATCHER",\r
+                                       new IncomingProtocolMessageComparitor(),\r
+                                       new IDispatchingStrategy<ProtocolMessage>() {\r
+                                               @Override\r
+                                               public void dispatch(ProtocolMessage message) {\r
+                                                       dispatchIncomingMessage((ProtocolMessage)message);\r
+                                               }\r
+       \r
+                                               @Override\r
+                                               public void handleDispatchingError(String info, Exception ex) {\r
+                                                       handleErrorsFromIncomingMessageDispatcher(info, ex);\r
+                                               }\r
+       \r
+                                               @Override\r
+                                               public void handleQueueingError(String info, Exception ex) {\r
+                                                       handleErrorsFromIncomingMessageDispatcher(info, ex);\r
+                                               }                       \r
+                       });\r
+               }\r
+               \r
+               // Setup Outgoing ProxyMessage Dispatcher\r
+               synchronized(OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) {\r
+                       // Ensure outgoingProxyMessageDispatcher is null\r
+                       if (_outgoingProxyMessageDispatcher != null) {\r
+                               _outgoingProxyMessageDispatcher.dispose();\r
+                               _outgoingProxyMessageDispatcher = null;\r
+                       }\r
+                       \r
+                       _outgoingProxyMessageDispatcher = new ProxyMessageDispatcher<ProtocolMessage>("OUTGOING_MESSAGE_DISPATCHER",\r
+                                       new OutgoingProtocolMessageComparitor(),\r
+                                       new IDispatchingStrategy<ProtocolMessage>() {\r
+                                               @Override\r
+                                               public void dispatch(ProtocolMessage message) {\r
+                                                       dispatchOutgoingMessage((ProtocolMessage)message);\r
+                                               }\r
+       \r
+                                               @Override\r
+                                               public void handleDispatchingError(String info, Exception ex) {\r
+                                                       handleErrorsFromOutgoingMessageDispatcher(info, ex);\r
+                                               }\r
+       \r
+                                               @Override\r
+                                               public void handleQueueingError(String info, Exception ex) {\r
+                                                       handleErrorsFromOutgoingMessageDispatcher(info, ex);\r
+                                               }\r
+                       });\r
+               }\r
+               \r
+               // Initialize the proxy\r
+               try {\r
+                       initializeProxy();\r
+               } catch (SmartDeviceLinkException e) {\r
+                       // Couldn't initialize the proxy \r
+                       // Dispose threads and then rethrow exception\r
+                       \r
+                       if (_internalProxyMessageDispatcher != null) {\r
+                               _internalProxyMessageDispatcher.dispose();\r
+                               _internalProxyMessageDispatcher = null;\r
+                       }\r
+                       if (_incomingProxyMessageDispatcher != null) {\r
+                               _incomingProxyMessageDispatcher.dispose();\r
+                               _incomingProxyMessageDispatcher = null;\r
+                       }\r
+                       if (_outgoingProxyMessageDispatcher != null) {\r
+                               _outgoingProxyMessageDispatcher.dispose();\r
+                               _outgoingProxyMessageDispatcher = null;\r
+                       }\r
+                       throw e;\r
+               } \r
+               \r
+               // Trace that ctor has fired\r
+               SmartDeviceLinkTrace.logProxyEvent("SmartDeviceLinkProxy Created, instanceID=" + this.toString(), SMARTDEVICELINK_LIB_TRACE_KEY);\r
+       }\r
+       \r
+       /**\r
+        * Constructor.\r
+        * \r
+        * @param listener Type of listener for this proxy base.\r
+        * @param smartDeviceLinkProxyConfigurationResources Configuration resources for this proxy.\r
+        * @param enableAdvancedLifecycleManagement Flag that ALM should be enabled or not.\r
+        * @param appName Client application name.\r
+        * @param ttsName TTS name.\r
+        * @param ngnMediaScreenAppName Media Screen Application name.\r
+        * @param vrSynonyms List of synonyms.\r
+        * @param isMediaApp Flag that indicates that client application if media application or not.\r
+        * @param smartDeviceLinkMsgVersion Version of SmartDeviceLink Message.\r
+        * @param languageDesired Desired language.\r
+        * @param hmiDisplayLanguageDesired Desired language for HMI. \r
+        * @param appType Type of application.\r
+        * @param appID Application identifier.\r
+        * @param autoActivateID Auto activation identifier.\r
+        * @param callbackToUIThread Flag that indicates that this proxy should send callback to UI thread or not.\r
+        * @param preRegister Flag that indicates that this proxy should be pre-registerd or not.\r
+        * @param transportConfig Configuration of transport to be used by underlying connection.\r
+        * @throws SmartDeviceLinkException\r
+        */     \r
+       protected SmartDeviceLinkProxyBase(proxyListenerType listener, SmartDeviceLinkProxyConfigurationResources smartDeviceLinkProxyConfigurationResources, \r
+                       boolean enableAdvancedLifecycleManagement, String appName, Vector<TTSChunk> ttsName, \r
+                       String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, smartdevicelinkMsgVersion smartDeviceLinkMsgVersion, \r
+                       Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String appID, \r
+                       String autoActivateID, boolean callbackToUIThread, boolean preRegister,\r
+                       BaseTransportConfig transportConfig) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               setsdlproVersion((byte)PROX_PROT_VER_ONE);\r
+               \r
+               if (preRegister) _appInterfaceRegisterd = preRegister;\r
+               \r
+               _interfaceBroker = new SmartDeviceLinkInterfaceBroker();\r
+               \r
+               _callbackToUIThread = callbackToUIThread;\r
+               \r
+               if (_callbackToUIThread) {\r
+                       _mainUIHandler = new Handler(Looper.getMainLooper());\r
+               }\r
+               \r
+               // Set variables for Advanced Lifecycle Management\r
+               _advancedLifecycleManagementEnabled = enableAdvancedLifecycleManagement;\r
+               _applicationName = appName;\r
+               _ttsName = ttsName;\r
+               _ngnMediaScreenAppName = ngnMediaScreenAppName;\r
+               _isMediaApp = isMediaApp;\r
+               _smartDeviceLinkMsgVersionRequest = smartDeviceLinkMsgVersion;\r
+               _vrSynonyms = vrSynonyms; \r
+               _smartDeviceLinkLanguageDesired = languageDesired;\r
+               _hmiDisplayLanguageDesired = hmiDisplayLanguageDesired;\r
+               _appType = appType;\r
+               _appID = appID;\r
+               _autoActivateIdDesired = autoActivateID;\r
+               _transportConfig = transportConfig;\r
+               \r
+               // Test conditions to invalidate the proxy\r
+               if (listener == null) {\r
+                       throw new IllegalArgumentException("IProxyListener listener must be provided to instantiate SmartDeviceLinkProxy object.");\r
+               }\r
+               if (_advancedLifecycleManagementEnabled) {\r
+                       if (_applicationName == null ) {\r
+                               throw new IllegalArgumentException("To use SmartDeviceLinkProxyALM, an application name, appName, must be provided");\r
+                       }\r
+                       if (_applicationName.length() < 1 || _applicationName.length() > 100) {\r
+                               throw new IllegalArgumentException("A provided application name, appName, must be between 1 and 100 characters in length.");\r
+                       }\r
+                       if (_isMediaApp == null) {\r
+                               throw new IllegalArgumentException("isMediaApp must not be null when using SmartDeviceLinkProxyALM.");\r
+                       }\r
+               }\r
+               \r
+               _proxyListener = listener;\r
+               \r
+               // Get information from smartDeviceLinkProxyConfigurationResources\r
+               TelephonyManager telephonyManager = null;\r
+               if (smartDeviceLinkProxyConfigurationResources != null) {\r
+                       telephonyManager = smartDeviceLinkProxyConfigurationResources.getTelephonyManager();\r
+               } \r
+               \r
+               // Use the telephonyManager to get and log phone info\r
+               if (telephonyManager != null) {\r
+                       // Following is not quite thread-safe (because m_traceLogger could test null twice),\r
+                       // so we need to fix this, but vulnerability (i.e. two instances of listener) is\r
+                       // likely harmless.\r
+                       if (_traceDeviceInterrogator == null) {\r
+                               _traceDeviceInterrogator = new TraceDeviceInfo(smartDeviceLinkProxyConfigurationResources.getTelephonyManager());\r
+                       } // end-if\r
+               } // end-if\r
+               \r
+               // Setup Internal ProxyMessage Dispatcher\r
+               synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {\r
+                       // Ensure internalProxyMessageDispatcher is null\r
+                       if (_internalProxyMessageDispatcher != null) {\r
+                               _internalProxyMessageDispatcher.dispose();\r
+                               _internalProxyMessageDispatcher = null;\r
+                       }\r
+                       \r
+                       _internalProxyMessageDispatcher = new ProxyMessageDispatcher<InternalProxyMessage>("INTERNAL_MESSAGE_DISPATCHER",\r
+                                       new InternalProxyMessageComparitor(),\r
+                                       new IDispatchingStrategy<InternalProxyMessage>() {\r
+\r
+                                               @Override\r
+                                               public void dispatch(InternalProxyMessage message) {\r
+                                                       dispatchInternalMessage((InternalProxyMessage)message);\r
+                                               }\r
+       \r
+                                               @Override\r
+                                               public void handleDispatchingError(String info, Exception ex) {\r
+                                                       handleErrorsFromInternalMessageDispatcher(info, ex);\r
+                                               }\r
+       \r
+                                               @Override\r
+                                               public void handleQueueingError(String info, Exception ex) {\r
+                                                       handleErrorsFromInternalMessageDispatcher(info, ex);\r
+                                               }                       \r
+                       });\r
+               }\r
+               \r
+               // Setup Incoming ProxyMessage Dispatcher\r
+               synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {\r
+                       // Ensure incomingProxyMessageDispatcher is null\r
+                       if (_incomingProxyMessageDispatcher != null) {\r
+                               _incomingProxyMessageDispatcher.dispose();\r
+                               _incomingProxyMessageDispatcher = null;\r
+                       }\r
+                       \r
+                       _incomingProxyMessageDispatcher = new ProxyMessageDispatcher<ProtocolMessage>("INCOMING_MESSAGE_DISPATCHER",\r
+                                       new IncomingProtocolMessageComparitor(),\r
+                                       new IDispatchingStrategy<ProtocolMessage>() {\r
+                                               @Override\r
+                                               public void dispatch(ProtocolMessage message) {\r
+                                                       dispatchIncomingMessage((ProtocolMessage)message);\r
+                                               }\r
+       \r
+                                               @Override\r
+                                               public void handleDispatchingError(String info, Exception ex) {\r
+                                                       handleErrorsFromIncomingMessageDispatcher(info, ex);\r
+                                               }\r
+       \r
+                                               @Override\r
+                                               public void handleQueueingError(String info, Exception ex) {\r
+                                                       handleErrorsFromIncomingMessageDispatcher(info, ex);\r
+                                               }                       \r
+                       });\r
+               }\r
+               \r
+               // Setup Outgoing ProxyMessage Dispatcher\r
+               synchronized(OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) {\r
+                       // Ensure outgoingProxyMessageDispatcher is null\r
+                       if (_outgoingProxyMessageDispatcher != null) {\r
+                               _outgoingProxyMessageDispatcher.dispose();\r
+                               _outgoingProxyMessageDispatcher = null;\r
+                       }\r
+                       \r
+                       _outgoingProxyMessageDispatcher = new ProxyMessageDispatcher<ProtocolMessage>("OUTGOING_MESSAGE_DISPATCHER",\r
+                                       new OutgoingProtocolMessageComparitor(),\r
+                                       new IDispatchingStrategy<ProtocolMessage>() {\r
+                                               @Override\r
+                                               public void dispatch(ProtocolMessage message) {\r
+                                                       dispatchOutgoingMessage((ProtocolMessage)message);\r
+                                               }\r
+       \r
+                                               @Override\r
+                                               public void handleDispatchingError(String info, Exception ex) {\r
+                                                       handleErrorsFromOutgoingMessageDispatcher(info, ex);\r
+                                               }\r
+       \r
+                                               @Override\r
+                                               public void handleQueueingError(String info, Exception ex) {\r
+                                                       handleErrorsFromOutgoingMessageDispatcher(info, ex);\r
+                                               }\r
+                       });\r
+               }\r
+               \r
+               // Initialize the proxy\r
+               try {\r
+                       initializeProxy();\r
+               } catch (SmartDeviceLinkException e) {\r
+                       // Couldn't initialize the proxy \r
+                       // Dispose threads and then rethrow exception\r
+                       \r
+                       if (_internalProxyMessageDispatcher != null) {\r
+                               _internalProxyMessageDispatcher.dispose();\r
+                               _internalProxyMessageDispatcher = null;\r
+                       }\r
+                       if (_incomingProxyMessageDispatcher != null) {\r
+                               _incomingProxyMessageDispatcher.dispose();\r
+                               _incomingProxyMessageDispatcher = null;\r
+                       }\r
+                       if (_outgoingProxyMessageDispatcher != null) {\r
+                               _outgoingProxyMessageDispatcher.dispose();\r
+                               _outgoingProxyMessageDispatcher = null;\r
+                       }\r
+                       throw e;\r
+               } \r
+               \r
+               // Trace that ctor has fired\r
+               SmartDeviceLinkTrace.logProxyEvent("SmartDeviceLinkProxy Created, instanceID=" + this.toString(), SMARTDEVICELINK_LIB_TRACE_KEY);\r
+       }\r
+\r
+       private Intent createBroadcastIntent()\r
+       {\r
+               Intent sendIntent = new Intent();\r
+               sendIntent.setAction("com.smartdevicelink.broadcast");\r
+               sendIntent.putExtra("APP_NAME", this._applicationName);\r
+               sendIntent.putExtra("APP_ID", this._appID);\r
+               sendIntent.putExtra("RPC_NAME", "");\r
+               sendIntent.putExtra("TYPE", "");\r
+               sendIntent.putExtra("SUCCESS", true);\r
+               sendIntent.putExtra("CORRID", 0);\r
+               sendIntent.putExtra("FUNCTION_NAME", "");\r
+               sendIntent.putExtra("COMMENT1", "");\r
+               sendIntent.putExtra("COMMENT2", "");\r
+               sendIntent.putExtra("COMMENT3", "");\r
+               sendIntent.putExtra("COMMENT4", "");\r
+               sendIntent.putExtra("COMMENT5", "");\r
+               sendIntent.putExtra("COMMENT6", "");\r
+               sendIntent.putExtra("COMMENT7", "");\r
+               sendIntent.putExtra("COMMENT8", "");\r
+               sendIntent.putExtra("COMMENT9", "");\r
+               sendIntent.putExtra("COMMENT10", "");\r
+               sendIntent.putExtra("DATA", "");\r
+               sendIntent.putExtra("SHOW_ON_UI", true);\r
+               return sendIntent;\r
+       }\r
+       private void updateBroadcastIntent(Intent sendIntent, String sKey, String sValue)\r
+       {\r
+               sendIntent.putExtra(sKey, sValue);              \r
+       }\r
+       private void updateBroadcastIntent(Intent sendIntent, String sKey, boolean bValue)\r
+       {\r
+               sendIntent.putExtra(sKey, bValue);              \r
+       }\r
+       private void updateBroadcastIntent(Intent sendIntent, String sKey, int iValue)\r
+       {\r
+               sendIntent.putExtra(sKey, iValue);              \r
+       }\r
+       \r
+       private void sendBroadcastIntent(Intent sendIntent)\r
+       {\r
+               Service myService = null;               \r
+               if (_proxyListener != null && _proxyListener instanceof Service)\r
+               {\r
+                       myService = (Service) _proxyListener;                           \r
+               }\r
+               else if (_appService != null)\r
+               {\r
+                       myService = _appService;\r
+               }\r
+               else\r
+               {\r
+                       return;\r
+               }               \r
+               Context myContext = myService.getApplicationContext();                          \r
+               if (myContext != null) myContext.sendBroadcast(sendIntent);             \r
+       }\r
+\r
+       /**\r
+        * send encoded SmartDeviceLink data to Url\r
+        * @param urlString\r
+        * @param encodedSyncPData\r
+        * @param timeout\r
+        */\r
+       private void sendEncodedSyncPDataToUrl(String urlString, Vector<String> encodedSyncPData, Integer timeout) {            \r
+               \r
+       }\r
+\r
+       /**\r
+        * send encoded SmartDeviceLink data to Url\r
+        * @param urlString\r
+        * @param bs\r
+        * @param timeout\r
+        */\r
+       private void sendSyncPDataToUrl(String urlString, byte[] bs, Integer timeout) {\r
+\r
+       }\r
+\r
+       // Test correlationID\r
+       private boolean isCorrelationIDProtected(Integer correlationID) {\r
+               if (correlationID != null && \r
+                               (REGISTER_APP_INTERFACE_CORRELATION_ID == correlationID\r
+                                               || UNREGISTER_APP_INTERFACE_CORRELATION_ID == correlationID\r
+                                               || POLICIES_CORRELATION_ID == correlationID)) {\r
+                       return true;\r
+               }\r
+               \r
+               return false;\r
+       }\r
+       \r
+       // Protected isConnected method to allow legacy proxy to poll isConnected state\r
+       public Boolean getIsConnected() {\r
+               return _smartDeviceLinkConnection.getIsConnected();\r
+       }\r
+       \r
+       /**\r
+        * Returns whether the application is registered in SMARTDEVICELINK. Note: for testing\r
+        * purposes, it's possible that the connection is established, but the\r
+        * application is not registered.\r
+        * \r
+        * @return true if the application is registered in SMARTDEVICELINK\r
+        */\r
+       public Boolean getAppInterfaceRegistered() {\r
+               return _appInterfaceRegisterd;\r
+       }\r
+\r
+       // Function to initialize new proxy connection\r
+       private void initializeProxy() throws SmartDeviceLinkException {                \r
+               // Reset all of the flags and state variables\r
+               _haveReceivedFirstNonNoneHMILevel = false;\r
+               _haveReceivedFirstFocusLevel = false;\r
+               _haveReceivedFirstFocusLevelFull = false;\r
+               _smartDeviceLinkIntefaceAvailablity = SmartDeviceLinkInterfaceAvailability.SMARTDEVICELINK_INTERFACE_UNAVAILABLE;\r
+                               \r
+               // Setup smartDeviceLinkConnection\r
+               synchronized(CONNECTION_REFERENCE_LOCK) {\r
+                       if (_smartDeviceLinkConnection != null) {\r
+                               _smartDeviceLinkConnection.closeConnection(_rpcSessionID);\r
+                               _smartDeviceLinkConnection = null;\r
+                       }\r
+                       _smartDeviceLinkConnection = new smartDeviceLinkConnection(_interfaceBroker, _transportConfig);\r
+                       SmartDeviceLinkProtocol protocol = (SmartDeviceLinkProtocol)_smartDeviceLinkConnection.getSmartDeviceLinkProtocolProtocol();\r
+                       protocol.setVersion(_sdlproVersion);\r
+               }\r
+               \r
+               synchronized(CONNECTION_REFERENCE_LOCK) {\r
+                       if (_smartDeviceLinkConnection != null) {\r
+                               _smartDeviceLinkConnection.startTransport();\r
+                       }\r
+               }\r
+       }\r
+       \r
+       /**\r
+        *  Public method to enable the siphon transport\r
+        */\r
+       public static void enableSiphonDebug() {\r
+               SiphonServer.enableSiphonServer();\r
+       }\r
+       \r
+       /**\r
+        *  Public method to disable the Siphon Trace Server\r
+        */\r
+       public static void disableSiphonDebug() {\r
+               SiphonServer.disableSiphonServer();\r
+       }       \r
+       \r
+       /**\r
+        *  Public method to enable the Debug Tool\r
+        */\r
+       public static void enableDebugTool() {\r
+               DebugTool.enableDebugTool();\r
+       }\r
+       \r
+       /**\r
+        *  Public method to disable the Debug Tool\r
+        */\r
+       public static void disableDebugTool() {\r
+               DebugTool.disableDebugTool();\r
+       }       \r
+\r
+       /**\r
+       * Public method to determine Debug Tool enabled\r
+       */\r
+       public static boolean isDebugEnabled() {\r
+               return DebugTool.isDebugEnabled();\r
+       }       \r
+       \r
+       \r
+       @Deprecated\r
+       public void close() throws SmartDeviceLinkException {\r
+               dispose();\r
+       }\r
+       \r
+       private void cleanProxy(SmartDeviceLinkDisconnectedReason disconnectedReason) throws SmartDeviceLinkException {\r
+               try {\r
+                       \r
+                       // ALM Specific Cleanup\r
+                       if (_advancedLifecycleManagementEnabled) {\r
+                               _smartDeviceLinkConnectionState = SmartDeviceLinkConnectionState.SMARTDEVICELINK_DISCONNECTED;\r
+                               \r
+                               firstTimeFull = true;\r
+                       \r
+                               // Should we wait for the interface to be unregistered?\r
+                               Boolean waitForInterfaceUnregistered = false;\r
+                               // Unregister app interface\r
+                               synchronized(CONNECTION_REFERENCE_LOCK) {\r
+                                       if (_appInterfaceRegisterd == true && _smartDeviceLinkConnection != null && _smartDeviceLinkConnection.getIsConnected()) {\r
+                                               waitForInterfaceUnregistered = true;\r
+                                               unregisterAppInterfacePrivate(UNREGISTER_APP_INTERFACE_CORRELATION_ID);\r
+                                       }\r
+                               }\r
+                               \r
+                               // Wait for the app interface to be unregistered\r
+                               if (waitForInterfaceUnregistered) {\r
+                                       synchronized(APP_INTERFACE_REGISTERED_LOCK) {\r
+                                               try {\r
+                                                       APP_INTERFACE_REGISTERED_LOCK.wait(1000);\r
+                                               } catch (InterruptedException e) {\r
+                                                       // Do nothing\r
+                                               }\r
+                                       }\r
+                               }\r
+                       }\r
+                       \r
+                       // Clean up SMARTDEVICELINK Connection\r
+                       synchronized(CONNECTION_REFERENCE_LOCK) {\r
+                               if (_smartDeviceLinkConnection != null) {\r
+                                       _smartDeviceLinkConnection.closeConnection(_rpcSessionID);\r
+                                       _smartDeviceLinkConnection = null;\r
+                               }\r
+                       }               \r
+               } catch (SmartDeviceLinkException e) {\r
+                       throw e;\r
+               } finally {\r
+                       SmartDeviceLinkTrace.logProxyEvent("SmartDeviceLinkProxy cleaned.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
+               }\r
+       }\r
+       \r
+       /**\r
+        * Terminates the App's Interface Registration, closes the transport connection, ends the protocol session, and frees any resources used by the proxy.\r
+        */\r
+       public void dispose() throws SmartDeviceLinkException\r
+       {               \r
+               if (_proxyDisposed) {\r
+                       throw new SmartDeviceLinkException("This object has been disposed, it is no long capable of executing methods.", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_PROXY_DISPOSED);\r
+               }\r
+               \r
+               _proxyDisposed = true;\r
+               \r
+               SmartDeviceLinkTrace.logProxyEvent("Application called dispose() method.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
+               \r
+               try{\r
+                       // Clean the proxy\r
+                       cleanProxy(SmartDeviceLinkDisconnectedReason.APPLICATION_REQUESTED_DISCONNECT);\r
+               \r
+                       // Close IncomingProxyMessageDispatcher thread\r
+                       synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {\r
+                               if (_incomingProxyMessageDispatcher != null) {\r
+                                       _incomingProxyMessageDispatcher.dispose();\r
+                                       _incomingProxyMessageDispatcher = null;\r
+                               }\r
+                       }\r
+                       \r
+                       // Close OutgoingProxyMessageDispatcher thread\r
+                       synchronized(OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) {\r
+                               if (_outgoingProxyMessageDispatcher != null) {\r
+                                       _outgoingProxyMessageDispatcher.dispose();\r
+                                       _outgoingProxyMessageDispatcher = null;\r
+                               }\r
+                       }\r
+                       \r
+                       // Close InternalProxyMessageDispatcher thread\r
+                       synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {\r
+                               if (_internalProxyMessageDispatcher != null) {\r
+                                       _internalProxyMessageDispatcher.dispose();\r
+                                       _internalProxyMessageDispatcher = null;\r
+                               }\r
+                       }\r
+                       \r
+                       _traceDeviceInterrogator = null;\r
+               } catch (SmartDeviceLinkException e) {\r
+                       throw e;\r
+               } finally {\r
+                       SmartDeviceLinkTrace.logProxyEvent("SmartDeviceLinkProxy disposed.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
+               }\r
+       } // end-method\r
+\r
+       // Method to cycle the proxy, only called in ALM\r
+       protected void cycleProxy(SmartDeviceLinkDisconnectedReason disconnectedReason) {               \r
+               try{\r
+                       cleanProxy(disconnectedReason);\r
+                       initializeProxy();      \r
+                       notifyProxyClosed("SMARTDEVICELINK Proxy Cycled", new SmartDeviceLinkException("SMARTDEVICELINK Proxy Cycled", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_PROXY_CYCLED));\r
+               } catch (SmartDeviceLinkException e) {\r
+                       switch(e.getSmartDeviceLinkExceptionCause()) {\r
+                       case BLUETOOTH_DISABLED:\r
+                               notifyProxyClosed("Bluetooth is disabled. Bluetooth must be enabled to connect to SMARTDEVICELINK. Reattempt a connection once Bluetooth is enabled.", \r
+                                               new SmartDeviceLinkException("Bluetooth is disabled. Bluetooth must be enabled to connect to SMARTDEVICELINK. Reattempt a connection once Bluetooth is enabled.", SmartDeviceLinkExceptionCause.BLUETOOTH_DISABLED));\r
+                               break;\r
+                       case BLUETOOTH_ADAPTER_NULL:\r
+                               notifyProxyClosed("Cannot locate a Bluetooth adapater. A SMARTDEVICELINK connection is impossible on this device until a Bluetooth adapter is added.", \r
+                                               new SmartDeviceLinkException("Cannot locate a Bluetooth adapater. A SMARTDEVICELINK connection is impossible on this device until a Bluetooth adapter is added.", SmartDeviceLinkExceptionCause.BLUETOOTH_ADAPTER_NULL));\r
+                               break;\r
+                       default :\r
+                               notifyProxyClosed("Cycling the proxy failed.", e);\r
+                               break;\r
+                       }\r
+               } catch (Exception e) { \r
+                       notifyProxyClosed("Cycling the proxy failed.", e);\r
+               }\r
+       }\r
+\r
+       \r
+       \r
+       /************* Functions used by the Message Dispatching Queues ****************/\r
+       private void dispatchIncomingMessage(ProtocolMessage message) {\r
+               try{\r
+                       // Dispatching logic\r
+                       if (message.getSessionType().equals(SessionType.RPC)) {\r
+                               try {\r
+                                       if (_sdlproVersion == 1) {\r
+                                               if (message.getVersion() == 2) setsdlproVersion(message.getVersion());\r
+                                       }\r
+                                       \r
+                                       Hashtable hash = new Hashtable();\r
+                                       if (_sdlproVersion == 2) {\r
+                                               Hashtable hashTemp = new Hashtable();\r
+                                               hashTemp.put(Names.correlationID, message.getCorrID());\r
+                                               if (message.getJsonSize() > 0) {\r
+                                                       final Hashtable<String, Object> mhash = JsonRPCMarshaller.unmarshall(message.getData());\r
+                                                       //hashTemp.put(Names.parameters, mhash.get(Names.parameters));\r
+                                                       hashTemp.put(Names.parameters, mhash);\r
+                                               }\r
+                                               FunctionID functionID = new FunctionID();\r
+                                               hashTemp.put(Names.function_name, functionID.getFunctionName(message.getFunctionID()));\r
+                                               if (message.getRPCType() == 0x00) {\r
+                                                       hash.put(Names.request, hashTemp);\r
+                                               } else if (message.getRPCType() == 0x01) {\r
+                                                       hash.put(Names.response, hashTemp);\r
+                                               } else if (message.getRPCType() == 0x02) {\r
+                                                       hash.put(Names.notification, hashTemp);\r
+                                               }\r
+                                               if (message.getBulkData() != null) hash.put(Names.bulkData, message.getBulkData());\r
+                                       } else {\r
+                                               final Hashtable<String, Object> mhash = JsonRPCMarshaller.unmarshall(message.getData());\r
+                                               hash = mhash;\r
+                                       }\r
+                                       handleRPCMessage(hash);                                                 \r
+                               } catch (final Exception excp) {\r
+                                       DebugTool.logError("Failure handling protocol message: " + excp.toString(), excp);\r
+                                       passErrorToProxyListener("Error handing incoming protocol message.", excp);\r
+                               } // end-catch\r
+                       } else {\r
+                               // Handle other protocol message types here\r
+                       }\r
+               } catch (final Exception e) {\r
+                       // Pass error to application through listener \r
+                       DebugTool.logError("Error handing proxy event.", e);\r
+                       passErrorToProxyListener("Error handing incoming protocol message.", e);\r
+               }\r
+       }\r
+       \r
+       private byte getsdlproVersion() {\r
+               return this._sdlproVersion;\r
+       }\r
+       \r
+       private void setsdlproVersion(byte version) {\r
+               this._sdlproVersion = version;\r
+       }\r
+       \r
+       public String serializeJSON(RPCMessage msg)\r
+       {\r
+               String sReturn = null;          \r
+               try\r
+               {\r
+                       sReturn = msg.serializeJSON(getsdlproVersion()).toString(2);\r
+               }\r
+               catch (final Exception e) \r
+               {\r
+                       DebugTool.logError("Error handing proxy event.", e);\r
+                       passErrorToProxyListener("Error serializing message.", e);\r
+                       return null;\r
+               }\r
+               return sReturn;\r
+       }\r
+\r
+       private void handleErrorsFromIncomingMessageDispatcher(String info, Exception e) {\r
+               passErrorToProxyListener(info, e);\r
+       }\r
+       \r
+       private void dispatchOutgoingMessage(ProtocolMessage message) {\r
+               synchronized(CONNECTION_REFERENCE_LOCK) {\r
+                       if (_smartDeviceLinkConnection != null) {\r
+                               _smartDeviceLinkConnection.sendMessage(message);\r
+                       }\r
+               }               \r
+               SmartDeviceLinkTrace.logProxyEvent("SmartDeviceLinkProxy sending Protocol Message: " + message.toString(), SMARTDEVICELINK_LIB_TRACE_KEY);\r
+       }\r
+       \r
+       private void handleErrorsFromOutgoingMessageDispatcher(String info, Exception e) {\r
+               passErrorToProxyListener(info, e);\r
+       }\r
+       \r
+       void dispatchInternalMessage(final InternalProxyMessage message) {\r
+               try{\r
+                       if (message.getFunctionName().equals(Names.OnProxyError)) {\r
+                               final OnError msg = (OnError)message;                   \r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onError(msg.getInfo(), msg.getException());\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onError(msg.getInfo(), msg.getException());\r
+                               }\r
+                       /**************Start Legacy Specific Call-backs************/\r
+                       } else if (message.getFunctionName().equals(Names.OnProxyOpened)) {\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       ((IProxyListener)_proxyListener).onProxyOpened();\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       ((IProxyListener)_proxyListener).onProxyOpened();\r
+                               }\r
+                       } else if (message.getFunctionName().equals(Names.OnProxyClosed)) {\r
+                               final OnProxyClosed msg = (OnProxyClosed)message;\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onProxyClosed(msg.getInfo(), msg.getException());\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onProxyClosed(msg.getInfo(), msg.getException());\r
+                               }\r
+                       /****************End Legacy Specific Call-backs************/\r
+                       } else {\r
+                               // Diagnostics\r
+                               SmartDeviceLinkTrace.logProxyEvent("Unknown RPC Message encountered. Check for an updated version of the SMARTDEVICELINK Proxy.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
+                               DebugTool.logError("Unknown RPC Message encountered. Check for an updated version of the SMARTDEVICELINK Proxy.");\r
+                       }\r
+                       \r
+               SmartDeviceLinkTrace.logProxyEvent("Proxy fired callback: " + message.getFunctionName(), SMARTDEVICELINK_LIB_TRACE_KEY);\r
+               } catch(final Exception e) {\r
+                       // Pass error to application through listener \r
+                       DebugTool.logError("Error handing proxy event.", e);\r
+                       if (_callbackToUIThread) {\r
+                               // Run in UI thread\r
+                               _mainUIHandler.post(new Runnable() {\r
+                                       @Override\r
+                                       public void run() {\r
+                                               _proxyListener.onError("Error handing proxy event.", e);\r
+                                       }\r
+                               });\r
+                       } else {\r
+                               _proxyListener.onError("Error handing proxy event.", e);\r
+                       }\r
+               }\r
+       }\r
+       \r
+       private void handleErrorsFromInternalMessageDispatcher(String info, Exception e) {\r
+               DebugTool.logError(info, e);\r
+               // This error cannot be passed to the user, as it indicates an error\r
+               // in the communication between the proxy and the application.\r
+               \r
+               DebugTool.logError("InternalMessageDispatcher failed.", e);\r
+               \r
+               // Note, this is the only place where the _proxyListener should be referenced asmartDeviceLinkhronously,\r
+               // with an error on the internalMessageDispatcher, we have no other reliable way of \r
+               // communicating with the application.\r
+               notifyProxyClosed("Proxy callback dispatcher is down. Proxy instance is invalid.", e);\r
+               _proxyListener.onError("Proxy callback dispatcher is down. Proxy instance is invalid.", e);\r
+       }\r
+       /************* END Functions used by the Message Dispatching Queues ****************/\r
+       \r
+       // Private sendPRCRequest method. All RPCRequests are funneled through this method after\r
+               // error checking. \r
+       private void sendRPCRequestPrivate(RPCRequest request) throws SmartDeviceLinkException {\r
+                       try {\r
+                       SmartDeviceLinkTrace.logRPCEvent(InterfaceActivityDirection.Transmit, request, SMARTDEVICELINK_LIB_TRACE_KEY);\r
+                                               \r
+                       byte[] msgBytes = JsonRPCMarshaller.marshall(request, _sdlproVersion);\r
+       \r
+                       ProtocolMessage pm = new ProtocolMessage();\r
+                       pm.setData(msgBytes);\r
+                       pm.setSessionID(_rpcSessionID);\r
+                       pm.setMessageType(MessageType.RPC);\r
+                       pm.setSessionType(SessionType.RPC);\r
+                       pm.setFunctionID(FunctionID.getFunctionID(request.getFunctionName()));\r
+                       pm.setCorrID(request.getCorrelationID());\r
+                       if (request.getBulkData() != null) \r
+                               pm.setBulkData(request.getBulkData());\r
+                       \r
+                       // Queue this outgoing message\r
+                       synchronized(OUTGOING_MESSAGE_QUEUE_THREAD_LOCK) {\r
+                               if (_outgoingProxyMessageDispatcher != null) {\r
+                                       _outgoingProxyMessageDispatcher.queueMessage(pm);\r
+                               }\r
+                       }\r
+               } catch (OutOfMemoryError e) {\r
+                       SmartDeviceLinkTrace.logProxyEvent("OutOfMemory exception while sending request " + request.getFunctionName(), SMARTDEVICELINK_LIB_TRACE_KEY);\r
+                       throw new SmartDeviceLinkException("OutOfMemory exception while sending request " + request.getFunctionName(), e, SmartDeviceLinkExceptionCause.INVALID_ARGUMENT);\r
+               }\r
+       }\r
+       \r
+       private void handleRPCMessage(Hashtable hash) {\r
+               RPCMessage rpcMsg = new RPCMessage(hash);\r
+               String functionName = rpcMsg.getFunctionName();\r
+               String messageType = rpcMsg.getMessageType();\r
+               \r
+               if (messageType.equals(Names.response)) {                       \r
+                       SmartDeviceLinkTrace.logRPCEvent(InterfaceActivityDirection.Receive, new RPCResponse(rpcMsg), SMARTDEVICELINK_LIB_TRACE_KEY);\r
+\r
+                       // Check to ensure response is not from an internal message (reserved correlation ID)\r
+                       if (isCorrelationIDProtected((new RPCResponse(hash)).getCorrelationID())) {\r
+                               // This is a response generated from an internal message, it can be trapped here\r
+                               // The app should not receive a response for a request it did not send\r
+                               if ((new RPCResponse(hash)).getCorrelationID() == REGISTER_APP_INTERFACE_CORRELATION_ID \r
+                                               && _advancedLifecycleManagementEnabled \r
+                                               && functionName.equals(Names.RegisterAppInterface)) {\r
+                                       final RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse(hash);\r
+                                       if (msg.getSuccess()) {\r
+                                               _appInterfaceRegisterd = true;\r
+                                       }\r
+                                       \r
+                                       //_autoActivateIdReturned = msg.getAutoActivateID();\r
+                                       /*Place holder for legacy support*/ _autoActivateIdReturned = "8675309";\r
+                                       _buttonCapabilities = msg.getButtonCapabilities();\r
+                                       _displayCapabilities = msg.getDisplayCapabilities();\r
+                                       _softButtonCapabilities = msg.getSoftButtonCapabilities();\r
+                                       _presetBankCapabilities = msg.getPresetBankCapabilities();\r
+                                       _hmiZoneCapabilities = msg.getHmiZoneCapabilities();\r
+                                       _speechCapabilities = msg.getSpeechCapabilities();\r
+                                       _smartDeviceLinkLanguage = msg.getLanguage();\r
+                                       _hmiDisplayLanguage = msg.getHmiDisplayLanguage();\r
+                                       _smartDeviceLinkMsgVersion = msg.getsmartdevicelinkMsgVersion();\r
+                                       _vrCapabilities = msg.getVrCapabilities();\r
+                                       _vehicleType = msg.getVehicleType();\r
+                                       _proxyVersionInfo = msg.getProxyVersionInfo();\r
+                                       \r
+                                       String sVersionInfo = "SMARTDEVICELINK Proxy Version: " + _proxyVersionInfo;\r
+                                       \r
+                                       Class<?> cls = null;\r
+                                       try \r
+                                       {\r
+                                               cls = Class.forName(Names.VersionExtend);\r
+                                               Object t = cls.newInstance();                                           \r
+                                               Method meth = cls.getDeclaredMethod("getVersionInfo", null);                                                                                                                    \r
+                                               final Object ver = meth.invoke(t, null);                                                \r
+                                               String sValue = ver.toString();                                 \r
+                                               sVersionInfo += "\r\n" + "ExtendedLib Version: " + sValue;                                              \r
+                                       } \r
+                                       catch (Exception e) \r
+                                       {\r
+                                               //Extended info does not exist\r
+                                       }\r
+                                                                               \r
+                                       if (!isDebugEnabled()) \r
+                                       {\r
+                                               enableDebugTool();\r
+                                               DebugTool.logInfo(sVersionInfo, false);\r
+                                               disableDebugTool();\r
+                                       }                                       \r
+                                       else\r
+                                               DebugTool.logInfo(sVersionInfo, false);\r
+                                       \r
+                                       // Send onSmartDeviceLinkConnected message in ALM\r
+                                       _smartDeviceLinkConnectionState = SmartDeviceLinkConnectionState.SMARTDEVICELINK_CONNECTED;\r
+                                       \r
+                                       // If registerAppInterface failed, exit with OnProxyUnusable\r
+                                       if (!msg.getSuccess()) {\r
+                                               notifyProxyClosed("Unable to register app interface. Review values passed to the SMARTDEVICELINK Proxy constructor. RegisterAppInterface result code: ", \r
+                                                               new SmartDeviceLinkException("Unable to register app interface. Review values passed to the SmartDeviceLinkProxy constructor. RegisterAppInterface result code: " + msg.getResultCode(), SmartDeviceLinkExceptionCause.SMARTDEVICELINK_REGISTRATION_ERROR));\r
+                                       }\r
+                                       \r
+                                       if (_callbackToUIThread) {\r
+                                               // Run in UI thread\r
+                                               _mainUIHandler.post(new Runnable() {\r
+                                                       @Override\r
+                                                       public void run() {\r
+                                                               if (_proxyListener instanceof IProxyListener) {\r
+                                                                       ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);\r
+                                                               } else if (_proxyListener instanceof IProxyListenerALM) {\r
+                                                                       //((IProxyListenerALM)_proxyListener).onRegisterAppInterfaceResponse(msg);\r
+                                                               }\r
+                                                       }\r
+                                               });\r
+                                       } else {\r
+                                               if (_proxyListener instanceof IProxyListener) {\r
+                                                       ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);\r
+                                               } else if (_proxyListener instanceof IProxyListenerALM) {\r
+                                                       //((IProxyListenerALM)_proxyListener).onRegisterAppInterfaceResponse(msg);\r
+                                               }\r
+                                       }\r
+                               } else if ((new RPCResponse(hash)).getCorrelationID() == POLICIES_CORRELATION_ID \r
+                                               && functionName.equals(Names.OnEncodedSyncPData)) {\r
+                                       // OnEncodedSyncPData\r
+                                       final OnEncodedSyncPData msg = new OnEncodedSyncPData(hash);\r
+\r
+                                       // If url is not null, then send to URL\r
+                                       if (msg.getUrl() != null) {\r
+                                               // URL has data, attempt to post request to external server\r
+                                               Thread handleOffboardSmartDeviceLinkTransmissionTread = new Thread() {\r
+                                                       @Override\r
+                                                       public void run() {\r
+                                                               sendEncodedSyncPDataToUrl(msg.getUrl(), msg.getData(), msg.getTimeout());\r
+                                                       }\r
+                                               };\r
+\r
+                                               handleOffboardSmartDeviceLinkTransmissionTread.start();\r
+                                       } \r
+                                       \r
+                               } else if ((new RPCResponse(hash)).getCorrelationID() == POLICIES_CORRELATION_ID \r
+                                               && functionName.equals(Names.OnSyncPData)) {\r
+                                       // OnSyncPData\r
+                                       final OnSyncPData msg = new OnSyncPData(hash);\r
+\r
+                                       // If url is not null, then send to URL\r
+                                       if (msg.getUrl() != null) {\r
+                                               // URL has data, attempt to post request to external server\r
+                                               Thread handleOffboardSmartDeviceLinkTransmissionTread = new Thread() {\r
+                                                       @Override\r
+                                                       public void run() {\r
+                                                               sendSyncPDataToUrl(msg.getUrl(), msg.getSyncPData(), msg.getTimeout());\r
+                                                       }\r
+                                               };\r
+\r
+                                               handleOffboardSmartDeviceLinkTransmissionTread.start();\r
+                                       } \r
+                               }\r
+                               else if ((new RPCResponse(hash)).getCorrelationID() == POLICIES_CORRELATION_ID \r
+                                               && functionName.equals(Names.EncodedSyncPData)) {\r
+                                       // EncodedSyncPData\r
+                                       final EncodedSyncPDataResponse msg = new EncodedSyncPDataResponse(hash);\r
+                                       \r
+                                       Intent sendIntent = createBroadcastIntent();\r
+                                       updateBroadcastIntent(sendIntent, "RPC_NAME", Names.EncodedSyncPData);\r
+                                       updateBroadcastIntent(sendIntent, "TYPE", Names.response);\r
+                                       updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());\r
+                                       updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());\r
+                                       updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());\r
+                                       updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());\r
+                                       sendBroadcastIntent(sendIntent);\r
+                               }                               \r
+                               return;\r
+                       }\r
+                       \r
+                       if (functionName.equals(Names.RegisterAppInterface)) {\r
+                               final RegisterAppInterfaceResponse msg = new RegisterAppInterfaceResponse(hash);\r
+                               if (msg.getSuccess()) {\r
+                                       _appInterfaceRegisterd = true;\r
+                               }\r
+\r
+                               //_autoActivateIdReturned = msg.getAutoActivateID();\r
+                               /*Place holder for legacy support*/ _autoActivateIdReturned = "8675309";\r
+                               _buttonCapabilities = msg.getButtonCapabilities();\r
+                               _displayCapabilities = msg.getDisplayCapabilities();\r
+                               _softButtonCapabilities = msg.getSoftButtonCapabilities();\r
+                               _presetBankCapabilities = msg.getPresetBankCapabilities();\r
+                               _hmiZoneCapabilities = msg.getHmiZoneCapabilities();\r
+                               _speechCapabilities = msg.getSpeechCapabilities();\r
+                               _smartDeviceLinkLanguage = msg.getLanguage();\r
+                               _hmiDisplayLanguage = msg.getHmiDisplayLanguage();\r
+                               _smartDeviceLinkMsgVersion = msg.getsmartdevicelinkMsgVersion();\r
+                               _vrCapabilities = msg.getVrCapabilities();\r
+                               _vehicleType = msg.getVehicleType();\r
+                               _proxyVersionInfo = msg.getProxyVersionInfo();\r
+                               \r
+                               if (!isDebugEnabled()) \r
+                               {\r
+                                       enableDebugTool();\r
+                                       DebugTool.logInfo("SMARTDEVICELINK Proxy Version: " + _proxyVersionInfo);\r
+                                       disableDebugTool();\r
+                               }                                       \r
+                               else\r
+                                       DebugTool.logInfo("SMARTDEVICELINK Proxy Version: " + _proxyVersionInfo);                               \r
+                               \r
+                               // RegisterAppInterface\r
+                               if (_advancedLifecycleManagementEnabled) {\r
+                                       \r
+                                       // Send onSmartDeviceLinkConnected message in ALM\r
+                                       _smartDeviceLinkConnectionState = SmartDeviceLinkConnectionState.SMARTDEVICELINK_CONNECTED;\r
+                                       \r
+                                       // If registerAppInterface failed, exit with OnProxyUnusable\r
+                                       if (!msg.getSuccess()) {\r
+                                               notifyProxyClosed("Unable to register app interface. Review values passed to the SmartDeviceLinkProxy constructor. RegisterAppInterface result code: ", \r
+                                                               new SmartDeviceLinkException("Unable to register app interface. Review values passed to the SmartDeviceLinkProxy constructor. RegisterAppInterface result code: " + msg.getResultCode(), SmartDeviceLinkExceptionCause.SMARTDEVICELINK_REGISTRATION_ERROR));\r
+                                       }\r
+                               } else {        \r
+                                       if (_callbackToUIThread) {\r
+                                               // Run in UI thread\r
+                                               _mainUIHandler.post(new Runnable() {\r
+                                                       @Override\r
+                                                       public void run() {\r
+                                                               if (_proxyListener instanceof IProxyListener) {\r
+                                                                       ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);\r
+                                                               } else if (_proxyListener instanceof IProxyListenerALM) {\r
+                                                                       //((IProxyListenerALM)_proxyListener).onRegisterAppInterfaceResponse(msg);\r
+                                                               }\r
+                                                       }\r
+                                               });\r
+                                       } else {\r
+                                               if (_proxyListener instanceof IProxyListener) {\r
+                                                       ((IProxyListener)_proxyListener).onRegisterAppInterfaceResponse(msg);\r
+                                               } else if (_proxyListener instanceof IProxyListenerALM) {\r
+                                                       //((IProxyListenerALM)_proxyListener).onRegisterAppInterfaceResponse(msg);\r
+                                               }\r
+                                       }\r
+                               }\r
+                       } else if (functionName.equals(Names.Speak)) {\r
+                               // SpeakResponse\r
+                               \r
+                               final SpeakResponse msg = new SpeakResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onSpeakResponse(msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onSpeakResponse(msg);                                            \r
+                               }\r
+                       } else if (functionName.equals(Names.Alert)) {\r
+                               // AlertResponse\r
+                               \r
+                               final AlertResponse msg = new AlertResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onAlertResponse(msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onAlertResponse(msg);                                            \r
+                               }\r
+                       } else if (functionName.equals(Names.Show)) {\r
+                               // ShowResponse\r
+                               \r
+                               final ShowResponse msg = new ShowResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onShowResponse((ShowResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onShowResponse((ShowResponse)msg);                                               \r
+                               }\r
+                       } else if (functionName.equals(Names.AddCommand)) {\r
+                               // AddCommand\r
+                               \r
+                               final AddCommandResponse msg = new AddCommandResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onAddCommandResponse((AddCommandResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onAddCommandResponse((AddCommandResponse)msg);                                   \r
+                               }\r
+                       } else if (functionName.equals(Names.DeleteCommand)) {\r
+                               // DeleteCommandResponse\r
+                               \r
+                               final DeleteCommandResponse msg = new DeleteCommandResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onDeleteCommandResponse((DeleteCommandResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onDeleteCommandResponse((DeleteCommandResponse)msg);                                     \r
+                               }\r
+                       } else if (functionName.equals(Names.AddSubMenu)) {\r
+                               // AddSubMenu\r
+                               \r
+                               final AddSubMenuResponse msg = new AddSubMenuResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onAddSubMenuResponse((AddSubMenuResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onAddSubMenuResponse((AddSubMenuResponse)msg);                                   \r
+                               }\r
+                       } else if (functionName.equals(Names.DeleteSubMenu)) {\r
+                               // DeleteSubMenu\r
+                               \r
+                               final DeleteSubMenuResponse msg = new DeleteSubMenuResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onDeleteSubMenuResponse((DeleteSubMenuResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onDeleteSubMenuResponse((DeleteSubMenuResponse)msg);                                     \r
+                               }\r
+                       } else if (functionName.equals(Names.SubscribeButton)) {\r
+                               // SubscribeButton\r
+                               \r
+                               final SubscribeButtonResponse msg = new SubscribeButtonResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onSubscribeButtonResponse((SubscribeButtonResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onSubscribeButtonResponse((SubscribeButtonResponse)msg);                         \r
+                               }\r
+                       } else if (functionName.equals(Names.UnsubscribeButton)) {\r
+                               // UnsubscribeButton\r
+                               \r
+                               final UnsubscribeButtonResponse msg = new UnsubscribeButtonResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onUnsubscribeButtonResponse((UnsubscribeButtonResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onUnsubscribeButtonResponse((UnsubscribeButtonResponse)msg);                     \r
+                               }\r
+                       } else if (functionName.equals(Names.SetMediaClockTimer)) {\r
+                               // SetMediaClockTimer\r
+                               \r
+                               final SetMediaClockTimerResponse msg = new SetMediaClockTimerResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onSetMediaClockTimerResponse((SetMediaClockTimerResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onSetMediaClockTimerResponse((SetMediaClockTimerResponse)msg);           \r
+                               }\r
+                       } else if (functionName.equals(Names.EncodedSyncPData)) {\r
+                               // EncodedSyncPData\r
+                               \r
+                               final EncodedSyncPDataResponse msg = new EncodedSyncPDataResponse(hash);\r
+                               \r
+                               Intent sendIntent = createBroadcastIntent();\r
+                               updateBroadcastIntent(sendIntent, "RPC_NAME", Names.EncodedSyncPData);\r
+                               updateBroadcastIntent(sendIntent, "TYPE", Names.response);\r
+                               updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());\r
+                               updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());\r
+                               updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());\r
+                               updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());\r
+                               sendBroadcastIntent(sendIntent);\r
+\r
+                               try\r
+                               {\r
+                                       Class<?> cls = Class.forName(Names.ListenerExtend);\r
+                                       if (cls.isInstance(_proxyListener))\r
+                                       {\r
+                                               final Object t = cls.cast(_proxyListener);\r
+                                               final Method meth = cls.getDeclaredMethod(Names.onEncodedSyncPDataResponse, new Class[]{EncodedSyncPDataResponse.class});\r
+                                               if (_callbackToUIThread) {\r
+                                                       // Run in UI thread\r
+                                                       _mainUIHandler.post(new Runnable() {\r
+                                                               @Override\r
+                                                               public void run() {\r
+                                                                       try {\r
+                                                                               meth.invoke(t, msg);\r
+                                                                       }\r
+                                                                       catch (Exception e)  {\r
+                                                                               e.printStackTrace();\r
+                                                                       }\r
+                                                               }\r
+                                                       });\r
+                                               } else {\r
+                                                       meth.invoke(t, msg);\r
+                                               }\r
+                                       }\r
+                               }\r
+                               catch (Exception e)\r
+                               {\r
+                                       //private lib not present\r
+                               }\r
+                       } else if (functionName.equals(Names.SyncPData)) {\r
+                               // SyncPData\r
+                               \r
+                               final SyncPDataResponse msg = new SyncPDataResponse(hash);\r
+\r
+                               Intent sendIntent = createBroadcastIntent();\r
+                               updateBroadcastIntent(sendIntent, "RPC_NAME", Names.SyncPData);\r
+                               updateBroadcastIntent(sendIntent, "TYPE", Names.response);\r
+                               updateBroadcastIntent(sendIntent, "SUCCESS", msg.getSuccess());                         \r
+                               updateBroadcastIntent(sendIntent, "COMMENT1", msg.getInfo());\r
+                               updateBroadcastIntent(sendIntent, "COMMENT2", msg.getResultCode().toString());\r
+                               updateBroadcastIntent(sendIntent, "CORRID", msg.getCorrelationID());\r
+                               sendBroadcastIntent(sendIntent);                                \r
+                               try\r
+                               {\r
+                                       Class<?> cls = Class.forName(Names.ListenerExtend);\r
+                                       if (cls.isInstance(_proxyListener))\r
+                                       {\r
+                                               final Object t = cls.cast(_proxyListener);\r
+                                               final Method meth = cls.getDeclaredMethod(Names.onSyncPDataResponse, new Class[]{SyncPDataResponse.class});\r
+                                               if (_callbackToUIThread) {\r
+                                                       // Run in UI thread\r
+                                                       _mainUIHandler.post(new Runnable() {\r
+                                                               @Override\r
+                                                               public void run() {\r
+                                                                       try {\r
+                                                                               meth.invoke(t, msg);\r
+                                                                       }\r
+                                                                       catch (Exception e)  {\r
+                                                                               e.printStackTrace();\r
+                                                                       }\r
+                                                               }\r
+                                                       });\r
+                                               } else {\r
+                                                       meth.invoke(t, msg);\r
+                                               }\r
+                                       }\r
+                               }\r
+                               catch (Exception e)\r
+                               {\r
+                                       //private lib not present\r
+                               }\r
+                       } else if (functionName.equals(Names.CreateInteractionChoiceSet)) {\r
+                               // CreateInteractionChoiceSet\r
+                               \r
+                               final CreateInteractionChoiceSetResponse msg = new CreateInteractionChoiceSetResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onCreateInteractionChoiceSetResponse((CreateInteractionChoiceSetResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onCreateInteractionChoiceSetResponse((CreateInteractionChoiceSetResponse)msg);           \r
+                               }\r
+                       } else if (functionName.equals(Names.DeleteInteractionChoiceSet)) {\r
+                               // DeleteInteractionChoiceSet\r
+                               \r
+                               final DeleteInteractionChoiceSetResponse msg = new DeleteInteractionChoiceSetResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onDeleteInteractionChoiceSetResponse((DeleteInteractionChoiceSetResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onDeleteInteractionChoiceSetResponse((DeleteInteractionChoiceSetResponse)msg);           \r
+                               }\r
+                       } else if (functionName.equals(Names.PerformInteraction)) {\r
+                               // PerformInteraction\r
+                               \r
+                               final PerformInteractionResponse msg = new PerformInteractionResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onPerformInteractionResponse((PerformInteractionResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onPerformInteractionResponse((PerformInteractionResponse)msg);           \r
+                               }\r
+                       } else if (functionName.equals(Names.SetGlobalProperties)) {\r
+                               // SetGlobalPropertiesResponse \r
+                               \r
+                               final SetGlobalPropertiesResponse msg = new SetGlobalPropertiesResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                               // Run in UI thread\r
+                                               _mainUIHandler.post(new Runnable() {\r
+                                                       @Override\r
+                                                       public void run() {\r
+                                                               _proxyListener.onSetGlobalPropertiesResponse((SetGlobalPropertiesResponse)msg);\r
+                                                       }\r
+                                               });\r
+                                       } else {\r
+                                               _proxyListener.onSetGlobalPropertiesResponse((SetGlobalPropertiesResponse)msg);         \r
+                               }\r
+                       } else if (functionName.equals(Names.ResetGlobalProperties)) {\r
+                               // ResetGlobalProperties                                \r
+                               \r
+                               final ResetGlobalPropertiesResponse msg = new ResetGlobalPropertiesResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onResetGlobalPropertiesResponse((ResetGlobalPropertiesResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onResetGlobalPropertiesResponse((ResetGlobalPropertiesResponse)msg);             \r
+                               }\r
+                       } else if (functionName.equals(Names.UnregisterAppInterface)) {\r
+                               // UnregisterAppInterface\r
+                               \r
+                               _appInterfaceRegisterd = false;\r
+                               synchronized(APP_INTERFACE_REGISTERED_LOCK) {\r
+                                       APP_INTERFACE_REGISTERED_LOCK.notify();\r
+                               }\r
+                               \r
+                               final UnregisterAppInterfaceResponse msg = new UnregisterAppInterfaceResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       if (_proxyListener instanceof IProxyListener) {\r
+                                                               ((IProxyListener)_proxyListener).onUnregisterAppInterfaceResponse(msg);\r
+                                                       } else if (_proxyListener instanceof IProxyListenerALM) {\r
+                                                               //((IProxyListenerALM)_proxyListener).onUnregisterAppInterfaceResponse(msg);\r
+                                                       }\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       if (_proxyListener instanceof IProxyListener) {\r
+                                               ((IProxyListener)_proxyListener).onUnregisterAppInterfaceResponse(msg);\r
+                                       } else if (_proxyListener instanceof IProxyListenerALM) {\r
+                                               //((IProxyListenerALM)_proxyListener).onUnregisterAppInterfaceResponse(msg);\r
+                                       }\r
+                               }\r
+                               \r
+                               notifyProxyClosed("UnregisterAppInterfaceResponse", null);\r
+                       } else if (functionName.equals(Names.GenericResponse)) {\r
+                               // GenericResponse (Usually and error)\r
+                               final GenericResponse msg = new GenericResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onGenericResponse((GenericResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onGenericResponse((GenericResponse)msg); \r
+                               }\r
+                       } else if (functionName.equals(Names.Slider)) {\r
+                // Slider\r
+                final SliderResponse msg = new SliderResponse(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                            _proxyListener.onSliderResponse((SliderResponse)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                    _proxyListener.onSliderResponse((SliderResponse)msg);   \r
+                }\r
+            } else if (functionName.equals(Names.PutFile)) {\r
+                // PutFile\r
+                final PutFileResponse msg = new PutFileResponse(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                            _proxyListener.onPutFileResponse((PutFileResponse)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                    _proxyListener.onPutFileResponse((PutFileResponse)msg);\r
+                }\r
+            } else if (functionName.equals(Names.DeleteFile)) {\r
+                // DeleteFile\r
+                final DeleteFileResponse msg = new DeleteFileResponse(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                            _proxyListener.onDeleteFileResponse((DeleteFileResponse)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                    _proxyListener.onDeleteFileResponse((DeleteFileResponse)msg);   \r
+                }\r
+            } else if (functionName.equals(Names.ListFiles)) {\r
+                // ListFiles\r
+                final ListFilesResponse msg = new ListFilesResponse(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                            _proxyListener.onListFilesResponse((ListFilesResponse)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                    _proxyListener.onListFilesResponse((ListFilesResponse)msg);     \r
+                }\r
+            } else if (functionName.equals(Names.SetAppIcon)) {\r
+                // SetAppIcon\r
+                final SetAppIconResponse msg = new SetAppIconResponse(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                            _proxyListener.onSetAppIconResponse((SetAppIconResponse)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                        _proxyListener.onSetAppIconResponse((SetAppIconResponse)msg);   \r
+                }\r
+            } else if (functionName.equals(Names.ScrollableMessage)) {\r
+                // ScrollableMessage\r
+                final ScrollableMessageResponse msg = new ScrollableMessageResponse(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                            _proxyListener.onScrollableMessageResponse((ScrollableMessageResponse)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                    _proxyListener.onScrollableMessageResponse((ScrollableMessageResponse)msg);     \r
+                }\r
+            } else if (functionName.equals(Names.ChangeRegistration)) {\r
+                // ChangeLanguageRegistration\r
+                final ChangeRegistrationResponse msg = new ChangeRegistrationResponse(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                            _proxyListener.onChangeRegistrationResponse((ChangeRegistrationResponse)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                    _proxyListener.onChangeRegistrationResponse((ChangeRegistrationResponse)msg);   \r
+                }\r
+            } else if (functionName.equals(Names.SetDisplayLayout)) {\r
+                // SetDisplayLayout\r
+                final SetDisplayLayoutResponse msg = new SetDisplayLayoutResponse(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                            _proxyListener.onSetDisplayLayoutResponse((SetDisplayLayoutResponse)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                        _proxyListener.onSetDisplayLayoutResponse((SetDisplayLayoutResponse)msg);\r
+                }\r
+            } else if (functionName.equals(Names.PerformAudioPassThru)) {\r
+                // PerformAudioPassThru\r
+                final PerformAudioPassThruResponse msg = new PerformAudioPassThruResponse(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                            _proxyListener.onPerformAudioPassThruResponse((PerformAudioPassThruResponse)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                    _proxyListener.onPerformAudioPassThruResponse((PerformAudioPassThruResponse)msg);       \r
+                }\r
+            } else if (functionName.equals(Names.EndAudioPassThru)) {\r
+                // EndAudioPassThru\r
+                final EndAudioPassThruResponse msg = new EndAudioPassThruResponse(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                            _proxyListener.onEndAudioPassThruResponse((EndAudioPassThruResponse)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                    _proxyListener.onEndAudioPassThruResponse((EndAudioPassThruResponse)msg);\r
+                }\r
+            } else if (functionName.equals(Names.SubscribeVehicleData)) {\r
+               try {\r
+                                       Class<?> cls = Class.forName(Names.SubscribeVehicleDataExtend);\r
+                                       Constructor con = cls.getConstructor(new Class[]{Hashtable.class});                                                                                                                     \r
+                                       final Object msg = con.newInstance(hash);       \r
+                                       // SubscribeVehicleDataExtend\r
+                       if (_callbackToUIThread) {\r
+                           // Run in UI thread\r
+                           _mainUIHandler.post(new Runnable() {\r
+                               @Override\r
+                               public void run() {\r
+                                   _proxyListener.onSubscribeVehicleDataResponse((SubscribeVehicleDataResponse)msg);\r
+                               }\r
+                           });\r
+                       } else {\r
+                           _proxyListener.onSubscribeVehicleDataResponse((SubscribeVehicleDataResponse)msg);   \r
+                       }                                                                       \r
+                               }                 \r
+               catch(Exception e) {                    \r
+               // SubscribeVehicleData\r
+                       final SubscribeVehicleDataResponse msg = new SubscribeVehicleDataResponse(hash);\r
+                       if (_callbackToUIThread) {\r
+                           // Run in UI thread\r
+                           _mainUIHandler.post(new Runnable() {\r
+                               @Override\r
+                               public void run() {\r
+                                   _proxyListener.onSubscribeVehicleDataResponse((SubscribeVehicleDataResponse)msg);\r
+                               }\r
+                           });\r
+                       } else {\r
+                           _proxyListener.onSubscribeVehicleDataResponse((SubscribeVehicleDataResponse)msg);       \r
+                       }\r
+               }\r
+            } else if (functionName.equals(Names.UnsubscribeVehicleData)) {\r
+               try {\r
+                                       Class<?> cls = Class.forName(Names.UnsubscribeVehicleDataExtend);\r
+                                       Constructor con = cls.getConstructor(new Class[]{Hashtable.class});                                                                                                                     \r
+                                       final Object msg = con.newInstance(hash);       \r
+                                       // UnsubscribeVehicleDataExtend\r
+                       if (_callbackToUIThread) {\r
+                           // Run in UI thread\r
+                           _mainUIHandler.post(new Runnable() {\r
+                               @Override\r
+                               public void run() {\r
+                                   _proxyListener.onUnsubscribeVehicleDataResponse((UnsubscribeVehicleDataResponse)msg);\r
+                               }\r
+                           });\r
+                       } else {\r
+                           _proxyListener.onUnsubscribeVehicleDataResponse((UnsubscribeVehicleDataResponse)msg);   \r
+                       }                                                                       \r
+                               }   \r
+               catch(Exception e) {                                                \r
+                       // UnsubscribeVehicleData\r
+                       final UnsubscribeVehicleDataResponse msg = new UnsubscribeVehicleDataResponse(hash);\r
+                       if (_callbackToUIThread) {\r
+                           // Run in UI thread\r
+                           _mainUIHandler.post(new Runnable() {\r
+                               @Override\r
+                               public void run() {\r
+                                   _proxyListener.onUnsubscribeVehicleDataResponse((UnsubscribeVehicleDataResponse)msg);\r
+                               }\r
+                           });\r
+                       } else {\r
+                           _proxyListener.onUnsubscribeVehicleDataResponse((UnsubscribeVehicleDataResponse)msg);   \r
+                       }\r
+                }\r
+            } else if (functionName.equals(Names.GetVehicleData)) {                                                    \r
+               try {\r
+                                       Class<?> cls = Class.forName(Names.GetVehicleDataExtend);\r
+                                       Constructor con = cls.getConstructor(new Class[]{Hashtable.class});                                                                                                                     \r
+                                       final Object msg = con.newInstance(hash);       \r
+                                       // GetVehicleDataExtend\r
+                       if (_callbackToUIThread) {\r
+                           // Run in UI thread\r
+                           _mainUIHandler.post(new Runnable() {\r
+                               @Override\r
+                               public void run() {\r
+                                   _proxyListener.onGetVehicleDataResponse((GetVehicleDataResponse)msg);\r
+                               }\r
+                           });\r
+                       } else {\r
+                           _proxyListener.onGetVehicleDataResponse((GetVehicleDataResponse)msg);   \r
+                       }                                                                       \r
+                               }   \r
+               catch(Exception e) {\r
+                       // GetVehicleData\r
+                    final GetVehicleDataResponse msg = new GetVehicleDataResponse(hash);\r
+                    if (_callbackToUIThread) {\r
+                        // Run in UI thread\r
+                        _mainUIHandler.post(new Runnable() {\r
+                            @Override\r
+                            public void run() {\r
+                                _proxyListener.onGetVehicleDataResponse((GetVehicleDataResponse)msg);\r
+                            }\r
+                        });\r
+                    } else {\r
+                        _proxyListener.onGetVehicleDataResponse((GetVehicleDataResponse)msg);   \r
+                    }\r
+                            }                                 \r
+            } else if (functionName.equals(Names.ReadDID)) {\r
+                // ReadDID\r
+                final ReadDIDResponse msg = new ReadDIDResponse(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                            _proxyListener.onReadDIDResponse((ReadDIDResponse)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                    _proxyListener.onReadDIDResponse((ReadDIDResponse)msg); \r
+                }\r
+            } else if (functionName.equals(Names.GetDTCs)) {\r
+                // GetDTCs\r
+                final GetDTCsResponse msg = new GetDTCsResponse(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                            _proxyListener.onGetDTCsResponse((GetDTCsResponse)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                    _proxyListener.onGetDTCsResponse((GetDTCsResponse)msg); \r
+                }\r
+            } else if (functionName.equals(Names.AlertManeuver)) {\r
+                               // AlertManeuver\r
+                               final AlertManeuverResponse msg = new AlertManeuverResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onAlertManeuverResponse((AlertManeuverResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onAlertManeuverResponse((AlertManeuverResponse)msg);     \r
+                               }\r
+                       } else if (functionName.equals(Names.ShowConstantTBT)) {\r
+                               // ShowConstantTBT\r
+                               final ShowConstantTBTResponse msg = new ShowConstantTBTResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onShowConstantTBTResponse((ShowConstantTBTResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onShowConstantTBTResponse((ShowConstantTBTResponse)msg); \r
+                               }\r
+                       } else if (functionName.equals(Names.UpdateTurnList)) {\r
+                               // UpdateTurnList\r
+                               final UpdateTurnListResponse msg = new UpdateTurnListResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onUpdateTurnListResponse((UpdateTurnListResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onUpdateTurnListResponse((UpdateTurnListResponse)msg);   \r
+                               }\r
+                       } else if (functionName.equals(Names.DialNumber)) {\r
+                               // DialNumber\r
+                               final DialNumberResponse msg = new DialNumberResponse(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onDialNumberResponse((DialNumberResponse)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onDialNumberResponse((DialNumberResponse)msg);   \r
+                               }\r
+                       } else {\r
+                               if (_smartDeviceLinkMsgVersion != null) {\r
+                                       DebugTool.logError("Unrecognized response Message: " + functionName.toString() + \r
+                                                       "SMARTDEVICELINK Message Version = " + _smartDeviceLinkMsgVersion);\r
+                               } else {\r
+                                       DebugTool.logError("Unrecognized response Message: " + functionName.toString());\r
+                               }\r
+                       } // end-if\r
+               } else if (messageType.equals(Names.notification)) {\r
+                       SmartDeviceLinkTrace.logRPCEvent(InterfaceActivityDirection.Receive, new RPCNotification(rpcMsg), SMARTDEVICELINK_LIB_TRACE_KEY);\r
+                       if (functionName.equals(Names.OnHMIStatus)) {\r
+                               // OnHMIStatus\r
+                               \r
+                               final OnHMIStatus msg = new OnHMIStatus(hash);\r
+                               msg.setFirstRun(new Boolean(firstTimeFull));\r
+                               if (msg.getHmiLevel() == HMILevel.HMI_FULL) firstTimeFull = false;\r
+                               \r
+                               if (msg.getHmiLevel() != _priorHmiLevel && msg.getAudioStreamingState() != _priorAudioStreamingState) {\r
+                                       if (_callbackToUIThread) {\r
+                                               // Run in UI thread\r
+                                               _mainUIHandler.post(new Runnable() {\r
+                                                       @Override\r
+                                                       public void run() {\r
+                                                               _proxyListener.onOnHMIStatus((OnHMIStatus)msg);\r
+                                                       }\r
+                                               });\r
+                                       } else {\r
+                                               _proxyListener.onOnHMIStatus((OnHMIStatus)msg);\r
+                                       }\r
+                               }                               \r
+                       } else if (functionName.equals(Names.OnCommand)) {\r
+                               // OnCommand\r
+                               \r
+                               final OnCommand msg = new OnCommand(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onOnCommand((OnCommand)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onOnCommand((OnCommand)msg);\r
+                               }\r
+                       } else if (functionName.equals(Names.OnDriverDistraction)) {\r
+                               // OnDriverDistration\r
+                               \r
+                               final OnDriverDistraction msg = new OnDriverDistraction(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onOnDriverDistraction(msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onOnDriverDistraction(msg);\r
+                               }\r
+                       } else if (functionName.equals(Names.OnEncodedSyncPData)) {\r
+                               // OnEncodedSyncPData;\r
+                               final OnEncodedSyncPData msg = new OnEncodedSyncPData(hash);\r
+\r
+\r
+                               Intent sendIntent = createBroadcastIntent();\r
+                               updateBroadcastIntent(sendIntent, "RPC_NAME", Names.OnEncodedSyncPData);                                                        \r
+                               updateBroadcastIntent(sendIntent, "TYPE", Names.notification);\r
+                               \r
+                               // If url is null, then send notification to the app, otherwise, send to URL\r
+                               if (msg.getUrl() == null) {\r
+                                       updateBroadcastIntent(sendIntent, "COMMENT1", "URL is a null value (received)");\r
+                                       sendBroadcastIntent(sendIntent);                                        \r
+                                       try\r
+                                       {\r
+                                               Class<?> cls = Class.forName(Names.ListenerExtend);\r
+                                               if (cls.isInstance(_proxyListener))\r
+                                               {\r
+                                                       final Object t = cls.cast(_proxyListener);\r
+                                                       final Method meth = cls.getDeclaredMethod(Names.onOnEncodedSyncPData, new Class[]{OnEncodedSyncPData.class});\r
+                                                       if (_callbackToUIThread) {\r
+                                                               // Run in UI thread\r
+                                                               _mainUIHandler.post(new Runnable() {\r
+                                                                       @Override\r
+                                                                       public void run() {\r
+                                                                               try {\r
+                                                                                       meth.invoke(t, msg);\r
+                                                                               }\r
+                                                                               catch (Exception e)  {\r
+                                                                                       e.printStackTrace();\r
+                                                                               }\r
+                                                                       }\r
+                                                               });\r
+                                                       } else {\r
+                                                               meth.invoke(t, msg);\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                                       catch (Exception e)\r
+                                       {\r
+                                               //private lib not present\r
+                                       }\r
+                               } else {\r
+                                       updateBroadcastIntent(sendIntent, "COMMENT1", "Sending smartDeviceLinkp to cloud: " + msg.getUrl());\r
+                                       sendBroadcastIntent(sendIntent);                                \r
+                                       \r
+                                       // URL has data, attempt to post request to external server\r
+                                       Thread handleOffboardSmartDeviceLinkTransmissionTread = new Thread() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       sendEncodedSyncPDataToUrl(msg.getUrl(), msg.getData(), msg.getTimeout());\r
+                                               }\r
+                                       };\r
+\r
+                                       handleOffboardSmartDeviceLinkTransmissionTread.start();\r
+                               }\r
+                       } else if (functionName.equals(Names.OnSyncPData)) {\r
+                               // OnSyncPData\r
+                               final OnSyncPData msg = new OnSyncPData(hash);\r
+                               Intent sendIntent = createBroadcastIntent();\r
+                               updateBroadcastIntent(sendIntent, "RPC_NAME", Names.OnSyncPData);\r
+                               updateBroadcastIntent(sendIntent, "TYPE", Names.notification);\r
+                               \r
+                               // If url is null, then send notification to the app, otherwise, send to URL\r
+                               if (msg.getUrl() == null) {     \r
+                                       updateBroadcastIntent(sendIntent, "COMMENT1", "URL is a null value (received)");\r
+                                       sendBroadcastIntent(sendIntent);\r
+                                       try\r
+                                       {\r
+                                               Class<?> cls = Class.forName(Names.ListenerExtend);\r
+                                               if (cls.isInstance(_proxyListener))\r
+                                               {\r
+                                                       final Object t = cls.cast(_proxyListener);\r
+                                                       final Method meth = cls.getDeclaredMethod(Names.onOnSyncPData, new Class[]{OnSyncPData.class});\r
+                                                       if (_callbackToUIThread) {\r
+                                                               // Run in UI thread\r
+                                                               _mainUIHandler.post(new Runnable() {\r
+                                                                       @Override\r
+                                                                       public void run() {\r
+                                                                               try {\r
+                                                                                       meth.invoke(t, msg);\r
+                                                                               }\r
+                                                                               catch (Exception e)  {\r
+                                                                                       e.printStackTrace();\r
+                                                                               }\r
+                                                                       }\r
+                                                               });\r
+                                                       } else {\r
+                                                               meth.invoke(t, msg);\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                                       catch (Exception e)\r
+                                       {\r
+                                               //private lib not present\r
+                                       }\r
+                               } else { //url not null, send to url\r
+                                       updateBroadcastIntent(sendIntent, "COMMENT1", "Sending smartDeviceLinkp to cloud: " + msg.getUrl());\r
+                                       sendBroadcastIntent(sendIntent);                                \r
+                                       Log.i("pt", "send smartDeviceLinkp to url");\r
+                                       // URL has data, attempt to post request to external server\r
+                                       Thread handleOffboardSmartDeviceLinkTransmissionTread = new Thread() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       sendSyncPDataToUrl(msg.getUrl(), msg.getSyncPData(), msg.getTimeout());\r
+                                               }\r
+                                       };\r
+\r
+                                       handleOffboardSmartDeviceLinkTransmissionTread.start();\r
+                               }\r
+                       } else if (functionName.equals(Names.OnPermissionsChange)) {\r
+                               //OnPermissionsChange\r
+                               \r
+                               final OnPermissionsChange msg = new OnPermissionsChange(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onOnPermissionsChange(msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onOnPermissionsChange(msg);\r
+                               }\r
+                       } else if (functionName.equals(Names.OnTBTClientState)) {\r
+                               // OnTBTClientState\r
+                               \r
+                               final OnTBTClientState msg = new OnTBTClientState(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onOnTBTClientState(msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onOnTBTClientState(msg);\r
+                               }\r
+                       } else if (functionName.equals(Names.OnButtonPress)) {\r
+                               // OnButtonPress\r
+                               \r
+                               final OnButtonPress msg = new OnButtonPress(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onOnButtonPress((OnButtonPress)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onOnButtonPress((OnButtonPress)msg);\r
+                               }\r
+                       } else if (functionName.equals(Names.OnButtonEvent)) {\r
+                               // OnButtonEvent\r
+                               \r
+                               final OnButtonEvent msg = new OnButtonEvent(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onOnButtonEvent((OnButtonEvent)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onOnButtonEvent((OnButtonEvent)msg);\r
+                               }\r
+                       } else if (functionName.equals(Names.OnLanguageChange)) {\r
+                               // OnLanguageChange\r
+                               \r
+                               final OnLanguageChange msg = new OnLanguageChange(hash);\r
+                               if (_callbackToUIThread) {\r
+                                       // Run in UI thread\r
+                                       _mainUIHandler.post(new Runnable() {\r
+                                               @Override\r
+                                               public void run() {\r
+                                                       _proxyListener.onOnLanguageChange((OnLanguageChange)msg);\r
+                                               }\r
+                                       });\r
+                               } else {\r
+                                       _proxyListener.onOnLanguageChange((OnLanguageChange)msg);\r
+                               }\r
+                       } else if (functionName.equals(Names.OnAudioPassThru)) {                                \r
+                               // OnAudioPassThru\r
+                               final OnAudioPassThru msg = new OnAudioPassThru(hash);\r
+                if (_callbackToUIThread) {\r
+                    // Run in UI thread\r
+                    _mainUIHandler.post(new Runnable() {\r
+                        @Override\r
+                        public void run() {\r
+                                               _proxyListener.onOnAudioPassThru((OnAudioPassThru)msg);\r
+                        }\r
+                    });\r
+                } else {\r
+                                       _proxyListener.onOnAudioPassThru((OnAudioPassThru)msg);\r
+                }                              \r
+                       } else if (functionName.equals(Names.OnVehicleData)) {               \r
+               try {\r
+                                       Class<?> cls = Class.forName(Names.OnVehicleDataExtend);\r
+                                       Constructor con = cls.getConstructor(new Class[]{Hashtable.class});                                                                                                                     \r
+                                       final Object msg = con.newInstance(hash);       \r
+                                       // OnVehicleDataExtend\r
+                       if (_callbackToUIThread) {\r
+                           // Run in UI thread\r
+                           _mainUIHandler.post(new Runnable() {\r
+                               @Override\r
+                               public void run() {\r
+                                   _proxyListener.onOnVehicleData((OnVehicleData)msg);\r
+                               }\r
+                           });\r
+                       } else {\r
+                           _proxyListener.onOnVehicleData((OnVehicleData)msg);   \r
+                       }                                                                       \r
+                               }                               \r
+               catch(Exception e) {\r
+                                       // OnVehicleData\r
+                       final OnVehicleData msg = new OnVehicleData(hash);\r
+                       if (_callbackToUIThread) {\r
+                           // Run in UI thread\r
+                           _mainUIHandler.post(new Runnable() {\r
+                               @Override\r
+                               public void run() {\r
+                                   _proxyListener.onOnVehicleData((OnVehicleData)msg);\r
+                               }\r
+                           });\r
+                       } else {\r
+                           _proxyListener.onOnVehicleData((OnVehicleData)msg);\r
+                       }\r
+                               } \r
+                       }\r
+                       else if (functionName.equals(Names.OnAppInterfaceUnregistered)) {\r
+                               // OnAppInterfaceUnregistered\r
+                               \r
+                               _appInterfaceRegisterd = false;\r
+                               synchronized(APP_INTERFACE_REGISTERED_LOCK) {\r
+                                       APP_INTERFACE_REGISTERED_LOCK.notify();\r
+                               }\r
+                               \r
+                               final OnAppInterfaceUnregistered msg = new OnAppInterfaceUnregistered(hash);\r
+                                                               \r
+                               if (_advancedLifecycleManagementEnabled) {\r
+                                       // This requires the proxy to be cycled\r
+                    if (this.getCurrentTransportType() == TransportType.BLUETOOTH) {\r
+                        cycleProxy(SmartDeviceLinkDisconnectedReason.convertAppInterfaceUnregisteredReason(msg.getReason()));\r
+                    } else {\r
+                        Log.e(this.getClass().getName(), "HandleRPCMessage. No cycle required if transport is TCP");\r
+                    }\r
+                } else {\r
+                                       if (_callbackToUIThread) {\r
+                                               // Run in UI thread\r
+                                               _mainUIHandler.post(new Runnable() {\r
+                                                       @Override\r
+                                                       public void run() {\r
+                                                               ((IProxyListener)_proxyListener).onOnAppInterfaceUnregistered(msg);\r
+                                                       }\r
+                                               });\r
+                                       } else {\r
+                                               ((IProxyListener)_proxyListener).onOnAppInterfaceUnregistered(msg);\r
+                                       }\r
+                                       \r
+                                       notifyProxyClosed("OnAppInterfaceUnregistered", null);\r
+                               }\r
+                       } else {\r
+                               if (_smartDeviceLinkMsgVersion != null) {\r
+                                       DebugTool.logInfo("Unrecognized notification Message: " + functionName.toString() + \r
+                                                       " connected to SMARTDEVICELINK using message version: " + _smartDeviceLinkMsgVersion.getMajorVersion() + "." + _smartDeviceLinkMsgVersion.getMinorVersion());\r
+                               } else {\r
+                                       DebugTool.logInfo("Unrecognized notification Message: " + functionName.toString());\r
+                               }\r
+                       } // end-if\r
+               } // end-if notification\r
+               \r
+               SmartDeviceLinkTrace.logProxyEvent("Proxy received RPC Message: " + functionName, SMARTDEVICELINK_LIB_TRACE_KEY);\r
+       }\r
+       \r
+       /**\r
+        * Takes an RPCRequest and sends it to SMARTDEVICELINK.  Responses are captured through callback on IProxyListener.  \r
+        * \r
+        * @param request\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void sendRPCRequest(RPCRequest request) throws SmartDeviceLinkException {\r
+               if (_proxyDisposed) {\r
+                       throw new SmartDeviceLinkException("This object has been disposed, it is no long capable of executing methods.", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_PROXY_DISPOSED);\r
+               }\r
+               \r
+               // Test if request is null\r
+               if (request == null) {\r
+                       SmartDeviceLinkTrace.logProxyEvent("Application called sendRPCRequest method with a null RPCRequest.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
+                       throw new IllegalArgumentException("sendRPCRequest cannot be called with a null request.");\r
+               }\r
+               \r
+               SmartDeviceLinkTrace.logProxyEvent("Application called sendRPCRequest method for RPCRequest: ." + request.getFunctionName(), SMARTDEVICELINK_LIB_TRACE_KEY);\r
+                       \r
+               // Test if smartDeviceLinkConnection is null\r
+               synchronized(CONNECTION_REFERENCE_LOCK) {\r
+                       if (_smartDeviceLinkConnection == null || !_smartDeviceLinkConnection.getIsConnected()) {\r
+                               SmartDeviceLinkTrace.logProxyEvent("Application attempted to send and RPCRequest without a connected transport.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
+                               throw new SmartDeviceLinkException("There is no valid connection to SMARTDEVICELINK. sendRPCRequest cannot be called until SMARTDEVICELINK has been connected.", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_UNAVAILALBE);\r
+                       }\r
+               }\r
+               \r
+               // Test for illegal correlation ID\r
+               if (isCorrelationIDProtected(request.getCorrelationID())) {\r
+                       \r
+                       SmartDeviceLinkTrace.logProxyEvent("Application attempted to use the reserved correlation ID, " + request.getCorrelationID(), SMARTDEVICELINK_LIB_TRACE_KEY);\r
+                       throw new SmartDeviceLinkException("Invalid correlation ID. The correlation ID, " + request.getCorrelationID()\r
+                                       + " , is a reserved correlation ID.", SmartDeviceLinkExceptionCause.RESERVED_CORRELATION_ID);\r
+               }\r
+               \r
+               // Throw exception if RPCRequest is sent when SMARTDEVICELINK is unavailable \r
+               if (!_appInterfaceRegisterd && request.getFunctionName() != Names.RegisterAppInterface) {\r
+                       \r
+                       SmartDeviceLinkTrace.logProxyEvent("Application attempted to send an RPCRequest (non-registerAppInterface), before the interface was registerd.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
+                       throw new SmartDeviceLinkException("SMARTDEVICELINK is currently unavailable. RPC Requests cannot be sent.", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_UNAVAILALBE);\r
+               }\r
+                               \r
+               if (_advancedLifecycleManagementEnabled) {\r
+                       if (               request.getFunctionName() == Names.RegisterAppInterface\r
+                                       || request.getFunctionName() == Names.UnregisterAppInterface) {\r
+                               \r
+                               SmartDeviceLinkTrace.logProxyEvent("Application attempted to send a RegisterAppInterface or UnregisterAppInterface while using ALM.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
+                               throw new SmartDeviceLinkException("The RPCRequest, " + request.getFunctionName() + \r
+                                               ", is unnallowed using the Advanced Lifecycle Management Model.", SmartDeviceLinkExceptionCause.INCORRECT_LIFECYCLE_MODEL);\r
+                       }\r
+               }\r
+               \r
+               sendRPCRequestPrivate(request);\r
+       } // end-method\r
+       \r
+       protected void notifyProxyClosed(final String info, final Exception e) {                \r
+               SmartDeviceLinkTrace.logProxyEvent("NotifyProxyClose", SMARTDEVICELINK_LIB_TRACE_KEY);\r
+               \r
+               OnProxyClosed message = new OnProxyClosed(info, e);\r
+               queueInternalMessage(message);\r
+       }\r
+\r
+       private void passErrorToProxyListener(final String info, final Exception e) {\r
+                               \r
+               OnError message = new OnError(info, e);\r
+               queueInternalMessage(message);\r
+       }\r
+       \r
+       private void startRPCProtocolSession(byte sessionID, String correlationID) {\r
+               _rpcSessionID = sessionID;\r
+               \r
+               // Set Proxy Lifecyclek Available\r
+               if (_advancedLifecycleManagementEnabled) {\r
+                       \r
+                       try {\r
+                               registerAppInterfacePrivate(\r
+                                               _smartDeviceLinkMsgVersionRequest,\r
+                                               _applicationName,\r
+                                               _ttsName,\r
+                                               _ngnMediaScreenAppName,\r
+                                               _vrSynonyms,\r
+                                               _isMediaApp, \r
+                                               _smartDeviceLinkLanguageDesired,\r
+                                               _hmiDisplayLanguageDesired,\r
+                                               _appType,\r
+                                               _appID,\r
+                                               _autoActivateIdDesired,\r
+                                               REGISTER_APP_INTERFACE_CORRELATION_ID);\r
+                               \r
+                       } catch (Exception e) {\r
+                               notifyProxyClosed("Failed to register application interface with SMARTDEVICELINK. Check parameter values given to SmartDeviceLinkProxy constructor.", e);\r
+                       }\r
+               } else {\r
+                       InternalProxyMessage message = new InternalProxyMessage(Names.OnProxyOpened);\r
+                       queueInternalMessage(message);\r
+               }\r
+       }\r
+       \r
+       // Queue internal callback message\r
+       private void queueInternalMessage(InternalProxyMessage message) {\r
+               synchronized(INTERNAL_MESSAGE_QUEUE_THREAD_LOCK) {\r
+                       if (_internalProxyMessageDispatcher != null) {\r
+                               _internalProxyMessageDispatcher.queueMessage(message);\r
+                       }\r
+               }\r
+       }\r
+       \r
+       // Queue incoming ProtocolMessage\r
+       private void queueIncomingMessage(ProtocolMessage message) {\r
+               synchronized(INCOMING_MESSAGE_QUEUE_THREAD_LOCK) {\r
+                       if (_incomingProxyMessageDispatcher != null) {\r
+                               _incomingProxyMessageDispatcher.queueMessage(message);\r
+                       }\r
+               }\r
+       }\r
+       \r
+       public void setAppService(Service mService)\r
+       {\r
+               _appService = mService;\r
+       }\r
+\r
+       /******************** Public Helper Methods *************************/\r
+       \r
+       /*Begin V1 Enhanced helper*/\r
+       \r
+       /**\r
+        *Sends an AddCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        *\r
+        *@param commandID -Unique command ID of the command to add.\r
+        *@param menuText  -Menu text for optional sub value containing menu parameters.\r
+        *@param parentID  -Menu parent ID for optional sub value containing menu parameters.\r
+        *@param position  -Menu position for optional sub value containing menu parameters.\r
+        *@param vrCommands -VR synonyms for this AddCommand.\r
+        *@param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).\r
+        *@param IconType -Describes whether the image is static or dynamic\r
+        *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        *@throws SmartDeviceLinkException\r
+        */\r
+       public void addCommand(Integer commandID,\r
+                       String menuText, Integer parentID, Integer position,\r
+                       Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               AddCommand msg = RPCRequestFactory.buildAddCommand(commandID, menuText, parentID, position,\r
+                       vrCommands, IconValue, IconType, correlationID);\r
+               \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        *Sends an AddCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        *\r
+        *@param commandID -Unique command ID of the command to add.\r
+        *@param menuText -Menu text for optional sub value containing menu parameters.\r
+        *@param position -Menu position for optional sub value containing menu parameters.\r
+        *@param vrCommands -VR synonyms for this AddCommand.\r
+        *@param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).\r
+        *@param IconType -Describes whether the image is static or dynamic\r
+        *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        *@throws SmartDeviceLinkException\r
+        */\r
+       public void addCommand(Integer commandID,\r
+                       String menuText, Integer position,\r
+                       Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               addCommand(commandID, menuText, null, position, vrCommands, IconValue, IconType, correlationID);\r
+       }\r
+       \r
+       /**\r
+        *Sends an AddCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        *\r
+        *@param commandID -Unique command ID of the command to add.\r
+        *@param menuText -Menu text for optional sub value containing menu parameters.\r
+        *@param position -Menu position for optional sub value containing menu parameters.\r
+        *@param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).\r
+        *@param IconType -Describes whether the image is static or dynamic\r
+        *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        *@throws SmartDeviceLinkException\r
+        */\r
+       public void addCommand(Integer commandID,\r
+                       String menuText, Integer position, String IconValue, ImageType IconType,\r
+                       Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               addCommand(commandID, menuText, null, position, null, IconValue, IconType, correlationID);\r
+       }\r
+       \r
+       /**\r
+        *Sends an AddCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        *\r
+        *@param commandID -Unique command ID of the command to add.\r
+        *@param menuText -Menu text for optional sub value containing menu parameters.\r
+        *@param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).\r
+        *@param IconType -Describes whether the image is static or dynamic\r
+        *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        *@throws SmartDeviceLinkException\r
+        */\r
+       public void addCommand(Integer commandID,\r
+                       String menuText, String IconValue, ImageType IconType, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               addCommand(commandID, menuText, null, null, null, IconValue, IconType, correlationID);\r
+       }\r
+       \r
+       /**\r
+        * Sends an AddCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param commandID -Unique command ID of the command to add.\r
+        * @param menuText -Menu text for optional sub value containing menu parameters.\r
+        * @param vrCommands -VR synonyms for this AddCommand.\r
+        * @param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).\r
+        * @param IconType -Describes whether the image is static or dynamic\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void addCommand(Integer commandID,\r
+                       String menuText, Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               addCommand(commandID, menuText, null, null, vrCommands, IconValue, IconType, correlationID);\r
+       }\r
+       \r
+       /**\r
+        * Sends an AddCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param commandID -Unique command ID of the command to add.\r
+        * @param vrCommands -VR synonyms for this AddCommand.\r
+        * @param IconValue -A static hex icon value or the binary image file name identifier (sent by the PutFile RPC).\r
+        * @param IconType -Describes whether the image is static or dynamic\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void addCommand(Integer commandID,\r
+                       Vector<String> vrCommands, String IconValue, ImageType IconType, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               addCommand(commandID, null, null, null, vrCommands, IconValue, IconType, correlationID);\r
+       }\r
+\r
+       /*End V1 Enhanced helper*/\r
+       \r
+       /**\r
+        *Sends an AddCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        *\r
+        *@param commandID -Unique command ID of the command to add.\r
+        *@param menuText -Menu text for optional sub value containing menu parameters.\r
+        *@param parentID  -Menu parent ID for optional sub value containing menu parameters.\r
+        *@param position  -Menu position for optional sub value containing menu parameters.\r
+        *@param vrCommands -VR synonyms for this AddCommand.\r
+        *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        *@throws SmartDeviceLinkException\r
+        */\r
+       public void addCommand(Integer commandID,\r
+                       String menuText, Integer parentID, Integer position,\r
+                       Vector<String> vrCommands, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               AddCommand msg = RPCRequestFactory.buildAddCommand(commandID, menuText, parentID, position,\r
+                       vrCommands, correlationID);\r
+               \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        *Sends an AddCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        *\r
+        *@param commandID -Unique command ID of the command to add.\r
+        *@param menuText -Menu text for optional sub value containing menu parameters.\r
+        *@param position  -Menu position for optional sub value containing menu parameters.\r
+        *@param vrCommands -VR synonyms for this AddCommand.\r
+        *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        *@throws SmartDeviceLinkException\r
+        */\r
+       public void addCommand(Integer commandID,\r
+                       String menuText, Integer position,\r
+                       Vector<String> vrCommands, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               addCommand(commandID, menuText, null, position, vrCommands, correlationID);\r
+       }\r
+       \r
+       /**\r
+        *Sends an AddCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        *\r
+        *@param commandID -Unique command ID of the command to add.\r
+        *@param menuText -Menu text for optional sub value containing menu parameters.\r
+        *@param position  -Menu position for optional sub value containing menu parameters.\r
+        *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        *@throws SmartDeviceLinkException\r
+        */\r
+       public void addCommand(Integer commandID,\r
+                       String menuText, Integer position,\r
+                       Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               addCommand(commandID, menuText, null, position, null, correlationID);\r
+       }\r
+       \r
+       /**\r
+        *Sends an AddCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        *\r
+        *@param commandID -Unique command ID of the command to add.\r
+        *@param menuText -Menu text for optional sub value containing menu parameters.\r
+        *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        *@throws SmartDeviceLinkException\r
+        */\r
+       public void addCommand(Integer commandID,\r
+                       String menuText, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               Vector<String> vrCommands = null;\r
+               \r
+               addCommand(commandID, menuText, null, null, vrCommands, correlationID);\r
+       }\r
+       \r
+       /**\r
+        * Sends an AddCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        *@param commandID -Unique command ID of the command to add.\r
+        *@param menuText -Menu text for optional sub value containing menu parameters.\r
+        *@param vrCommands -VR synonyms for this AddCommand.\r
+        *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        *@throws SmartDeviceLinkException\r
+        */\r
+       public void addCommand(Integer commandID,\r
+                       String menuText, Vector<String> vrCommands, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               addCommand(commandID, menuText, null, null, vrCommands, correlationID);\r
+       }\r
+       \r
+       /**\r
+        * Sends an AddCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        *@param commandID -Unique command ID of the command to add.\r
+        *@param vrCommands -VR synonyms for this AddCommand.\r
+        *@param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        *@throws SmartDeviceLinkException\r
+        */\r
+       public void addCommand(Integer commandID,\r
+                       Vector<String> vrCommands, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               addCommand(commandID, null, null, null, vrCommands, correlationID);\r
+       }\r
+               \r
+       \r
+       /**\r
+        * Sends an AddSubMenu RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param menuID -Unique ID of the sub menu to add.\r
+        * @param menuName -Text to show in the menu for this sub menu.\r
+        * @param position -Position within the items that are are at top level of the in application menu.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void addSubMenu(Integer menuID, String menuName,\r
+                       Integer position, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               AddSubMenu msg = RPCRequestFactory.buildAddSubMenu(menuID, menuName,\r
+                               position, correlationID);\r
+               \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends an AddSubMenu RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param menuID -Unique ID of the sub menu to add.\r
+        * @param menuName -Text to show in the menu for this sub menu.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void addSubMenu(Integer menuID, String menuName,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               addSubMenu(menuID, menuName, null, correlationID);\r
+       }\r
+       \r
+       /**\r
+        * Sends an EncodedData RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param data -Contains base64 encoded string of SmartDeviceLinkP packets.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void encodedSyncPData(Vector<String> data, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               Log.i("pt", "encodedSyncPData() giving to smartDeviceLink");\r
+               EncodedSyncPData msg = RPCRequestFactory.buildEncodedSyncPData(data, correlationID);\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a Data RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param data \r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void SyncPData(byte[] data, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               Log.i("pt", "SyncPData() giving to smartDeviceLink");\r
+               SyncPData msg = RPCRequestFactory.buildSyncPData(data, correlationID);\r
+               sendRPCRequest(msg);\r
+       }\r
+\r
+       /*Begin V1 Enhanced helper*/    \r
+       \r
+       \r
+       /**\r
+        * Sends an Alert RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param ttsText -The text to speech message in the form of a string.\r
+        * @param alertText1 -The first line of the alert text field.\r
+        * @param alertText2 -The second line of the alert text field.\r
+        * @param alertText3 -The optional third line of the alert text field.\r
+        * @param playTone -Defines if tone should be played.\r
+        * @param duration -Timeout in milliseconds.\r
+        * @param softButtons -A list of App defined SoftButtons.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void alert(String ttsText, String alertText1,\r
+                       String alertText2, String alertText3, Boolean playTone, Integer duration, Vector<SoftButton> softButtons,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+\r
+               Alert msg = RPCRequestFactory.buildAlert(ttsText, alertText1, alertText2, alertText3, playTone, duration, softButtons, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends an Alert RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param ttsChunks -Text/phonemes to speak in the form of ttsChunks.\r
+        * @param alertText1 -The first line of the alert text field.\r
+        * @param alertText2 -The second line of the alert text field.\r
+        * @param alertText3 -The optional third line of the alert text field.\r
+        * @param playTone -Defines if tone should be played.\r
+        * @param duration -Timeout in milliseconds.\r
+        * @param softButtons -A list of App defined SoftButtons.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void alert(Vector<TTSChunk> ttsChunks,\r
+                       String alertText1, String alertText2, String alertText3, Boolean playTone,\r
+                       Integer duration, Vector<SoftButton> softButtons, Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               Alert msg = RPCRequestFactory.buildAlert(ttsChunks, alertText1, alertText2, alertText3, playTone, duration, softButtons, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends an Alert RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param ttsText -The text to speech message in the form of a string.\r
+        * @param playTone -Defines if tone should be played.\r
+        * @param softButtons -A list of App defined SoftButtons.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void alert(String ttsText, Boolean playTone, Vector<SoftButton> softButtons,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               alert(ttsText, null, null, null, playTone, null, softButtons, correlationID);\r
+       }\r
+       \r
+       /**\r
+        * Sends an Alert RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param chunks -A list of text/phonemes to speak in the form of ttsChunks.\r
+        * @param playTone -Defines if tone should be played.\r
+        * @param softButtons -A list of App defined SoftButtons.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void alert(Vector<TTSChunk> chunks, Boolean playTone, Vector<SoftButton> softButtons,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               alert(chunks, null, null, null, playTone, null, softButtons, correlationID);\r
+       }\r
+       \r
+       /**\r
+        * Sends an Alert RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param alertText1 -The first line of the alert text field.\r
+        * @param alertText2 -The second line of the alert text field.\r
+        * @param alertText3 -The optional third line of the alert text field.\r
+        * @param playTone -Defines if tone should be played.\r
+        * @param duration -Timeout in milliseconds.\r
+        * @param softButtons -A list of App defined SoftButtons.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void alert(String alertText1, String alertText2, String alertText3,\r
+                       Boolean playTone, Integer duration, Vector<SoftButton> softButtons, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               alert((Vector<TTSChunk>)null, alertText1, alertText2, alertText3, playTone, duration, softButtons, correlationID);\r
+       }\r
+               \r
+       /*End V1 Enhanced helper*/\r
+       \r
+       /**\r
+        * Sends an Alert RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param ttsText -The text to speech message in the form of a string.\r
+        * @param alertText1 -The first line of the alert text field.\r
+        * @param alertText2 -The second line of the alert text field.\r
+        * @param playTone -Defines if tone should be played.\r
+        * @param duration -Timeout in milliseconds.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void alert(String ttsText, String alertText1,\r
+                       String alertText2, Boolean playTone, Integer duration,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+\r
+               Alert msg = RPCRequestFactory.buildAlert(ttsText, alertText1, alertText2, \r
+                               playTone, duration, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends an Alert RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param ttsChunks -A list of text/phonemes to speak in the form of ttsChunks.\r
+        * @param alertText1 -The first line of the alert text field.\r
+        * @param alertText2 -The second line of the alert text field.\r
+        * @param playTone -Defines if tone should be played.\r
+        * @param duration -Timeout in milliseconds.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void alert(Vector<TTSChunk> ttsChunks,\r
+                       String alertText1, String alertText2, Boolean playTone,\r
+                       Integer duration, Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               Alert msg = RPCRequestFactory.buildAlert(ttsChunks, alertText1, alertText2, playTone,\r
+                               duration, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends an Alert RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param ttsText -The text to speech message in the form of a string.\r
+        * @param playTone -Defines if tone should be played.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void alert(String ttsText, Boolean playTone,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               alert(ttsText, null, null, playTone, null, correlationID);\r
+       }\r
+       \r
+       /**\r
+        * Sends an Alert RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param chunks -A list of text/phonemes to speak in the form of ttsChunks.\r
+        * @param playTone -Defines if tone should be played.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void alert(Vector<TTSChunk> chunks, Boolean playTone,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               alert(chunks, null, null, playTone, null, correlationID);\r
+       }\r
+       \r
+       /**\r
+        * Sends an Alert RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param alertText1 -The first line of the alert text field.\r
+        * @param alertText2 -The second line of the alert text field.\r
+        * @param playTone -Defines if tone should be played.\r
+        * @param duration -Timeout in milliseconds.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void alert(String alertText1, String alertText2,\r
+                       Boolean playTone, Integer duration, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               alert((Vector<TTSChunk>)null, alertText1, alertText2, playTone, duration, correlationID);\r
+       }\r
+       \r
+       /**\r
+        * Sends a CreateInteractionChoiceSet RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param choiceSet\r
+        * @param interactionChoiceSetID\r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void createInteractionChoiceSet(\r
+                       Vector<Choice> choiceSet, Integer interactionChoiceSetID,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               CreateInteractionChoiceSet msg = RPCRequestFactory.buildCreateInteractionChoiceSet(\r
+                               choiceSet, interactionChoiceSetID, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a DeleteCommand RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param commandID -ID of the command(s) to delete.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void deleteCommand(Integer commandID,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               DeleteCommand msg = RPCRequestFactory.buildDeleteCommand(commandID, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a DeleteInteractionChoiceSet RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param interactionChoiceSetID -ID of the interaction choice set to delete.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void deleteInteractionChoiceSet(\r
+                       Integer interactionChoiceSetID, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               DeleteInteractionChoiceSet msg = RPCRequestFactory.buildDeleteInteractionChoiceSet(\r
+                               interactionChoiceSetID, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a DeleteSubMenu RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param menuID -The menuID of the submenu to delete.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void deleteSubMenu(Integer menuID,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               DeleteSubMenu msg = RPCRequestFactory.buildDeleteSubMenu(menuID, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       \r
+       \r
+       /*Begin V1 Enhanced helper*/\r
+       \r
+       /**\r
+        * Sends a PerformInteraction RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.          \r
+        * @param displayText -Text to be displayed first.\r
+        * @param interactionChoiceSetID -Interaction choice set IDs to use with an interaction.\r
+        * @param vrHelp -Suggested VR Help Items to display on-screen during Perform Interaction.              \r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void performInteraction(String initPrompt,\r
+                       String displayText, Integer interactionChoiceSetID, Vector<VrHelpItem> vrHelp,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(initPrompt,\r
+                               displayText, interactionChoiceSetID, vrHelp, correlationID);\r
+               \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a PerformInteraction RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.          \r
+        * @param displayText -Text to be displayed first.\r
+        * @param interactionChoiceSetID -Interaction choice set IDs to use with an interaction.\r
+        * @param helpPrompt -Help text that is spoken when a user speaks "help" during the interaction.\r
+        * @param timeoutPrompt -Timeout text that is spoken when a VR interaction times out.\r
+        * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).\r
+        * @param timeout -Timeout in milliseconds.\r
+        * @param vrHelp -Suggested VR Help Items to display on-screen during Perform Interaction.              \r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void performInteraction(String initPrompt,\r
+                       String displayText, Integer interactionChoiceSetID,\r
+                       String helpPrompt, String timeoutPrompt,\r
+                       InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(\r
+                               initPrompt, displayText, interactionChoiceSetID,\r
+                               helpPrompt, timeoutPrompt, interactionMode, \r
+                               timeout, vrHelp, correlationID);\r
+               \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a PerformInteraction RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.          \r
+        * @param displayText -Text to be displayed first.\r
+        * @param interactionChoiceSetIDList -A list of interaction choice set IDs to use with an interaction.\r
+        * @param helpPrompt -Help text that is spoken when a user speaks "help" during the interaction.\r
+        * @param timeoutPrompt -Timeout text that is spoken when a VR interaction times out.\r
+        * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).\r
+        * @param timeout -Timeout in milliseconds.\r
+        * @param vrHelp -Suggested VR Help Items to display on-screen during Perform Interaction.              \r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void performInteraction(String initPrompt,\r
+                       String displayText, Vector<Integer> interactionChoiceSetIDList,\r
+                       String helpPrompt, String timeoutPrompt,\r
+                       InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(initPrompt,\r
+                               displayText, interactionChoiceSetIDList,\r
+                               helpPrompt, timeoutPrompt, interactionMode, timeout, vrHelp,\r
+                               correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a PerformInteraction RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param initChunks -A list of text/phonemes to speak for the initial prompt in the form of ttsChunks.\r
+        * @param displayText -Text to be displayed first.\r
+        * @param interactionChoiceSetIDList -A list of interaction choice set IDs to use with an interaction.\r
+        * @param helpChunks -A list of text/phonemes to speak for the help text that is spoken when a user speaks "help" during the interaction.\r
+        * @param timeoutChunks A list of text/phonems to speak for the timeout text that is spoken when a VR interaction times out.\r
+        * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).\r
+        * @param timeout -Timeout in milliseconds.\r
+        * @param vrHelp -Suggested VR Help Items to display on-screen during Perform Interaction.              \r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void performInteraction(\r
+                       Vector<TTSChunk> initChunks, String displayText,\r
+                       Vector<Integer> interactionChoiceSetIDList,\r
+                       Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,\r
+                       InteractionMode interactionMode, Integer timeout, Vector<VrHelpItem> vrHelp,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(\r
+                               initChunks, displayText, interactionChoiceSetIDList,\r
+                               helpChunks, timeoutChunks, interactionMode, timeout,vrHelp,\r
+                               correlationID);\r
+               \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /*End V1 Enhanced*/\r
+       \r
+       /**\r
+        * Sends a PerformInteraction RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.          \r
+        * @param displayText -Text to be displayed first.\r
+        * @param interactionChoiceSetID -Interaction choice set IDs to use with an interaction.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void performInteraction(String initPrompt,\r
+                       String displayText, Integer interactionChoiceSetID,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(initPrompt,\r
+                               displayText, interactionChoiceSetID, correlationID);\r
+               \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a PerformInteraction RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.          \r
+        * @param displayText -Text to be displayed first.\r
+        * @param interactionChoiceSetID -Interaction choice set IDs to use with an interaction.\r
+        * @param helpPrompt -Help text that is spoken when a user speaks "help" during the interaction. \r
+        * @param timeoutPrompt -Timeout text that is spoken when a VR interaction times out.\r
+        * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).\r
+        * @param timeout -Timeout in milliseconds.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void performInteraction(String initPrompt,\r
+                       String displayText, Integer interactionChoiceSetID,\r
+                       String helpPrompt, String timeoutPrompt,\r
+                       InteractionMode interactionMode, Integer timeout,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(\r
+                               initPrompt, displayText, interactionChoiceSetID,\r
+                               helpPrompt, timeoutPrompt, interactionMode, \r
+                               timeout, correlationID);\r
+               \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a PerformInteraction RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param initPrompt -Intial prompt spoken to the user at the start of an interaction.          \r
+        * @param displayText -Text to be displayed first.\r
+        * @param interactionChoiceSetIDList -A list of interaction choice set IDs to use with an interaction.\r
+        * @param helpPrompt -Help text that is spoken when a user speaks "help" during the interaction. \r
+        * @param timeoutPrompt -Timeout text that is spoken when a VR interaction times out.\r
+        * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).\r
+        * @param timeout -Timeout in milliseconds.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void performInteraction(String initPrompt,\r
+                       String displayText, Vector<Integer> interactionChoiceSetIDList,\r
+                       String helpPrompt, String timeoutPrompt,\r
+                       InteractionMode interactionMode, Integer timeout,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(initPrompt,\r
+                               displayText, interactionChoiceSetIDList,\r
+                               helpPrompt, timeoutPrompt, interactionMode, timeout,\r
+                               correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a PerformInteraction RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param initChunks -A list of text/phonemes to speak for the initial prompt in the form of ttsChunks.\r
+        * @param displayText -Text to be displayed first.\r
+        * @param interactionChoiceSetIDList -A list of interaction choice set IDs to use with an interaction.\r
+        * @param helpChunks -A list of text/phonemes to speak for the help text that is spoken when a user speaks "help" during the interaction.\r
+        * @param timeoutChunks A list of text/phonems to speak for the timeout text that is spoken when a VR interaction times out.\r
+        * @param interactionMode - The method in which the user is notified and uses the interaction (Manual,VR,Both).\r
+        * @param timeout -Timeout in milliseconds.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void performInteraction(\r
+                       Vector<TTSChunk> initChunks, String displayText,\r
+                       Vector<Integer> interactionChoiceSetIDList,\r
+                       Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,\r
+                       InteractionMode interactionMode, Integer timeout,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               PerformInteraction msg = RPCRequestFactory.buildPerformInteraction(\r
+                               initChunks, displayText, interactionChoiceSetIDList,\r
+                               helpChunks, timeoutChunks, interactionMode, timeout,\r
+                               correlationID);\r
+               \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       // Protected registerAppInterface used to ensure only non-ALM applications call\r
+       // reqisterAppInterface\r
+       protected void registerAppInterfacePrivate(\r
+                       smartdevicelinkMsgVersion smartDeviceLinkMsgVersion, String appName, Vector<TTSChunk> ttsName,\r
+                       String ngnMediaScreenAppName, Vector<String> vrSynonyms, Boolean isMediaApp, \r
+                       Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType,\r
+                       String appID, String autoActivateID, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               RegisterAppInterface msg = RPCRequestFactory.buildRegisterAppInterface(\r
+                               smartDeviceLinkMsgVersion, appName, ttsName, ngnMediaScreenAppName, vrSynonyms, isMediaApp, \r
+                               languageDesired, hmiDisplayLanguageDesired, appType, appID, correlationID);\r
+\r
+               sendRPCRequestPrivate(msg);\r
+       }\r
+       \r
+       /*Begin V1 Enhanced helper function*/\r
+\r
+       /**\r
+        * Sends a SetGlobalProperties RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param helpPrompt\r
+        * @param timeoutPrompt\r
+        * @param vrHelpTitle\r
+        * @param vrHelp\r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void setGlobalProperties(\r
+                       String helpPrompt, String timeoutPrompt, String vrHelpTitle, Vector<VrHelpItem> vrHelp, Integer correlationID) \r
+               throws SmartDeviceLinkException {\r
+               \r
+               SetGlobalProperties req = RPCRequestFactory.buildSetGlobalProperties(helpPrompt, \r
+                               timeoutPrompt, vrHelpTitle, vrHelp, correlationID);\r
+               \r
+               sendRPCRequest(req);\r
+       }\r
+       \r
+       /**\r
+        * Sends a SetGlobalProperties RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param helpChunks\r
+        * @param timeoutChunks\r
+        * @param vrHelpTitle\r
+        * @param vrHelp\r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void setGlobalProperties(\r
+                       Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks, String vrHelpTitle, Vector<VrHelpItem> vrHelp,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               SetGlobalProperties req = RPCRequestFactory.buildSetGlobalProperties(\r
+                               helpChunks, timeoutChunks, vrHelpTitle, vrHelp, correlationID);\r
+\r
+               sendRPCRequest(req);\r
+       }\r
+\r
+       /*End V1 Enhanced helper function*/     \r
+       \r
+       /**\r
+        * Sends a SetGlobalProperties RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param helpPrompt\r
+        * @param timeoutPrompt\r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void setGlobalProperties(\r
+                       String helpPrompt, String timeoutPrompt, Integer correlationID) \r
+               throws SmartDeviceLinkException {\r
+               \r
+               SetGlobalProperties req = RPCRequestFactory.buildSetGlobalProperties(helpPrompt, \r
+                               timeoutPrompt, correlationID);\r
+               \r
+               sendRPCRequest(req);\r
+       }\r
+       \r
+       /**\r
+        * Sends a SetGlobalProperties RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param helpChunks\r
+        * @param timeoutChunks\r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void setGlobalProperties(\r
+                       Vector<TTSChunk> helpChunks, Vector<TTSChunk> timeoutChunks,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               SetGlobalProperties req = RPCRequestFactory.buildSetGlobalProperties(\r
+                               helpChunks, timeoutChunks, correlationID);\r
+\r
+               sendRPCRequest(req);\r
+       }\r
+       \r
+       public void resetGlobalProperties(Vector<GlobalProperty> properties,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+               \r
+               ResetGlobalProperties req = new ResetGlobalProperties();\r
+               \r
+               req.setCorrelationID(correlationID);\r
+               req.setProperties(properties);\r
+               \r
+               sendRPCRequest(req);\r
+       }\r
+                                                               \r
+       \r
+       /**\r
+        * Sends a SetMediaClockTimer RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param hours\r
+        * @param minutes\r
+        * @param seconds\r
+        * @param updateMode\r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void setMediaClockTimer(Integer hours,\r
+                       Integer minutes, Integer seconds, UpdateMode updateMode,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+\r
+               SetMediaClockTimer msg = RPCRequestFactory.buildSetMediaClockTimer(hours,\r
+                               minutes, seconds, updateMode, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Pauses the media clock. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void pauseMediaClockTimer(Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+\r
+               SetMediaClockTimer msg = RPCRequestFactory.buildSetMediaClockTimer(0,\r
+                               0, 0, UpdateMode.PAUSE, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Resumes the media clock. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void resumeMediaClockTimer(Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+\r
+               SetMediaClockTimer msg = RPCRequestFactory.buildSetMediaClockTimer(0,\r
+                               0, 0, UpdateMode.RESUME, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Clears the media clock. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void clearMediaClockTimer(Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+\r
+               Show msg = RPCRequestFactory.buildShow(null, null, null, "     ", null, null, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+               \r
+       /*Begin V1 Enhanced helper*/\r
+       /**\r
+        * Sends a Show RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param mainText1 -Text displayed in a single or upper display line.\r
+        * @param mainText2 -Text displayed on the second display line.\r
+        * @param mainText3 -Text displayed on the second "page" first display line.\r
+        * @param mainText4 -Text displayed on the second "page" second display line.\r
+        * @param statusBar\r
+        * @param mediaClock -Text value for MediaClock field.\r
+        * @param mediaTrack -Text displayed in the track field.\r
+        * @param graphic -Image struct determining whether static or dynamic image to display in app.\r
+        * @param softButtons -App defined SoftButtons.\r
+        * @param customPresets -App labeled on-screen presets.\r
+        * @param alignment -Specifies how mainText1 and mainText2s texts should be aligned on display.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void show(String mainText1, String mainText2, String mainText3, String mainText4,\r
+                       String statusBar, String mediaClock, String mediaTrack,\r
+                       Image graphic, Vector<SoftButton> softButtons, Vector <String> customPresets,\r
+                       TextAlignment alignment, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               Show msg = RPCRequestFactory.buildShow(mainText1, mainText2, mainText3, mainText4,\r
+                               statusBar, mediaClock, mediaTrack, graphic, softButtons, customPresets,\r
+                               alignment, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a Show RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param mainText1 -Text displayed in a single or upper display line.\r
+        * @param mainText2 -Text displayed on the second display line.\r
+        * @param mainText3 -Text displayed on the second "page" first display line.\r
+        * @param mainText4 -Text displayed on the second "page" second display line.\r
+        * @param graphic -Image struct determining whether static or dynamic image to display in app.\r
+        * @param softButtons -App defined SoftButtons.\r
+        * @param customPresets -App labeled on-screen presets.\r
+        * @param alignment -Specifies how mainText1 and mainText2s texts should be aligned on display.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void show(String mainText1, String mainText2, String mainText3, String mainText4,\r
+                       Image graphic, Vector<SoftButton> softButtons, Vector <String> customPresets,\r
+                       TextAlignment alignment, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               show(mainText1, mainText2, mainText3, mainText4, null, null, null, graphic, softButtons, customPresets, alignment, correlationID);\r
+       }               \r
+       /*End V1 Enhanced helper*/\r
+       \r
+       /**\r
+        * Sends a Show RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param mainText1 -Text displayed in a single or upper display line.\r
+        * @param mainText2 -Text displayed on the second display line.\r
+        * @param statusBar\r
+        * @param mediaClock -Text value for MediaClock field.\r
+        * @param mediaTrack -Text displayed in the track field.\r
+        * @param alignment -Specifies how mainText1 and mainText2s texts should be aligned on display.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void show(String mainText1, String mainText2,\r
+                       String statusBar, String mediaClock, String mediaTrack,\r
+                       TextAlignment alignment, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               Show msg = RPCRequestFactory.buildShow(mainText1, mainText2,\r
+                               statusBar, mediaClock, mediaTrack,\r
+                               alignment, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a Show RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param mainText1 -Text displayed in a single or upper display line.\r
+        * @param mainText2 -Text displayed on the second display line.\r
+        * @param alignment -Specifies how mainText1 and mainText2s texts should be aligned on display.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void show(String mainText1, String mainText2,\r
+                       TextAlignment alignment, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               show(mainText1, mainText2, null, null, null, alignment, correlationID);\r
+       }\r
+       \r
+       /**\r
+        * Sends a Speak RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param ttsText -The text to speech message in the form of a string.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void speak(String ttsText, Integer correlationID) \r
+                       throws SmartDeviceLinkException {\r
+               \r
+               Speak msg = RPCRequestFactory.buildSpeak(TTSChunkFactory.createSimpleTTSChunks(ttsText),\r
+                               correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a Speak RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param ttsChunks -Text/phonemes to speak in the form of ttsChunks.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void speak(Vector<TTSChunk> ttsChunks,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+\r
+               Speak msg = RPCRequestFactory.buildSpeak(ttsChunks, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends a SubscribeButton RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param buttonName -Name of the button to subscribe.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void subscribeButton(ButtonName buttonName,\r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+\r
+               SubscribeButton msg = RPCRequestFactory.buildSubscribeButton(buttonName,\r
+                               correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       // Protected unregisterAppInterface used to ensure no non-ALM app calls\r
+       // unregisterAppInterface.\r
+       protected void unregisterAppInterfacePrivate(Integer correlationID) \r
+               throws SmartDeviceLinkException {\r
+\r
+               UnregisterAppInterface msg = \r
+                               RPCRequestFactory.buildUnregisterAppInterface(correlationID);\r
+               \r
+               sendRPCRequestPrivate(msg);\r
+       }\r
+       \r
+       /**\r
+        * Sends an UnsubscribeButton RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param buttonName -Name of the button to unsubscribe.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+        */\r
+       public void unsubscribeButton(ButtonName buttonName, \r
+                       Integer correlationID) throws SmartDeviceLinkException {\r
+\r
+               UnsubscribeButton msg = RPCRequestFactory.buildUnsubscribeButton(\r
+                               buttonName, correlationID);\r
+\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        * Creates a choice to be added to a choiceset. Choice has both a voice and a visual menu component.\r
+        * \r
+        * @param choiceID -Unique ID used to identify this choice (returned in callback).\r
+        * @param choiceMenuName -Text name displayed for this choice.\r
+        * @param choiceVrCommands -Vector of vrCommands used to select this choice by voice. Must contain\r
+        *                      at least one non-empty element.\r
+        * @return Choice created. \r
+        * @throws SmartDeviceLinkException \r
+        */\r
+       public Choice createChoiceSetChoice(Integer choiceID, String choiceMenuName,\r
+                       Vector<String> choiceVrCommands) {              \r
+               Choice returnChoice = new Choice();\r
+               \r
+               returnChoice.setChoiceID(choiceID);\r
+               returnChoice.setMenuName(choiceMenuName);\r
+               returnChoice.setVrCommands(choiceVrCommands);\r
+               \r
+               return returnChoice;\r
+       }\r
+       \r
+       /**\r
+        * Starts audio pass thru session. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param initialPrompt -SMARTDEVICELINK will speak this prompt before opening the audio pass thru session.\r
+        * @param audioPassThruDisplayText1 -First line of text displayed during audio capture.\r
+        * @param audioPassThruDisplayText2 -Second line of text displayed during audio capture.\r
+        * @param samplingRate -Allowable values of 8 khz or 16 or 22 or 44 khz.\r
+        * @param maxDuration -The maximum duration of audio recording in milliseconds.\r
+        * @param bitsPerSample -Specifies the quality the audio is recorded. Currently 8 bit or 16 bit.\r
+        * @param audioType -Specifies the type of audio data being requested.\r
+        * @param muteAudio -Defines if the current audio source should be muted during the APT session.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException \r
+        */\r
+       public void performaudiopassthru(String initialPrompt, String audioPassThruDisplayText1, String audioPassThruDisplayText2,\r
+                         SamplingRate samplingRate, Integer maxDuration, BitsPerSample bitsPerSample,\r
+                         AudioType audioType, Boolean muteAudio, Integer correlationID) throws SmartDeviceLinkException {              \r
+\r
+               PerformAudioPassThru msg = RPCRequestFactory.BuildPerformAudioPassThru(initialPrompt, audioPassThruDisplayText1, audioPassThruDisplayText2, \r
+                                                                                                                                                               samplingRate, maxDuration, bitsPerSample, audioType, muteAudio, correlationID);\r
+               sendRPCRequest(msg);\r
+       }\r
+\r
+       /**\r
+        * Ends audio pass thru session. Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException \r
+        */\r
+       public void endaudiopassthru(Integer correlationID) throws SmartDeviceLinkException \r
+       {\r
+               EndAudioPassThru msg = RPCRequestFactory.BuildEndAudioPassThru(correlationID);          \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        *     Subscribes for specific published data items.  The data will be only sent if it has changed.\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param gps -Subscribes to GPS data.\r
+        * @param speed -Subscribes to vehicle speed data in kilometers per hour.\r
+        * @param rpm -Subscribes to number of revolutions per minute of the engine.\r
+        * @param fuelLevel -Subscribes to fuel level in the tank (percentage).\r
+        * @param fuelLevel_State -Subscribes to fuel level state.\r
+        * @param instantFuelConsumption -Subscribes to instantaneous fuel consumption in microlitres.\r
+        * @param externalTemperature -Subscribes to the external temperature in degrees celsius.\r
+        * @param prndl -Subscribes to PRNDL data that houses the selected gear.\r
+        * @param tirePressure -Subscribes to the TireStatus data containing status and pressure of tires. \r
+        * @param odometer -Subscribes to Odometer data in km.\r
+        * @param beltStatus -Subscribes to status of the seat belts.\r
+        * @param bodyInformation -Subscribes to body information including power modes.\r
+        * @param deviceStatus -Subscribes to device status including signal and battery strength.\r
+        * @param driverBraking -Subscribes to the status of the brake pedal.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+       */\r
+       public void subscribevehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,\r
+                                                                        boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,                                              \r
+                                                                        boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,\r
+                                                                        boolean driverBraking, Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+               SubscribeVehicleData msg = RPCRequestFactory.BuildSubscribeVehicleData(gps, speed, rpm, fuelLevel, fuelLevel_State, instantFuelConsumption, externalTemperature, prndl, tirePressure, \r
+                                                                                                                                                               odometer, beltStatus, bodyInformation, deviceStatus, driverBraking, correlationID);\r
+               \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        *     Unsubscribes for specific published data items.\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param gps -Unsubscribes to GPS data.\r
+        * @param speed -Unsubscribes to vehicle speed data in kilometers per hour.\r
+        * @param rpm -Unsubscribes to number of revolutions per minute of the engine.\r
+        * @param fuelLevel -Unsubscribes to fuel level in the tank (percentage).\r
+        * @param fuelLevel_State -Unsubscribes to fuel level state.\r
+        * @param instantFuelConsumption -Unsubscribes to instantaneous fuel consumption in microlitres.\r
+        * @param externalTemperature -Unsubscribes to the external temperature in degrees celsius.\r
+        * @param prndl -Unsubscribes to PRNDL data that houses the selected gear.\r
+        * @param tirePressure -Unsubscribes to the TireStatus data containing status and pressure of tires. \r
+        * @param odometer -Unsubscribes to Odometer data in km.\r
+        * @param beltStatus -Unsubscribes to status of the seat belts.\r
+        * @param bodyInformation -Unsubscribes to body information including power modes.\r
+        * @param deviceStatus -Unsubscribes to device status including signal and battery strength.\r
+        * @param driverBraking -Unsubscribes to the status of the brake pedal.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+       */\r
+\r
+       public void unsubscribevehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,\r
+                                                                          boolean instantFuelConsumption, boolean externalTemperature, boolean prndl, boolean tirePressure,\r
+                                                                          boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,\r
+                                                                          boolean driverBraking, Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+               UnsubscribeVehicleData msg = RPCRequestFactory.BuildUnsubscribeVehicleData(gps, speed, rpm, fuelLevel, fuelLevel_State, instantFuelConsumption, externalTemperature, prndl, tirePressure,\r
+                                                                                                                                                                       odometer, beltStatus, bodyInformation, deviceStatus, driverBraking, correlationID);\r
+               sendRPCRequest(msg);\r
+       }\r
+\r
+\r
+       /**\r
+        *     Performs a Non periodic vehicle data read request.\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param gps -Performs an ad-hoc request for GPS data.\r
+        * @param speed -Performs an ad-hoc request for vehicle speed data in kilometers per hour.\r
+        * @param rpm -Performs an ad-hoc request for number of revolutions per minute of the engine.\r
+        * @param fuelLevel -Performs an ad-hoc request for fuel level in the tank (percentage).\r
+        * @param fuelLevel_State -Performs an ad-hoc request for fuel level state.\r
+        * @param instantFuelConsumption -Performs an ad-hoc request for instantaneous fuel consumption in microlitres.\r
+        * @param externalTemperature -Performs an ad-hoc request for the external temperature in degrees celsius.\r
+        * @param vin -Performs an ad-hoc request for the Vehicle identification number\r
+        * @param prndl -Performs an ad-hoc request for PRNDL data that houses the selected gear.\r
+        * @param tirePressure -Performs an ad-hoc request for the TireStatus data containing status and pressure of tires. \r
+        * @param odometer -Performs an ad-hoc request for Odometer data in km.\r
+        * @param beltStatus -Performs an ad-hoc request for status of the seat belts.\r
+        * @param bodyInformation -Performs an ad-hoc request for  body information including power modes.\r
+        * @param deviceStatus -Performs an ad-hoc request for device status including signal and battery strength.\r
+        * @param driverBraking -Performs an ad-hoc request for the status of the brake pedal.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+       */\r
+       public void getvehicledata(boolean gps, boolean speed, boolean rpm, boolean fuelLevel, boolean fuelLevel_State,\r
+                                                          boolean instantFuelConsumption, boolean externalTemperature, boolean vin, boolean prndl, boolean tirePressure,\r
+                                                          boolean odometer, boolean beltStatus, boolean bodyInformation, boolean deviceStatus,\r
+                                                          boolean driverBraking, Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+       \r
+               GetVehicleData msg = RPCRequestFactory.BuildGetVehicleData(gps, speed, rpm, fuelLevel, fuelLevel_State, instantFuelConsumption, externalTemperature, vin, prndl, tirePressure, odometer,\r
+                                                                                                                                  beltStatus, bodyInformation, deviceStatus, driverBraking, correlationID);\r
+               sendRPCRequest(msg);\r
+       }\r
+\r
+\r
+       /**\r
+        *     Non periodic vehicle data read request\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param ecuName -Name of ECU.\r
+        * @param didLocation -Raw data from vehicle data DID location(s)\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+       */\r
+\r
+       public void readdid(Integer ecuName, Vector<Integer> didLocation, Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+               ReadDID msg = RPCRequestFactory.BuildReadDID(ecuName, didLocation, correlationID);              \r
+               sendRPCRequest(msg);            \r
+       }\r
+\r
+\r
+       /**\r
+        *     Vehicle module diagnostic trouble code request.\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param ecuName -Name of ECU.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+       */      \r
+       public void getdtcs(Integer ecuName, Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+               GetDTCs msg = RPCRequestFactory.BuildGetDTCs(ecuName, correlationID);           \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        *     Creates a full screen overlay containing a large block of formatted text that can be scrolled with up to 8 SoftButtons defined.\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param scrollableMessageBody -Body of text that can include newlines and tabs.\r
+        * @param timeout -App defined timeout.  Indicates how long of a timeout from the last action.\r
+        * @param softButtons -App defined SoftButtons.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+       */              \r
+       public void scrollablemessage(String scrollableMessageBody, Integer timeout, Vector<SoftButton> softButtons, Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+               ScrollableMessage msg = RPCRequestFactory.BuildScrollableMessage(scrollableMessageBody, timeout, softButtons, correlationID);           \r
+               sendRPCRequest(msg);\r
+       }\r
+\r
+\r
+       /**\r
+        *     Creates a full screen or pop-up overlay (depending on platform) with a single user controlled slider.\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param numTicks -Number of selectable items on a horizontal axis.\r
+        * @param position -Initial position of slider control (cannot exceed numTicks).\r
+        * @param sliderHeader -Text header to display.\r
+        * @param sliderFooter - Text footer to display (meant to display min/max threshold descriptors).\r
+        * @param timeout -App defined timeout.  Indicates how long of a timeout from the last action.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+       */      \r
+       public void slider(Integer numTicks, Integer position, String sliderHeader, Vector<String> sliderFooter, Integer timeout, Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+               Slider msg = RPCRequestFactory.BuildSlider(numTicks, position, sliderHeader, sliderFooter, timeout, correlationID);             \r
+               sendRPCRequest(msg);            \r
+       }\r
+\r
+       \r
+       /**     \r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param navigationText1\r
+        * @param navigationText2\r
+        * @param eta\r
+        * @param totalDistance\r
+        * @param turnIcon\r
+        * @param distanceToManeuver\r
+        * @param distanceToManeuverScale\r
+        * @param maneuverComplete\r
+        * @param softButtons\r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+       */              \r
+       public void showconstanttbt(String navigationText1, String navigationText2, String eta, String totalDistance, Image turnIcon, Double distanceToManeuver,\r
+                                                               Double distanceToManeuverScale, boolean maneuverComplete, Vector <SoftButton> softButtons, Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+               ShowConstantTBT msg = RPCRequestFactory.BuildShowConstantTBT(navigationText1, navigationText2, eta, totalDistance, turnIcon, distanceToManeuver, \r
+                                                                                                                                                                       distanceToManeuverScale, maneuverComplete, softButtons, correlationID);\r
+               sendRPCRequest(msg);\r
+       }\r
+\r
+\r
+       /**\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param ttsText\r
+        * @param softButtons\r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+       */\r
+       public void alertmaneuver(String ttsText, Vector<SoftButton> softButtons, Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+               AlertManeuver msg = RPCRequestFactory.BuildAlertManeuver(ttsText, softButtons, correlationID);\r
+               sendRPCRequest(msg);\r
+       }       \r
+       \r
+\r
+       /**\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param turnList\r
+        * @param softButtons\r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+       */\r
+       public void updateturnlist(Vector<Turn> turnList, Vector<SoftButton> softButtons, Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+               UpdateTurnList msg = RPCRequestFactory.BuildUpdateTurnList(turnList, softButtons, correlationID);               \r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param language\r
+        * @param hmiDisplayLanguage\r
+        * @param correlationID\r
+        * @throws SmartDeviceLinkException\r
+       */      \r
+       public void changeregistration(Language language, Language hmiDisplayLanguage, Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+               ChangeRegistration msg = RPCRequestFactory.BuildChangeRegistration(language, hmiDisplayLanguage, correlationID);\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+\r
+       /**\r
+        *     Used to push a binary data onto the SMARTDEVICELINK module from a mobile device, such as icons and album art.  Not supported on first generation SMARTDEVICELINK vehicles.\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param smartDeviceLinkFileName -File reference name.\r
+        * @param fileType -Selected file type.\r
+        * @param persistentFile -Indicates if the file is meant to persist between sessions / ignition cycles.\r
+        * @param fileData\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+       */      \r
+       public void putfile(String smartDeviceLinkFileName, FileType fileType, Boolean persistentFile, byte[] fileData, Integer correlationID) throws SmartDeviceLinkException \r
+       {\r
+               PutFile msg = RPCRequestFactory.buildPutFile(smartDeviceLinkFileName, fileType, persistentFile, fileData, correlationID);\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        *     Used to delete a file resident on the SMARTDEVICELINK module in the app's local cache.  Not supported on first generation SMARTDEVICELINK vehicles.\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param smartDeviceLinkFileName -File reference name.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+       */      \r
+       public void deletefile(String smartDeviceLinkFileName, Integer correlationID) throws SmartDeviceLinkException \r
+       {\r
+               DeleteFile msg = RPCRequestFactory.buildDeleteFile(smartDeviceLinkFileName, correlationID);\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        *     Requests the current list of resident filenames for the registered app.  Not supported on first generation SMARTDEVICELINK vehicles.\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+       */      \r
+       public void listfiles(Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+               ListFiles msg = RPCRequestFactory.buildListFiles(correlationID);\r
+               sendRPCRequest(msg);\r
+       }\r
+\r
+       /**\r
+        *     Used to set existing local file on SMARTDEVICELINK as the app's icon.  Not supported on first generation SMARTDEVICELINK vehicles.\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param smartDeviceLinkFileName -File reference name.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+       */      \r
+       public void setappicon(String smartDeviceLinkFileName, Integer correlationID) throws SmartDeviceLinkException \r
+       {\r
+               SetAppIcon msg = RPCRequestFactory.buildSetAppIcon(smartDeviceLinkFileName, correlationID);\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /**\r
+        *     Set an alternate display layout. If not sent, default screen for given platform will be shown.\r
+        *     Responses are captured through callback on IProxyListener.\r
+        * \r
+        * @param displayLayout -Predefined or dynamically created screen layout.\r
+        * @param correlationID -A unique ID that correlates each RPCRequest and RPCResponse.\r
+        * @throws SmartDeviceLinkException\r
+       */      \r
+       public void setdisplaylayout(String displayLayout, Integer correlationID) throws SmartDeviceLinkException\r
+       {\r
+               SetDisplayLayout msg = RPCRequestFactory.BuildSetDisplayLayout(displayLayout, correlationID);\r
+               sendRPCRequest(msg);\r
+       }\r
+       \r
+       /******************** END Public Helper Methods *************************/\r
+       \r
+       /**\r
+        * Gets type of transport currently used by this SmartDeviceLinkProxy.\r
+        * \r
+        * @return One of TransportType enumeration values.\r
+        * \r
+        * @see TransportType\r
+        */\r
+       public TransportType getCurrentTransportType() throws IllegalStateException {\r
+               if (_smartDeviceLinkConnection  == null) {\r
+                       throw new IllegalStateException("Incorrect state of SmartDeviceLinkProxyBase: Calling for getCurrentTransportType() while connection is not initialized");\r
+               }\r
+                       \r
+               return _smartDeviceLinkConnection.getCurrentTransportType();\r
+       }\r
+       \r
+} // end-class
\ No newline at end of file