SDL_Android/SmartDeviceLinkAndroidProxy - added the correct version of the proxy
[profile/ivi/smartdevicelink.git] / SDL_Android / SmartDeviceLinkProxyAndroid / src / com / smartdevicelink / proxy / SmartDeviceLinkProxy.java
1 package com.smartdevicelink.proxy;\r
2 \r
3 import java.util.Vector;\r
4 \r
5 import com.smartdevicelink.exception.SmartDeviceLinkException;\r
6 import com.smartdevicelink.exception.SmartDeviceLinkExceptionCause;\r
7 import com.smartdevicelink.proxy.rpc.smartdevicelinkMsgVersion;\r
8 import com.smartdevicelink.proxy.rpc.enums.Language;\r
9 import com.smartdevicelink.trace.SmartDeviceLinkTrace;\r
10 import com.smartdevicelink.transport.BTTransportConfig;\r
11 import com.smartdevicelink.transport.BaseTransportConfig;\r
12 import com.smartdevicelink.transport.TransportType;\r
13 @Deprecated\r
14 public class SmartDeviceLinkProxy extends SmartDeviceLinkProxyBase<IProxyListener> {\r
15         \r
16         private static final String SMARTDEVICELINK_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";\r
17         private static final String SMARTDEVICELINK_LIB_PRIVATE_TOKEN = "{DAE1A88C-6C16-4768-ACA5-6F1247EA01C2}";\r
18 \r
19         /**\r
20          * Constructor for the SmartDeviceLinkProxy object, the proxy for communicating between the App and SMARTDEVICELINK. \r
21          * \r
22          * @param listener - Reference to the object in the App listening to callbacks from SMARTDEVICELINK. \r
23          * @throws SmartDeviceLinkException\r
24          */\r
25         @Deprecated\r
26         public SmartDeviceLinkProxy(IProxyListener listener) throws SmartDeviceLinkException {\r
27                 super(  listener, \r
28                                 /*application context*/null, \r
29                                 /*enable advanced lifecycle management*/false, \r
30                                 /*app name*/ null,\r
31                                 /*TTS Name*/null,\r
32                                 /*ngn media screen app name*/null,\r
33                                 /*vr synonyms*/null,\r
34                                 /*is media app*/ null,\r
35                                 /*smartDeviceLinkMsgVersion*/null,\r
36                                 /*language desired*/null,\r
37                                 /*HMI Display Language Desired*/null,\r
38                                 /*App Type*/null,\r
39                                 /*App ID*/null,\r
40                                 /*autoActivateID*/null,\r
41                                 /*callbackToUIThread*/ true,\r
42                                 new BTTransportConfig());\r
43                 \r
44                 SmartDeviceLinkTrace.logProxyEvent("Application constructed SmartDeviceLinkProxy instance passing in: IProxyListener.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
45         }\r
46         \r
47         /**\r
48          * Constructor for the SmartDeviceLinkProxy object, the proxy for communicating between the App and SMARTDEVICELINK. \r
49          * \r
50          * @param listener - Reference to the object in the App listening to callbacks from SMARTDEVICELINK. \r
51          * @param smartDeviceLinkProxyConfigurationResources\r
52          * @throws SmartDeviceLinkException\r
53          */\r
54         @Deprecated\r
55         public SmartDeviceLinkProxy(IProxyListener listener, SmartDeviceLinkProxyConfigurationResources smartDeviceLinkProxyConfigurationResources) \r
56                 throws SmartDeviceLinkException {\r
57                 super(  listener, \r
58                                 smartDeviceLinkProxyConfigurationResources, \r
59                                 /*enable advanced lifecycle management*/false, \r
60                                 /*app name*/ null,\r
61                                 /*TTS Name*/null,\r
62                                 /*ngn media screen app name*/null,\r
63                                 /*vr synonyms*/null,\r
64                                 /*is media app*/ null,\r
65                                 /*smartDeviceLinkMsgVersion*/null,\r
66                                 /*language desired*/null,\r
67                                 /*HMI Display Language Desired*/null,\r
68                                 /*App Type*/null,\r
69                                 /*App ID*/null,\r
70                                 /*autoActivateID*/null,\r
71                                 /*callbackToUIThread*/ true,\r
72                                 new BTTransportConfig());\r
73                 \r
74                 SmartDeviceLinkTrace.logProxyEvent("Application constructed SmartDeviceLinkProxy instance passing in: IProxyListener, SmartDeviceLinkProxyConfigurationResources.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
75         }\r
76         \r
77         /**\r
78          * Constructor for the SmartDeviceLinkProxy object, the proxy for communicating between the App and SMARTDEVICELINK.\r
79          * \r
80          * @param listener - Reference to the object in the App listening to callbacks from SMARTDEVICELINK. \r
81          * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.\r
82          * @throws SmartDeviceLinkException\r
83          */\r
84         @Deprecated\r
85         public SmartDeviceLinkProxy(IProxyListener listener, boolean callbackToUIThread) throws SmartDeviceLinkException {\r
86                 super(  listener,  \r
87                                 /*smartDeviceLink proxy configuration resources*/null,\r
88                                 /*enable advanced lifecycle management*/false, \r
89                                 /*app name*/ null,\r
90                                 /*TTS Name*/null,\r
91                                 /*ngn media screen app name*/null,\r
92                                 /*vr synonyms*/null,\r
93                                 /*is media app*/ null,\r
94                                 /*smartDeviceLinkMsgVersion*/null,\r
95                                 /*language desired*/null,\r
96                                 /*HMI Display Language Desired*/null,\r
97                                 /*App Type*/null,\r
98                                 /*App ID*/null,\r
99                                 /*autoActivateID*/null,\r
100                                 callbackToUIThread,\r
101                                 new BTTransportConfig());\r
102                 \r
103                 SmartDeviceLinkTrace.logProxyEvent("Application constructed SmartDeviceLinkProxy instance passing in: IProxyListener, callBackToUIThread.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
104         }\r
105         \r
106         /**\r
107          * Constructor for the SmartDeviceLinkProxy object, the proxy for communicating between the App and SMARTDEVICELINK.\r
108          * \r
109          * @param listener - Reference to the object in the App listening to callbacks from SMARTDEVICELINK.\r
110          * @param smartDeviceLinkProxyConfigurationResources \r
111          * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.\r
112          * @throws SmartDeviceLinkException\r
113          */\r
114         @Deprecated\r
115         public SmartDeviceLinkProxy(IProxyListener listener, SmartDeviceLinkProxyConfigurationResources smartDeviceLinkProxyConfigurationResources, \r
116                         boolean callbackToUIThread) throws SmartDeviceLinkException {\r
117                 super(  listener,  \r
118                                 smartDeviceLinkProxyConfigurationResources,\r
119                                 /*enable advanced lifecycle management*/false, \r
120                                 /*app name*/ null,\r
121                                 /*TTS Name*/null,\r
122                                 /*ngn media screen app name*/null,\r
123                                 /*vr synonyms*/null,\r
124                                 /*is media app*/ null,\r
125                                 /*smartDeviceLinkMsgVersion*/null,\r
126                                 /*language desired*/null,\r
127                                 /*HMI Display Language Desired*/null,\r
128                                 /*App Type*/null,\r
129                                 /*App ID*/null,\r
130                                 /*autoActivateID*/null,\r
131                                 callbackToUIThread,\r
132                                 new BTTransportConfig());\r
133                 \r
134                 SmartDeviceLinkTrace.logProxyEvent("Application constructed SmartDeviceLinkProxy instance passing in: IProxyListener, callBackToUIThread.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
135         }\r
136         \r
137         /********************************************** TRANSPORT SWITCHING SUPPORT *****************************************/\r
138 \r
139         /**\r
140          * Constructor for the SmartDeviceLinkProxy object, the proxy for communicating between the App and SMARTDEVICELINK. \r
141          * \r
142          * @param listener - Reference to the object in the App listening to callbacks from SMARTDEVICELINK.\r
143          * @param transportConfig Initial configuration for transport.\r
144          * @throws SmartDeviceLinkException\r
145          */\r
146         @Deprecated\r
147         public SmartDeviceLinkProxy(IProxyListener listener, BaseTransportConfig transportConfig) throws SmartDeviceLinkException {\r
148                 super(  listener, \r
149                                 /*application context*/null, \r
150                                 /*enable advanced lifecycle management*/false, \r
151                                 /*app name*/ null,\r
152                                 /*TTS Name*/null,\r
153                                 /*ngn media screen app name*/null,\r
154                                 /*vr synonyms*/null,\r
155                                 /*is media app*/ null,\r
156                                 /*smartDeviceLinkMsgVersion*/null,\r
157                                 /*language desired*/null,\r
158                                 /*HMI Display Language Desired*/null,\r
159                                 /*App Type*/null,\r
160                                 /*App ID*/null,\r
161                                 /*autoActivateID*/null,\r
162                                 /*callbackToUIThread*/ true,\r
163                                 transportConfig);\r
164                 \r
165                 SmartDeviceLinkTrace.logProxyEvent("Application constructed SmartDeviceLinkProxy instance passing in: IProxyListener.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
166         }\r
167         \r
168         /**\r
169          * Constructor for the SmartDeviceLinkProxy object, the proxy for communicating between the App and SMARTDEVICELINK. \r
170          * \r
171          * @param listener - Reference to the object in the App listening to callbacks from SMARTDEVICELINK. \r
172          * @param smartDeviceLinkProxyConfigurationResources\r
173          * @param transportConfig Initial configuration for transport.\r
174          * @throws SmartDeviceLinkException\r
175          */\r
176         @Deprecated\r
177         public SmartDeviceLinkProxy(IProxyListener listener, SmartDeviceLinkProxyConfigurationResources smartDeviceLinkProxyConfigurationResources, \r
178                                         BaseTransportConfig transportConfig) \r
179                 throws SmartDeviceLinkException {\r
180                 super(  listener, \r
181                                 smartDeviceLinkProxyConfigurationResources, \r
182                                 /*enable advanced lifecycle management*/false, \r
183                                 /*app name*/ null,\r
184                                 /*TTS Name*/null,\r
185                                 /*ngn media screen app name*/null,\r
186                                 /*vr synonyms*/null,\r
187                                 /*is media app*/ null,\r
188                                 /*smartDeviceLinkMsgVersion*/null,\r
189                                 /*language desired*/null,\r
190                                 /*HMI Display Language Desired*/null,\r
191                                 /*App Type*/null,\r
192                                 /*App ID*/null,\r
193                                 /*autoActivateID*/null,\r
194                                 /*callbackToUIThread*/ true,\r
195                                 transportConfig);\r
196                 \r
197                 SmartDeviceLinkTrace.logProxyEvent("Application constructed SmartDeviceLinkProxy instance passing in: IProxyListener, SmartDeviceLinkProxyConfigurationResources.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
198         }\r
199         \r
200         /**\r
201          * Constructor for the SmartDeviceLinkProxy object, the proxy for communicating between the App and SMARTDEVICELINK.\r
202          * \r
203          * @param listener - Reference to the object in the App listening to callbacks from SMARTDEVICELINK. \r
204          * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.\r
205          * @param transportConfig Initial configuration for transport.\r
206          * @throws SmartDeviceLinkException\r
207          */\r
208         @Deprecated\r
209         public SmartDeviceLinkProxy(IProxyListener listener, boolean callbackToUIThread, BaseTransportConfig transportConfig) throws SmartDeviceLinkException {\r
210                 super(  listener,  \r
211                                 /*smartDeviceLink proxy configuration resources*/null,\r
212                                 /*enable advanced lifecycle management*/false, \r
213                                 /*app name*/ null,\r
214                                 /*TTS Name*/null,\r
215                                 /*ngn media screen app name*/null,\r
216                                 /*vr synonyms*/null,\r
217                                 /*is media app*/ null,\r
218                                 /*smartDeviceLinkMsgVersion*/null,\r
219                                 /*language desired*/null,\r
220                                 /*HMI Display Language Desired*/null,\r
221                                 /*App Type*/null,\r
222                                 /*App ID*/null,\r
223                                 /*autoActivateID*/null,\r
224                                 callbackToUIThread,\r
225                                 transportConfig);\r
226                 \r
227                 SmartDeviceLinkTrace.logProxyEvent("Application constructed SmartDeviceLinkProxy instance passing in: IProxyListener, callBackToUIThread.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
228         }\r
229         \r
230         /**\r
231          * Constructor for the SmartDeviceLinkProxy object, the proxy for communicating between the App and SMARTDEVICELINK.\r
232          * \r
233          * @param listener - Reference to the object in the App listening to callbacks from SMARTDEVICELINK.\r
234          * @param smartDeviceLinkProxyConfigurationResources \r
235          * @param callbackToUIThread - If true, all callbacks will occur on the UI thread.\r
236          * @param transportConfig Initial configuration for transport.\r
237          * @throws SmartDeviceLinkException\r
238          */\r
239         @Deprecated\r
240         public SmartDeviceLinkProxy(IProxyListener listener, SmartDeviceLinkProxyConfigurationResources smartDeviceLinkProxyConfigurationResources, \r
241                         boolean callbackToUIThread, BaseTransportConfig transportConfig) throws SmartDeviceLinkException {\r
242                 super(  listener,  \r
243                                 smartDeviceLinkProxyConfigurationResources,\r
244                                 /*enable advanced lifecycle management*/false, \r
245                                 /*app name*/ null,\r
246                                 /*TTS Name*/null,\r
247                                 /*ngn media screen app name*/null,\r
248                                 /*vr synonyms*/null,\r
249                                 /*is media app*/ null,\r
250                                 /*smartDeviceLinkMsgVersion*/null,\r
251                                 /*language desired*/null,\r
252                                 /*HMI Display Language Desired*/null,\r
253                                 /*App Type*/null,\r
254                                 /*App ID*/null,\r
255                                 /*autoActivateID*/null,\r
256                                 callbackToUIThread,\r
257                                 transportConfig);\r
258                 \r
259                 SmartDeviceLinkTrace.logProxyEvent("Application constructed SmartDeviceLinkProxy instance passing in: IProxyListener, callBackToUIThread.", SMARTDEVICELINK_LIB_TRACE_KEY);\r
260         }\r
261                 \r
262         /******************** Public Helper Methods *************************/\r
263         \r
264         \r
265         /**\r
266          *  Sends a RegisterAppInterface RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
267          *  \r
268          *  @param smartDeviceLinkMsgVersion\r
269          *  @param appName\r
270          *  @param ngnMediaScreenAppName\r
271          *  @param vrSynonyms\r
272          *  @param isMediaApp\r
273          *  @param languageDesired\r
274          *  @param autoActivateID\r
275          *  @param correlationID\r
276          *  \r
277          *  @throws SmartDeviceLinkException\r
278          */\r
279         @Deprecated\r
280         public void registerAppInterface(\r
281                         smartdevicelinkMsgVersion smartDeviceLinkMsgVersion, String appName, String ngnMediaScreenAppName,\r
282                         Vector<String> vrSynonyms, Boolean isMediaApp, Language languageDesired, Language hmiDisplayLanguageDesired,\r
283                         String appID, String autoActivateID, Integer correlationID) \r
284                         throws SmartDeviceLinkException {\r
285                 \r
286                 // Test if proxy has been disposed\r
287                 if (_proxyDisposed) {\r
288                         throw new SmartDeviceLinkException("This SmartDeviceLinkProxy object has been disposed, it is no long capable of sending requests.", SmartDeviceLinkExceptionCause.SMARTDEVICELINK_PROXY_DISPOSED);\r
289                 }\r
290                 \r
291                 registerAppInterfacePrivate(\r
292                                 smartDeviceLinkMsgVersion, \r
293                                 appName,\r
294                                 null,\r
295                                 ngnMediaScreenAppName,\r
296                                 vrSynonyms,\r
297                                 isMediaApp, \r
298                                 languageDesired,\r
299                                 hmiDisplayLanguageDesired,\r
300                                 null,\r
301                                 appID,\r
302                                 autoActivateID,\r
303                                 correlationID);\r
304         }\r
305         \r
306         /**\r
307          * Sends a RegisterAppInterface RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
308          * \r
309          * @param appName\r
310          * @param isMediaApp\r
311          * @param autoActivateID\r
312          * @throws SmartDeviceLinkException\r
313          */\r
314         @Deprecated\r
315         public void registerAppInterface(\r
316                         String appName, Boolean isMediaApp, String appID, String autoActivateID, Integer correlationID) \r
317                         throws SmartDeviceLinkException {\r
318                 \r
319                 registerAppInterface(\r
320                                 /*smartDeviceLinkMsgVersion*/null, \r
321                                 appName,\r
322                                 /*ngnMediaScreenAppName*/null,\r
323                                 /*vrSynonyms*/null,\r
324                                 isMediaApp, \r
325                                 /*languageDesired*/null,\r
326                                 /*hmiDisplayLanguageDesired*/null,\r
327                                 appID,\r
328                                 autoActivateID,\r
329                                 correlationID);\r
330         }\r
331         \r
332         /**\r
333          * Sends a RegisterAppInterface RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
334          * \r
335          * @param appName\r
336          * @throws SmartDeviceLinkException\r
337          */\r
338         @Deprecated\r
339         public void registerAppInterface(String appName, String appID, Integer correlationID) \r
340                         throws SmartDeviceLinkException {\r
341                 \r
342                 registerAppInterface(appName, false, appID, "", correlationID);\r
343         }\r
344         \r
345         /**\r
346          * Sends an UnregisterAppInterface RPCRequest to SMARTDEVICELINK. Responses are captured through callback on IProxyListener.\r
347          * \r
348          * @param correlationID\r
349          * @throws SmartDeviceLinkException\r
350          */\r
351         @Deprecated\r
352         public void unregisterAppInterface(Integer correlationID) \r
353                         throws SmartDeviceLinkException {               \r
354                 // Test if proxy has been disposed\r
355                 if (_proxyDisposed) {\r
356                         throw new SmartDeviceLinkException("This SmartDeviceLinkProxy object has been disposed, it is no long capable of executing methods.", \r
357                                                                                 SmartDeviceLinkExceptionCause.SMARTDEVICELINK_PROXY_DISPOSED);\r
358                 }               \r
359                                 \r
360                 unregisterAppInterfacePrivate(correlationID);\r
361         }\r
362         \r
363         /**\r
364          * Returns is isConnected state of the SMARTDEVICELINK transport.\r
365          * \r
366          * @return Boolean isConnected\r
367          */\r
368         @Deprecated\r
369         public Boolean getIsConnected() {\r
370                 return super.getIsConnected();\r
371         }\r
372 \r
373 }\r