diff options
author | Markos Rapitis <mrapitis@ford.com> | 2015-09-03 10:26:58 -0400 |
---|---|---|
committer | Markos Rapitis <mrapitis@ford.com> | 2015-09-03 10:26:58 -0400 |
commit | 360ee5d46dfb08010ec955ef81da6734754ac731 (patch) | |
tree | 21791648adb217abdde5af50ae1f6baabe6aa110 | |
parent | 98a4b5b4eae54cfc0aac4e6178621acfa3547484 (diff) | |
download | sdl_android-feature/enhanced-framework.tar.gz |
Removed the old abstraction layer.feature/enhanced-framework
35 files changed, 1 insertions, 1448 deletions
diff --git a/sdl_android_lib/src/com/smartdevicelink/exception/IncorrectListenerException.java b/sdl_android_lib/src/com/smartdevicelink/exception/IncorrectListenerException.java index 57496a682..7a680a563 100644 --- a/sdl_android_lib/src/com/smartdevicelink/exception/IncorrectListenerException.java +++ b/sdl_android_lib/src/com/smartdevicelink/exception/IncorrectListenerException.java @@ -1,6 +1,6 @@ package com.smartdevicelink.exception; -import com.smartdevicelink.old.abstraction.listeners.NotificationListener; +import com.smartdevicelink.abstraction.listener.NotificationListener; import com.smartdevicelink.proxy.RPCRequest; public class IncorrectListenerException extends RuntimeException { diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/AddCommandWithListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/AddCommandWithListener.java deleted file mode 100644 index c339e755c..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/AddCommandWithListener.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.smartdevicelink.old.abstraction; - -import com.smartdevicelink.old.abstraction.listeners.OnCommandListener; -import com.smartdevicelink.proxy.rpc.AddCommand; - -public class AddCommandWithListener extends AddCommand{ - - private OnCommandListener mListener; - - public void setListener(OnCommandListener listener){ - mListener = listener; - } - - public OnCommandListener getListener() { - return mListener; - } - -}
\ No newline at end of file diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/PerformAudioPassThruWithListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/PerformAudioPassThruWithListener.java deleted file mode 100644 index 2112be432..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/PerformAudioPassThruWithListener.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.smartdevicelink.old.abstraction; - -import com.smartdevicelink.old.abstraction.listeners.AudioPassThruListener; -import com.smartdevicelink.proxy.rpc.PerformAudioPassThru; - -public class PerformAudioPassThruWithListener extends PerformAudioPassThru { - - private AudioPassThruListener mListener; - - public AudioPassThruListener getListener() { - return mListener; - } - - public void setListener(AudioPassThruListener mListener) { - this.mListener = mListener; - } -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SdlAbstraction.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SdlAbstraction.java deleted file mode 100644 index c3eb88308..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SdlAbstraction.java +++ /dev/null @@ -1,521 +0,0 @@ -package com.smartdevicelink.old.abstraction; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import android.app.Service; -import android.util.Log; -import android.util.SparseArray; - -import com.smartdevicelink.exception.SdlException; -import com.smartdevicelink.old.abstraction.listeners.AddCommandWithListener; -import com.smartdevicelink.old.abstraction.listeners.AudioPassThruListener; -import com.smartdevicelink.old.abstraction.listeners.ButtonListener; -import com.smartdevicelink.old.abstraction.listeners.DriverDistractionListener; -import com.smartdevicelink.old.abstraction.listeners.FirstFullHMINotificationListener; -import com.smartdevicelink.old.abstraction.listeners.HMINotificationListener; -import com.smartdevicelink.old.abstraction.listeners.HashChangeListener; -import com.smartdevicelink.old.abstraction.listeners.MissingListenerException; -import com.smartdevicelink.old.abstraction.listeners.OnCommandListener; -import com.smartdevicelink.old.abstraction.listeners.PerformAudioPassThruWithListener; -import com.smartdevicelink.old.abstraction.listeners.RPCListener; -import com.smartdevicelink.old.abstraction.listeners.RegisterAppInterfaceResponseListener; -import com.smartdevicelink.old.abstraction.listeners.ResumeDataPersistenceListener; -import com.smartdevicelink.old.abstraction.listeners.ServiceEndedListener; -import com.smartdevicelink.old.abstraction.listeners.SoftButtonWithListener; -import com.smartdevicelink.old.abstraction.listeners.StreamRPCListener; -import com.smartdevicelink.old.abstraction.listeners.StreamRPCResponseListener; -import com.smartdevicelink.old.abstraction.listeners.SubscribeButtonWithListener; -import com.smartdevicelink.old.abstraction.listeners.SubscribeVehicleDataListener; -import com.smartdevicelink.old.abstraction.listeners.VehicleDataListener; -import com.smartdevicelink.old.abstraction.view.SDLView; -import com.smartdevicelink.old.abstraction.view.SDLViewManager; -import com.smartdevicelink.proxy.RPCNotification; -import com.smartdevicelink.proxy.RPCRequest; -import com.smartdevicelink.proxy.RPCResponse; -import com.smartdevicelink.proxy.RPCStreamController; -import com.smartdevicelink.proxy.SdlProxyALM; -import com.smartdevicelink.proxy.SdlProxyConfigurationResources; -import com.smartdevicelink.proxy.callbacks.OnServiceEnded; -import com.smartdevicelink.proxy.interfaces.ISoftButton; -import com.smartdevicelink.proxy.rpc.AddCommand; -import com.smartdevicelink.proxy.rpc.DeleteCommand; -import com.smartdevicelink.proxy.rpc.DeleteCommandResponse; -import com.smartdevicelink.proxy.rpc.MenuParams; -import com.smartdevicelink.proxy.rpc.OnAudioPassThru; -import com.smartdevicelink.proxy.rpc.OnButtonEvent; -import com.smartdevicelink.proxy.rpc.OnButtonPress; -import com.smartdevicelink.proxy.rpc.OnCommand; -import com.smartdevicelink.proxy.rpc.OnDriverDistraction; -import com.smartdevicelink.proxy.rpc.OnHMIStatus; -import com.smartdevicelink.proxy.rpc.OnHashChange; -import com.smartdevicelink.proxy.rpc.OnLanguageChange; -import com.smartdevicelink.proxy.rpc.OnLockScreenStatus; -import com.smartdevicelink.proxy.rpc.OnPermissionsChange; -import com.smartdevicelink.proxy.rpc.OnStreamRPC; -import com.smartdevicelink.proxy.rpc.OnVehicleData; -import com.smartdevicelink.proxy.rpc.PerformAudioPassThru; -import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse; -import com.smartdevicelink.proxy.rpc.SdlMsgVersion; -import com.smartdevicelink.proxy.rpc.SoftButton; -import com.smartdevicelink.proxy.rpc.StreamRPCResponse; -import com.smartdevicelink.proxy.rpc.SubscribeButton; -import com.smartdevicelink.proxy.rpc.SubscribeVehicleData; -import com.smartdevicelink.proxy.rpc.TTSChunk; -import com.smartdevicelink.proxy.rpc.UnsubscribeButton; -import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse; -import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleData; -import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleDataResponse; -import com.smartdevicelink.proxy.rpc.enums.AppHMIType; -import com.smartdevicelink.proxy.rpc.enums.ButtonName; -import com.smartdevicelink.proxy.rpc.enums.FileType; -import com.smartdevicelink.proxy.rpc.enums.HMILevel; -import com.smartdevicelink.proxy.rpc.enums.Language; -import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason; -import com.smartdevicelink.transport.BaseTransportConfig; - -public abstract class SdlAbstraction { - - //Proxy Functional Objects - private SdlProxyListener mSdlProxyListener; - private SDLViewManager mViewManager; - - //Life Cycle Listeners - private Vector<FirstFullHMINotificationListener> mFirstHMINotificationListeners; - private Vector<HMINotificationListener> mHMINotificationListeners; - private Vector<HashChangeListener> mHashChangeListeners; - private Vector<ResumeDataPersistenceListener> mResumeDataPersistenceListeners; - - //Response Listeners - private SparseArray<RPCListener> mRPCResponseListeners; - private SparseArray<SDLView> mViewResponseListeners; - private SparseArray<RPCRequest> mUnSubscribeListeners; - - //Notification Listeners - private Map<ButtonName, ButtonListener> mButtonListeners; - private SparseArray<SoftButtonWithListener> mCustomButtonListeners; - private AudioPassThruListener mAudioPassThruListener; - private SparseArray<OnCommandListener> mOnCommandListeners; - private VehicleDataListener mVehicleDataListener; - private Vector<DriverDistractionListener> mDriverDistractionListeners; - private Vector<RegisterAppInterfaceResponseListener> mRegisterAppInterfaceResponseListeners; - private StreamRPCListener mStreamRPCListener; - private StreamRPCResponseListener mStreamRPCResponseListener; - private ServiceEndedListener mServiceEndedListener; - private RPCStreamController mPutfileStreamController; - - private SdlProxyALM mSdlProxy; - - private boolean mIsConnected= false; - - private int coorId = 0; - private int cmdID = 0; - private int softButtonID = 0; - - private static final int CORRELATION_ID = 0; - private static final int COMMAND_ID = 1; - private static final int SOFTBUTTON_ID = 2; - - //max value for correlation id = 65527 for legacy compatibility - private static final int MAX_CORRELATION_ID = 65527; - - //min value for command id = 0 max value for command id = 2000000000 according to spec - private static final int MAX_COMMAND_ID = 2000000000; - - //min value for softbutton id = 0 max value for softbutton id = 65535 according to spec - private static final int MAX_SOFTBUTTON_ID = 65535; - - public SdlAbstraction(){ - mRPCResponseListeners = new SparseArray<RPCListener>(5); - mSdlProxyListener = new SdlProxyListener(this); - mButtonListeners = new HashMap<ButtonName, ButtonListener>(); - mCustomButtonListeners = new SparseArray<SoftButtonWithListener>(); - mOnCommandListeners = new SparseArray<OnCommandListener>(); - mViewResponseListeners = new SparseArray<SDLView>(); - mHMINotificationListeners = new Vector<HMINotificationListener>(); - mHashChangeListeners = new Vector<HashChangeListener>(); - mResumeDataPersistenceListeners = new Vector<ResumeDataPersistenceListener>(); - mFirstHMINotificationListeners = new Vector<FirstFullHMINotificationListener>(); - mRegisterAppInterfaceResponseListeners = new Vector<RegisterAppInterfaceResponseListener>(); - mDriverDistractionListeners = new Vector<DriverDistractionListener>(); - mUnSubscribeListeners = new SparseArray<RPCRequest>(); - mViewManager = new SDLViewManager(); - mHMINotificationListeners.add(mViewManager.hmiListener); - } - - //start proxy - protected final void startProxy(String appName, boolean isMedia, String appId, Service appService, SdlProxyConfigurationResources sdlProxyConfigurationResources, Vector<TTSChunk> ttsName, String sNgnAppName, Vector<String> vrSynonyms, SdlMsgVersion sdlMsgVersion, Language languageDesired, Language hmiDisplayLanguageDesired, Vector<AppHMIType> appType, String autoActivateID, boolean callbackToUIThread, boolean preRegister, String sAppResumeHash, BaseTransportConfig transportConfig) throws SdlException{ - if (mSdlProxy == null) - { - mSdlProxy = new SdlProxyALM(appService,mSdlProxyListener,null,appName,ttsName,sNgnAppName,vrSynonyms,isMedia,null,languageDesired,hmiDisplayLanguageDesired,appType,appId,null,false,false,sAppResumeHash,transportConfig); - } - } - - public final RPCStreamController putFileStream(String sPath, String sdlFileName, Long iOffset, FileType fileType, Boolean bPersistentFile, Boolean bSystemFile, Integer iCorrelationID) throws SdlException { - if (mSdlProxy != null) - { - mPutfileStreamController = mSdlProxy.putFileStream(sPath, sdlFileName, iOffset, fileType, bPersistentFile, bSystemFile, iCorrelationID); - return mPutfileStreamController; - } - return null; - } - - public final void sendRPCRequest(RPCRequest request) throws SdlException { - sendRPCRequest(request, null); - } - - public final void sendRPCRequest(RPCRequest request, RPCListener rpcListener) throws SdlException { - autoIncID(CORRELATION_ID); - Integer coorid = getAutoIncID(CORRELATION_ID); - request.setCorrelationID(coorid); - if(rpcListener != null) - mRPCResponseListeners.put(coorid, rpcListener); - - if(request instanceof SDLView){ - mViewManager.viewInitialized((SDLView)request); - mViewResponseListeners.put(coorid, (SDLView)request); - } - - if (request instanceof ISoftButton) { - ISoftButton buttonRPC = (ISoftButton)request; - List<SoftButton> buttons = buttonRPC.getSoftButtons(); - if (buttons != null && buttons.size() > 0){ - for (int i = 0; i < buttons.size(); i++) { - try { - SoftButtonWithListener buttonWithListener = (SoftButtonWithListener)buttons.get(i); - if(buttonWithListener.getListener() == null) - throw new MissingListenerException(request); - autoIncID(SOFTBUTTON_ID); - Integer iSoftBtnID = getAutoIncID(SOFTBUTTON_ID); - buttonWithListener.setSoftButtonID(iSoftBtnID); - mCustomButtonListeners.put(buttonWithListener.getSoftButtonID(), buttonWithListener); - } catch (ClassCastException e) { - throw new MissingListenerException(request); - } - } - } - } else if (request instanceof PerformAudioPassThru){ - if(!(request instanceof PerformAudioPassThruWithListener)) throw new MissingListenerException(request); - if(((PerformAudioPassThruWithListener)request).getListener() == null) throw new MissingListenerException(request); - - mAudioPassThruListener = ((PerformAudioPassThruWithListener)request).getListener(); - } else if(request instanceof AddCommand){ - if(!(request instanceof AddCommandWithListener)) throw new MissingListenerException(request); - if(((AddCommandWithListener)request).getListener() == null) throw new MissingListenerException(request); - - autoIncID(COMMAND_ID); - Integer iCommandID = getAutoIncID(COMMAND_ID); - ((AddCommand)request).setCmdID(iCommandID); - mOnCommandListeners.put(iCommandID, ((AddCommandWithListener)request).getListener()); - - } else if(request instanceof SubscribeButton){ - if(!(request instanceof SubscribeButtonWithListener)) throw new MissingListenerException(request); - if(((SubscribeButtonWithListener)request).getListener() == null) throw new MissingListenerException(request); - - mButtonListeners.put(((SubscribeButtonWithListener)request).getButtonName(), ((SubscribeButtonWithListener)request).getListener()); - } else if(request instanceof SubscribeVehicleData){ - if(!(request instanceof SubscribeVehicleDataListener)) throw new MissingListenerException(request); - if(((SubscribeVehicleDataListener)request).getListener() == null) throw new MissingListenerException(request); - - mVehicleDataListener = ((SubscribeVehicleDataListener)request).getListener(); - } else if (request instanceof UnsubscribeButton) { - - mUnSubscribeListeners.put(coorid, (UnsubscribeButton)request); - } else if(request instanceof UnsubscribeVehicleData) { - - mUnSubscribeListeners.put(coorid, (UnsubscribeVehicleData)request); - } else if(request instanceof DeleteCommand) { - - mUnSubscribeListeners.put(coorid, (DeleteCommand)request); - } - - //TODO add more "notification" type RPCs - if (mSdlProxy != null) - { - mSdlProxy.sendRPCRequest(request); - } - else - { - //TODO Add the appropriate exception here - Log.e("sendRPCRequest", "proxy object is null, cannot send RPC request"); - } - } - - public final void handleResponse(RPCResponse response){ - int coorId = response.getCorrelationID(); - if(mViewResponseListeners.get(coorId) != null){ - mViewManager.viewShown(mViewResponseListeners.get(coorId)); - mViewResponseListeners.remove(coorId); - } - - if(response instanceof UnsubscribeButtonResponse) { - if(mUnSubscribeListeners.get(coorId) != null) { - if (response.getSuccess()) { - UnsubscribeButton request = (UnsubscribeButton) mUnSubscribeListeners.get(coorId); - mButtonListeners.remove(request.getButtonName()); - } - mUnSubscribeListeners.remove(coorId); - } - } - - if(response instanceof DeleteCommandResponse) { - if(mUnSubscribeListeners.get(coorId) != null) { - if (response.getSuccess()) { - DeleteCommand request = (DeleteCommand) mUnSubscribeListeners.get(coorId); - mOnCommandListeners.remove(request.getCmdID()); - } - mUnSubscribeListeners.remove(coorId); - } - } - - if(response instanceof UnsubscribeVehicleDataResponse) { - if(mUnSubscribeListeners.get(coorId) != null) { - if (response.getSuccess()) { - mVehicleDataListener = null; - } - mUnSubscribeListeners.remove(coorId); - } - } - - RPCListener listener = mRPCResponseListeners.get(coorId); - if(listener != null){ - listener.handleResponse(response); - mRPCResponseListeners.remove(coorId); - } - } - - - public final void handleNotification(RPCNotification notification){ - if(notification instanceof OnButtonPress){ - ButtonListener listener = null; - OnButtonPress buttonPress = (OnButtonPress)notification; - if(buttonPress.getButtonName() != ButtonName.CUSTOM_BUTTON) - listener = mButtonListeners.get(buttonPress.getButtonName()); - else - { - //Since we have the SoftButtonWithListener object, we can get the listener and the text on the button for future use - SoftButtonWithListener softButtonObj = mCustomButtonListeners.get(buttonPress.getCustomButtonName()); - listener = softButtonObj.getListener(); - } - if(listener!=null) listener.handleButtonPress((OnButtonPress)notification); - } else if (notification instanceof OnButtonEvent){ - ButtonListener listener = null; - OnButtonEvent buttonEvent = (OnButtonEvent)notification; - if(buttonEvent.getButtonName() != ButtonName.CUSTOM_BUTTON) - listener = mButtonListeners.get(buttonEvent.getButtonName()); - else - { - //Since we have the SoftButtonWithListener object, we can get the listener and the text on the button for future use - SoftButtonWithListener softButtonObj = mCustomButtonListeners.get(buttonEvent.getCustomButtonID()); - listener = softButtonObj.getListener(); - } - if(listener!=null) listener.handleButtonEvent((OnButtonEvent)buttonEvent); - } else if(notification instanceof OnAudioPassThru){ - OnAudioPassThru audioPass = (OnAudioPassThru)notification; - mAudioPassThruListener.handleAudioData(audioPass); - } else if(notification instanceof OnCommand){ - OnCommandListener listener = mOnCommandListeners.get(((OnCommand)notification).getCmdID()); - listener.handleCommand(((OnCommand)notification)); - } else if(notification instanceof OnVehicleData){ - mVehicleDataListener.handleVehicleData((OnVehicleData)notification); - } - - } - - public final void addDriverDistractionListener(DriverDistractionListener listener) { - mDriverDistractionListeners.add(listener); - } - - public final void addResumeDataPersistenceListener(ResumeDataPersistenceListener listener){ - mResumeDataPersistenceListeners.add(listener); - } - - public final void addHashChangeListener(HashChangeListener listener){ - mHashChangeListeners.add(listener); - } - - public final void addHMINotificationListener(HMINotificationListener listener){ - mHMINotificationListeners.add(listener); - } - public final void addRegisterAppInterfaceResponseListener(RegisterAppInterfaceResponseListener listener){ - mRegisterAppInterfaceResponseListeners.add(listener); - } - public final void addFirstFullHMINotificationListener(FirstFullHMINotificationListener listener){ - mFirstHMINotificationListeners.add(listener); - } - - public final void onResumeDataPersistenceListener(Boolean bSuccess) - { - for (ResumeDataPersistenceListener mResumeDataPersistenceListener : mResumeDataPersistenceListeners) { - if(mResumeDataPersistenceListener != null) - mResumeDataPersistenceListener.onResumeDataPersistence(bSuccess); - } - } - public final void onRegisterAppInterfaceResponse(RegisterAppInterfaceResponse response) - { - for (RegisterAppInterfaceResponseListener mRegisterAppInterfaceResponseListener : mRegisterAppInterfaceResponseListeners) { - if(mRegisterAppInterfaceResponseListener != null) - mRegisterAppInterfaceResponseListener.onRegisterAppInterfaceResponse(response); - } - } - public final void onHashChange(OnHashChange notification) - { - for (HashChangeListener mHashChangeListener : mHashChangeListeners) { - if(mHashChangeListener != null) - mHashChangeListener.onHashChange(notification); - } - } - - public final void onStreamRPCListener(OnStreamRPC notification) - { - if(mStreamRPCListener != null) - mStreamRPCListener.onStreamRPC(notification); - } - - public final void onStreamRPCResponseListener(StreamRPCResponse response) - { - if(mStreamRPCResponseListener != null) - mStreamRPCResponseListener.onStreamRPCResponse(response); - } - - public final void onServiceEndedListener(OnServiceEnded serviceEnded) - { - if(mServiceEndedListener != null) - mServiceEndedListener.onServiceEnded(serviceEnded); - } - - public final void setStreamRPCListener(StreamRPCListener listener){ - mStreamRPCListener = listener; - } - - public final void setStreamRPCResponseListener(StreamRPCResponseListener listener){ - mStreamRPCResponseListener = listener; - } - - public final void setServiceEndedListener(ServiceEndedListener listener){ - mServiceEndedListener = listener; - } - - public final void onHMIStatus(OnHMIStatus status){ - if(!mIsConnected){ - mIsConnected = true; - } - - for (HMINotificationListener hmiListener : mHMINotificationListeners) { - if(hmiListener != null) - hmiListener.onHMIStatus(status); - } - - if(status.getHmiLevel() == HMILevel.HMI_FULL - && status.getFirstRun() - && mFirstHMINotificationListeners != null){ - for (FirstFullHMINotificationListener mFirstHMINotificationListener : mFirstHMINotificationListeners) { - if(mFirstHMINotificationListener != null) { - mFirstHMINotificationListener.onFirstHMIFull(); - sendAboutAddCommand(); - } - } - } - } - - public final boolean getIsSdlConnected(){ - return mIsConnected; - } - public final void onError(String arg0, Exception arg1){ - mSdlProxy = null; - mIsConnected = false; - onError(arg1, arg0); - } - - public final void onProxyClosed(String error, Exception ex,SdlDisconnectedReason reason){ - mSdlProxy = null; - mIsConnected = false; - onProxyClosed(ex, reason); - } - - public abstract void onOnLockScreenNotification(OnLockScreenStatus status); - public abstract void onOnLanguageChange(OnLanguageChange languageChange); - public abstract void onOnPermissionsChange(OnPermissionsChange permissions); - public abstract void onProxyClosed(Exception ex,SdlDisconnectedReason reason); - public abstract void onError(Exception ex,String info); - - public final void onDriverDistraction(OnDriverDistraction arg0){ -// mDriverDistractionListener.onDriverDistraction(arg0.getState()); - for (DriverDistractionListener mDriverDistractionListener : mDriverDistractionListeners) { - if(mDriverDistractionListener != null) - mDriverDistractionListener.onDriverDistraction(arg0); - } - } - - private Integer getAutoIncID(int iTypePar){ - if (iTypePar == CORRELATION_ID) - return coorId; - else if (iTypePar == COMMAND_ID) - return cmdID; - else if (iTypePar == SOFTBUTTON_ID) - return softButtonID; - - return null; - } - - - private void autoIncID(int iTypePar){ - if (iTypePar == CORRELATION_ID) - { - if (coorId < MAX_CORRELATION_ID) - coorId++; - else - coorId = 0; - } - else if (iTypePar == COMMAND_ID) - { - if (cmdID < MAX_COMMAND_ID) - cmdID++; - else - cmdID = 0; - } - else if (iTypePar == SOFTBUTTON_ID) - { - if (softButtonID < MAX_SOFTBUTTON_ID) - softButtonID++; - else - softButtonID = 0; - } - } - - private void sendAboutAddCommand(){ - AddCommandWithListener ac = new AddCommandWithListener(); - autoIncID(CORRELATION_ID); - ac.setCorrelationID(getAutoIncID(CORRELATION_ID)); - MenuParams menuParams = new MenuParams(); - menuParams.setMenuName("About SDL"); - ac.setMenuParams(menuParams); - Vector<String> vrCommands = new Vector<String>(); - vrCommands.add("About SDL"); - ac.setVrCommands(vrCommands); - ac.setListener(aboutSdlListener); - try { - sendRPCRequest(ac, new RPCListener() { - - @Override - public void handleResponse(RPCResponse response) { - if(!response.getSuccess()) - Log.w("SDL Abstraction", "Unable to add about menu"); - } - }); - } catch (SdlException e) { - e.printStackTrace(); - } - } - - private OnCommandListener aboutSdlListener = new OnCommandListener() { - - @Override - public void handleCommand(OnCommand command) { - Log.i("Sdl Abstraction", "About Pressed"); - - } - }; -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SdlBase.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SdlBase.java deleted file mode 100644 index a9e9a8973..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SdlBase.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.smartdevicelink.old.abstraction; - -import java.util.Vector; - -import com.smartdevicelink.exception.SdlException; -import com.smartdevicelink.exception.WrongThreadException; -import com.smartdevicelink.old.abstraction.SdlAbstraction; -import com.smartdevicelink.proxy.SdlProxyConfigurationResources; -import com.smartdevicelink.proxy.interfaces.IProxyListenerALM; -import com.smartdevicelink.proxy.rpc.SdlMsgVersion; -import com.smartdevicelink.proxy.rpc.TTSChunk; -import com.smartdevicelink.proxy.rpc.enums.AppHMIType; -import com.smartdevicelink.proxy.rpc.enums.Language; -import com.smartdevicelink.transport.BTTransportConfig; -import com.smartdevicelink.transport.BaseTransportConfig; - -import android.app.Service; -import android.os.Looper; - -public abstract class SdlBase extends SdlAbstraction { - - protected String appId; - protected boolean isMedia; - protected String appName; - protected static Object SDL_LOCK = new Object(); - - protected Service appService = null; - protected IProxyListenerALM listener = null; - protected SdlProxyConfigurationResources sdlProxyConfigurationResources = null; - protected Vector<TTSChunk> ttsName = null; - protected String sNgnAppName = null; - protected Vector<String> vrSynonyms = null; - protected SdlMsgVersion sdlMsgVersion = null; - protected Language languageDesired = null; - protected Language hmiDisplayLanguageDesired = null; - protected Vector<AppHMIType> appType = null; - protected String autoActivateID = null; - protected boolean callbackToUIThread; - protected boolean preRegister; - protected BaseTransportConfig transportConfig = new BTTransportConfig(); - protected String sAppResumeHash; - - - protected SdlBase() { - super(); - } - - public void startProxy(){ - synchronized (SDL_LOCK) { - try { - super.startProxy(appName, isMedia, appId, appService, sdlProxyConfigurationResources, ttsName, sNgnAppName, vrSynonyms, sdlMsgVersion, languageDesired, hmiDisplayLanguageDesired, appType, autoActivateID, callbackToUIThread, preRegister, sAppResumeHash, transportConfig); - } catch (SdlException e) { - e.printStackTrace(); - } - } - } - - protected void threadCheck() { - if(Thread.currentThread() == Looper.getMainLooper().getThread()) - throw new WrongThreadException(); - } -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SdlProxyListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SdlProxyListener.java deleted file mode 100644 index b79eb9e17..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SdlProxyListener.java +++ /dev/null @@ -1,391 +0,0 @@ -package com.smartdevicelink.old.abstraction; - -import com.smartdevicelink.old.abstraction.SdlAbstraction; -import com.smartdevicelink.proxy.callbacks.OnServiceEnded; -import com.smartdevicelink.proxy.callbacks.OnServiceNACKed; -import com.smartdevicelink.proxy.interfaces.IProxyListenerABS; -import com.smartdevicelink.proxy.rpc.AddCommandResponse; -import com.smartdevicelink.proxy.rpc.AddSubMenuResponse; -import com.smartdevicelink.proxy.rpc.AlertManeuverResponse; -import com.smartdevicelink.proxy.rpc.AlertResponse; -import com.smartdevicelink.proxy.rpc.ChangeRegistrationResponse; -import com.smartdevicelink.proxy.rpc.CreateInteractionChoiceSetResponse; -import com.smartdevicelink.proxy.rpc.DeleteCommandResponse; -import com.smartdevicelink.proxy.rpc.DeleteFileResponse; -import com.smartdevicelink.proxy.rpc.DeleteInteractionChoiceSetResponse; -import com.smartdevicelink.proxy.rpc.DeleteSubMenuResponse; -import com.smartdevicelink.proxy.rpc.DiagnosticMessageResponse; -import com.smartdevicelink.proxy.rpc.DialNumberResponse; -import com.smartdevicelink.proxy.rpc.EndAudioPassThruResponse; -import com.smartdevicelink.proxy.rpc.GenericResponse; -import com.smartdevicelink.proxy.rpc.GetDTCsResponse; -import com.smartdevicelink.proxy.rpc.GetVehicleDataResponse; -import com.smartdevicelink.proxy.rpc.ListFilesResponse; -import com.smartdevicelink.proxy.rpc.OnAudioPassThru; -import com.smartdevicelink.proxy.rpc.OnButtonEvent; -import com.smartdevicelink.proxy.rpc.OnButtonPress; -import com.smartdevicelink.proxy.rpc.OnCommand; -import com.smartdevicelink.proxy.rpc.OnDriverDistraction; -import com.smartdevicelink.proxy.rpc.OnHMIStatus; -import com.smartdevicelink.proxy.rpc.OnHashChange; -import com.smartdevicelink.proxy.rpc.OnKeyboardInput; -import com.smartdevicelink.proxy.rpc.OnLanguageChange; -import com.smartdevicelink.proxy.rpc.OnLockScreenStatus; -import com.smartdevicelink.proxy.rpc.OnPermissionsChange; -import com.smartdevicelink.proxy.rpc.OnStreamRPC; -import com.smartdevicelink.proxy.rpc.OnSystemRequest; -import com.smartdevicelink.proxy.rpc.OnTBTClientState; -import com.smartdevicelink.proxy.rpc.OnTouchEvent; -import com.smartdevicelink.proxy.rpc.OnVehicleData; -import com.smartdevicelink.proxy.rpc.PerformAudioPassThruResponse; -import com.smartdevicelink.proxy.rpc.PerformInteractionResponse; -import com.smartdevicelink.proxy.rpc.PutFileResponse; -import com.smartdevicelink.proxy.rpc.ReadDIDResponse; -import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse; -import com.smartdevicelink.proxy.rpc.ResetGlobalPropertiesResponse; -import com.smartdevicelink.proxy.rpc.ScrollableMessageResponse; -import com.smartdevicelink.proxy.rpc.SendLocationResponse; -import com.smartdevicelink.proxy.rpc.SetAppIconResponse; -import com.smartdevicelink.proxy.rpc.SetDisplayLayoutResponse; -import com.smartdevicelink.proxy.rpc.SetGlobalPropertiesResponse; -import com.smartdevicelink.proxy.rpc.SetMediaClockTimerResponse; -import com.smartdevicelink.proxy.rpc.ShowConstantTbtResponse; -import com.smartdevicelink.proxy.rpc.ShowResponse; -import com.smartdevicelink.proxy.rpc.SliderResponse; -import com.smartdevicelink.proxy.rpc.SpeakResponse; -import com.smartdevicelink.proxy.rpc.StreamRPCResponse; -import com.smartdevicelink.proxy.rpc.SubscribeButtonResponse; -import com.smartdevicelink.proxy.rpc.SubscribeVehicleDataResponse; -import com.smartdevicelink.proxy.rpc.SystemRequestResponse; -import com.smartdevicelink.proxy.rpc.UnsubscribeButtonResponse; -import com.smartdevicelink.proxy.rpc.UnsubscribeVehicleDataResponse; -import com.smartdevicelink.proxy.rpc.UpdateTurnListResponse; -import com.smartdevicelink.proxy.rpc.enums.SdlDisconnectedReason; - -public class SdlProxyListener implements IProxyListenerABS{ - - private SdlAbstraction mAbstraction; - - public SdlProxyListener(SdlAbstraction sdlAbstraction) { - mAbstraction = sdlAbstraction; - } - - @Override - public void onAddCommandResponse(AddCommandResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onAddSubMenuResponse(AddSubMenuResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onAlertResponse(AlertResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onChangeRegistrationResponse(ChangeRegistrationResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onCreateInteractionChoiceSetResponse(CreateInteractionChoiceSetResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onDeleteCommandResponse(DeleteCommandResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onDeleteFileResponse(DeleteFileResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onDeleteInteractionChoiceSetResponse(DeleteInteractionChoiceSetResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onDeleteSubMenuResponse(DeleteSubMenuResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onDiagnosticMessageResponse(DiagnosticMessageResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onEndAudioPassThruResponse(EndAudioPassThruResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onError(String arg0, Exception arg1) { - mAbstraction.onError(arg0, arg1); - } - - @Override - public void onGenericResponse(GenericResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onGetDTCsResponse(GetDTCsResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onGetVehicleDataResponse(GetVehicleDataResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onListFilesResponse(ListFilesResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onOnAudioPassThru(OnAudioPassThru arg0) { - mAbstraction.handleNotification(arg0); - } - - @Override - public void onOnButtonEvent(OnButtonEvent arg0) { - mAbstraction.handleNotification(arg0); - } - - @Override - public void onOnButtonPress(OnButtonPress arg0) { - mAbstraction.handleNotification(arg0); - - } - - @Override - public void onOnCommand(OnCommand arg0) { - mAbstraction.handleNotification(arg0); - } - - @Override - public void onOnDriverDistraction(OnDriverDistraction arg0) { - mAbstraction.onDriverDistraction(arg0); - } - - @Override - public void onOnHMIStatus(OnHMIStatus arg0) { - mAbstraction.onHMIStatus(arg0); - } - - @Override - public void onOnHashChange(OnHashChange arg0) { - mAbstraction.onHashChange(arg0); - - } - - @Override - public void onOnKeyboardInput(OnKeyboardInput arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void onOnLanguageChange(OnLanguageChange arg0) { -// mAbstraction.onLanguageChange(arg0); - } - - @Override - public void onOnLockScreenNotification(OnLockScreenStatus arg0) { - mAbstraction.onOnLockScreenNotification(arg0); - } - - @Override - public void onOnPermissionsChange(OnPermissionsChange arg0) { - mAbstraction.onOnPermissionsChange(arg0); - } - - @Override - public void onOnSystemRequest(OnSystemRequest arg0) { -// mAbstraction.handleResponse(arg0); - } - - @Override - public void onOnTBTClientState(OnTBTClientState arg0) { -// mAbstraction.handleResponse(arg0); - } - - @Override - public void onOnTouchEvent(OnTouchEvent arg0) { - } - - @Override - public void onOnVehicleData(OnVehicleData arg0) { - mAbstraction.handleNotification(arg0); - } - - @Override - public void onPerformAudioPassThruResponse(PerformAudioPassThruResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onPerformInteractionResponse(PerformInteractionResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onProxyClosed(String arg0, Exception arg1,SdlDisconnectedReason arg2) { - mAbstraction.onProxyClosed(arg0, arg1, arg2); - } - - @Override - public void onPutFileResponse(PutFileResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onReadDIDResponse(ReadDIDResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onResetGlobalPropertiesResponse(ResetGlobalPropertiesResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onScrollableMessageResponse(ScrollableMessageResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onSetAppIconResponse(SetAppIconResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onSetDisplayLayoutResponse(SetDisplayLayoutResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onSetGlobalPropertiesResponse(SetGlobalPropertiesResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onSetMediaClockTimerResponse(SetMediaClockTimerResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onShowResponse(ShowResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onSliderResponse(SliderResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onSpeakResponse(SpeakResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onSubscribeButtonResponse(SubscribeButtonResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onSubscribeVehicleDataResponse(SubscribeVehicleDataResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onSystemRequestResponse(SystemRequestResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onUnsubscribeButtonResponse(UnsubscribeButtonResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onUnsubscribeVehicleDataResponse(UnsubscribeVehicleDataResponse arg0) { - mAbstraction.handleResponse(arg0); - } - - @Override - public void onRegisterAppInterfaceResponse(RegisterAppInterfaceResponse response) { - mAbstraction.onRegisterAppInterfaceResponse(response); - } - - @Override - public void onResumeDataPersistence(Boolean bSuccess) { - mAbstraction.onResumeDataPersistenceListener(bSuccess); - } - - @Override - public void onOnStreamRPC(OnStreamRPC notification) { - mAbstraction.onStreamRPCListener(notification); - } - - @Override - public void onStreamRPCResponse(StreamRPCResponse response) { - mAbstraction.onStreamRPCResponseListener(response); - } - - @Override - public void onServiceEnded(OnServiceEnded serviceEnded) { - mAbstraction.onServiceEndedListener(serviceEnded); - - } - - @Override - public void onServiceNACKed(OnServiceNACKed serviceNACKed) { - - } - - @Override - public void onDialNumberResponse(DialNumberResponse response) { - // TODO Auto-generated method stub - - } - - @Override - public void onSendLocationResponse(SendLocationResponse response) { - // TODO Auto-generated method stub - - } - - @Override - public void onShowConstantTbtResponse(ShowConstantTbtResponse response) { - // TODO Auto-generated method stub - - } - - @Override - public void onAlertManeuverResponse(AlertManeuverResponse response) { - // TODO Auto-generated method stub - - } - - @Override - public void onUpdateTurnListResponse(UpdateTurnListResponse response) { - // TODO Auto-generated method stub - - } - - @Override - public void onServiceDataACK() { - // TODO Auto-generated method stub - - } -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SoftButtonWithListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SoftButtonWithListener.java deleted file mode 100644 index 5817ab508..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SoftButtonWithListener.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.smartdevicelink.old.abstraction; - -import com.smartdevicelink.old.abstraction.listeners.ButtonListener; -import com.smartdevicelink.proxy.rpc.SoftButton; - -public class SoftButtonWithListener extends SoftButton { - - private ButtonListener mListener; - - public void setListener(ButtonListener listener){ - mListener = listener; - } - - public ButtonListener getListener() { - return mListener; - } -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SubscribeButtonWithListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SubscribeButtonWithListener.java deleted file mode 100644 index e23b3fbcb..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SubscribeButtonWithListener.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.smartdevicelink.old.abstraction; - -import com.smartdevicelink.old.abstraction.listeners.ButtonListener; -import com.smartdevicelink.proxy.rpc.SubscribeButton; - -public class SubscribeButtonWithListener extends SubscribeButton { - - private ButtonListener mListener; - - public ButtonListener getListener() { - return mListener; - } - - public void setListener(ButtonListener mListener) { - this.mListener = mListener; - } -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SubscribeVehicleDataWithListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SubscribeVehicleDataWithListener.java deleted file mode 100644 index b4332c6ec..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/SubscribeVehicleDataWithListener.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.smartdevicelink.old.abstraction; - -import com.smartdevicelink.old.abstraction.listeners.VehicleDataListener; -import com.smartdevicelink.proxy.rpc.SubscribeVehicleData; - -public class SubscribeVehicleDataWithListener extends SubscribeVehicleData { - private VehicleDataListener mListener; - - public void setListener(VehicleDataListener listener) { - mListener = listener; - } - - public VehicleDataListener getListener(){ - return mListener; - } - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/AddCommandWithListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/AddCommandWithListener.java deleted file mode 100755 index 552ecd770..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/AddCommandWithListener.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import java.util.Hashtable; - -import com.smartdevicelink.old.abstraction.listeners.OnCommandListener; -import com.smartdevicelink.proxy.rpc.AddCommand; - -public class AddCommandWithListener extends AddCommand{ - - private OnCommandListener mListener; - public AddCommandWithListener() { } - - public AddCommandWithListener(Hashtable hash) { - super(hash); - } - public void setListener(OnCommandListener listener){ - mListener = listener; - } - - public OnCommandListener getListener() { - return mListener; - } - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/AudioPassThruListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/AudioPassThruListener.java deleted file mode 100644 index 808fd5c1f..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/AudioPassThruListener.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.proxy.rpc.OnAudioPassThru; - -public interface AudioPassThruListener extends NotificationListener{ - - public void handleAudioData(OnAudioPassThru audioPass); - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/ButtonListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/ButtonListener.java deleted file mode 100644 index ee271c370..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/ButtonListener.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.old.abstraction.listeners.NotificationListener; -import com.smartdevicelink.proxy.rpc.OnButtonEvent; -import com.smartdevicelink.proxy.rpc.OnButtonPress; - -public interface ButtonListener extends NotificationListener{ - - public void handleButtonPress(OnButtonPress onButtonPress); - public void handleButtonEvent(OnButtonEvent onButtonEvent); - -}
\ No newline at end of file diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/DriverDistractionListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/DriverDistractionListener.java deleted file mode 100644 index 666bb53a3..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/DriverDistractionListener.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.old.abstraction.listeners.NotificationListener; -import com.smartdevicelink.proxy.rpc.OnDriverDistraction; -import com.smartdevicelink.proxy.rpc.enums.DriverDistractionState; - - -public interface DriverDistractionListener extends NotificationListener { - - public void onDriverDistraction(OnDriverDistraction driverDistraction); - -}
\ No newline at end of file diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/FirstFullHMINotificationListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/FirstFullHMINotificationListener.java deleted file mode 100644 index 8b5a70f0a..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/FirstFullHMINotificationListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -public interface FirstFullHMINotificationListener { - - public void onFirstHMIFull(); - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/HMINotificationListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/HMINotificationListener.java deleted file mode 100644 index d284fa541..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/HMINotificationListener.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.proxy.rpc.OnHMIStatus; - -public interface HMINotificationListener { - - public void onHMIStatus(OnHMIStatus status); - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/HashChangeListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/HashChangeListener.java deleted file mode 100644 index 92ead8725..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/HashChangeListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.proxy.rpc.OnHashChange; - -public interface HashChangeListener { - public void onHashChange(OnHashChange notification); -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/MissingListenerException.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/MissingListenerException.java deleted file mode 100755 index a5485ec32..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/MissingListenerException.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.proxy.RPCRequest; - -public class MissingListenerException extends RuntimeException { - - /** - * - */ - private static final long serialVersionUID = 9046907383014253528L; - - private RPCRequest mRequest; - - public MissingListenerException(RPCRequest request) { - mRequest = request; - } - - @Override - public String getLocalizedMessage() { - return "Your "+mRequest.getClass().getName()+" needs a listener. You have to include a listener inside the RPC using the <RPC>WithListener class"; - } - - @Override - public String getMessage() { - return "Your "+mRequest.getClass().getName()+" needs a listener. You have to include a listener inside the RPC using the <RPC>WithListener class"; - } - - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/NotificationListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/NotificationListener.java deleted file mode 100644 index 19814af43..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/NotificationListener.java +++ /dev/null @@ -1,3 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -public interface NotificationListener {}
\ No newline at end of file diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/OnCommandListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/OnCommandListener.java deleted file mode 100644 index 09f4d45ed..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/OnCommandListener.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.old.abstraction.listeners.NotificationListener; -import com.smartdevicelink.proxy.rpc.OnCommand; - -public interface OnCommandListener extends NotificationListener { - - public void handleCommand(OnCommand command); - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/OnLanguageChangeListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/OnLanguageChangeListener.java deleted file mode 100644 index f97fc0402..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/OnLanguageChangeListener.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.proxy.rpc.OnLanguageChange; - -public interface OnLanguageChangeListener { - - public void onOnLanguageChange(OnLanguageChange languageChange); -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/OnLockScreenNotificationListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/OnLockScreenNotificationListener.java deleted file mode 100644 index 0f9036735..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/OnLockScreenNotificationListener.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.proxy.rpc.OnLockScreenStatus; - -public interface OnLockScreenNotificationListener { - - public void onOnLockScreenNotification(OnLockScreenStatus notification); -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/OnPermissionsChangeListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/OnPermissionsChangeListener.java deleted file mode 100644 index b1052b84f..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/OnPermissionsChangeListener.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.proxy.rpc.OnPermissionsChange; - -public interface OnPermissionsChangeListener { - - public void onOnPermissionsChange(OnPermissionsChange notification); -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/PerformAudioPassThruWithListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/PerformAudioPassThruWithListener.java deleted file mode 100755 index 81480ed81..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/PerformAudioPassThruWithListener.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import java.util.Hashtable; - -import com.smartdevicelink.old.abstraction.listeners.AudioPassThruListener; -import com.smartdevicelink.proxy.rpc.PerformAudioPassThru; - -public class PerformAudioPassThruWithListener extends PerformAudioPassThru { - - private AudioPassThruListener mListener; - public PerformAudioPassThruWithListener() { } - - public PerformAudioPassThruWithListener(Hashtable hash) { - super(hash); - } - public AudioPassThruListener getListener() { - return mListener; - } - - public void setListener(AudioPassThruListener mListener) { - this.mListener = mListener; - } - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/RPCListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/RPCListener.java deleted file mode 100644 index 04d9e3a94..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/RPCListener.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.proxy.RPCResponse; - -public interface RPCListener { - - public void handleResponse(RPCResponse response); - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/RegisterAppInterfaceResponseListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/RegisterAppInterfaceResponseListener.java deleted file mode 100644 index 839134c11..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/RegisterAppInterfaceResponseListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.proxy.rpc.RegisterAppInterfaceResponse; - -public interface RegisterAppInterfaceResponseListener { - public void onRegisterAppInterfaceResponse(RegisterAppInterfaceResponse response); -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/ResumeDataPersistenceListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/ResumeDataPersistenceListener.java deleted file mode 100644 index 619a7c79c..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/ResumeDataPersistenceListener.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -public interface ResumeDataPersistenceListener { - public void onResumeDataPersistence(Boolean bSuccess); -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/ServiceEndedListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/ServiceEndedListener.java deleted file mode 100644 index d83f252e1..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/ServiceEndedListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.proxy.callbacks.OnServiceEnded; - -public interface ServiceEndedListener { - public void onServiceEnded(OnServiceEnded serviceEnded); -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/SoftButtonWithListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/SoftButtonWithListener.java deleted file mode 100755 index bc05435dd..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/SoftButtonWithListener.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import java.util.Hashtable; - -import com.smartdevicelink.old.abstraction.listeners.ButtonListener; -import com.smartdevicelink.proxy.rpc.SoftButton; - -public class SoftButtonWithListener extends SoftButton { - - private ButtonListener mListener; - - public SoftButtonWithListener() { } - - public SoftButtonWithListener(Hashtable hash) { - super(hash); - } - - public void setListener(ButtonListener listener){ - mListener = listener; - } - - public ButtonListener getListener() { - return mListener; - } - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/StreamRPCListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/StreamRPCListener.java deleted file mode 100644 index af815d136..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/StreamRPCListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.proxy.rpc.OnStreamRPC; - -public interface StreamRPCListener { - public void onStreamRPC(OnStreamRPC notification); -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/StreamRPCResponseListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/StreamRPCResponseListener.java deleted file mode 100644 index f1b392a71..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/StreamRPCResponseListener.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.proxy.rpc.StreamRPCResponse; - -public interface StreamRPCResponseListener { - public void onStreamRPCResponse(StreamRPCResponse response); -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/SubscribeButtonWithListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/SubscribeButtonWithListener.java deleted file mode 100755 index f73351475..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/SubscribeButtonWithListener.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import java.util.Hashtable; - -import com.smartdevicelink.old.abstraction.listeners.ButtonListener; -import com.smartdevicelink.proxy.rpc.SubscribeButton; - -public class SubscribeButtonWithListener extends SubscribeButton { - - private ButtonListener mListener; - public SubscribeButtonWithListener() { } - - public SubscribeButtonWithListener(Hashtable hash) { - super(hash); - } - public ButtonListener getListener() { - return mListener; - } - - public void setListener(ButtonListener mListener) { - this.mListener = mListener; - } - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/SubscribeVehicleDataListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/SubscribeVehicleDataListener.java deleted file mode 100644 index 589679796..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/SubscribeVehicleDataListener.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import java.util.Hashtable; - -import com.smartdevicelink.old.abstraction.listeners.VehicleDataListener; -import com.smartdevicelink.proxy.rpc.SubscribeVehicleData; - -public class SubscribeVehicleDataListener extends SubscribeVehicleData { - - private VehicleDataListener mListener; - public SubscribeVehicleDataListener() { } - - public SubscribeVehicleDataListener(Hashtable hash) { - super(hash); - } - public VehicleDataListener getListener() { - return mListener; - } - - public void setListener(VehicleDataListener mListener) { - this.mListener = mListener; - } -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/VehicleDataListener.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/VehicleDataListener.java deleted file mode 100644 index 59d76654b..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/listeners/VehicleDataListener.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.smartdevicelink.old.abstraction.listeners; - -import com.smartdevicelink.old.abstraction.listeners.NotificationListener; -import com.smartdevicelink.proxy.rpc.OnVehicleData; - -public interface VehicleDataListener extends NotificationListener { - - public void handleVehicleData(OnVehicleData data); - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/view/SDLView.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/view/SDLView.java deleted file mode 100644 index faaf556e7..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/view/SDLView.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.smartdevicelink.old.abstraction.view; - -import java.util.Hashtable; - -import com.smartdevicelink.proxy.RPCRequest; - -public class SDLView extends RPCRequest { - - public SDLView(String functionName) { - super(functionName); - } - - public SDLView(Hashtable<String, Object> hash) { - super(hash); - } - - //TODO call when the view is sent. - public void onInitialize(){}; - - //TODO call when the view is successful - public void onShown(){}; - - //TODO call when the view was backgrounded but now in foreground again. - public void onReshown(){}; - - //TODO call when the view is sent to background. - public void onBackground(){}; - - //TODO call when the view is replaced by another view. - public void onDestroyed(){}; - -} diff --git a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/view/SDLViewManager.java b/sdl_android_lib/src/com/smartdevicelink/old/abstraction/view/SDLViewManager.java deleted file mode 100644 index e47ae79f4..000000000 --- a/sdl_android_lib/src/com/smartdevicelink/old/abstraction/view/SDLViewManager.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.smartdevicelink.old.abstraction.view; - -import java.util.List; -import java.util.Vector; - -import com.smartdevicelink.old.abstraction.listeners.HMINotificationListener; -import com.smartdevicelink.proxy.rpc.OnHMIStatus; -import com.smartdevicelink.proxy.rpc.enums.HMILevel; - -public class SDLViewManager { - - private List<SDLView> mViewStack; - // TODO better object tracking. Right now it is done by index. - // We have to figure out which methods the objects will be the same in the list - // and compare on the object. - public SDLViewManager() { - mViewStack = new Vector<SDLView>(); - } - - - //TODO This is before the show response is sent. - //This allows the app to send other RPCs before the view is displayed. - public void viewInitialized(SDLView view){ - view.onInitialize(); - } - - //TODO This is after the show response is successful - public void viewShown(SDLView view){ - if(view == null) - return; - mViewStack.add(0, view); - - //TODO do we want this before or after notifying the old view? - view.onShown(); - - if (mViewStack.size() < 2) return; - - SDLView oldView = mViewStack.get(1); - if(oldView == null) - return; - oldView.onBackground(); - oldView.onDestroyed(); - - } - - public HMINotificationListener hmiListener = new HMINotificationListener() { - - @Override - public void onHMIStatus(OnHMIStatus status) { - if (mViewStack.isEmpty()) return; - - SDLView view = mViewStack.get(0); - if(view == null) - return; - if(status.getHmiLevel() == HMILevel.HMI_BACKGROUND) - view.onBackground(); - } - }; - -} |