javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src/btplatformcontrolnative.cpp
equal
deleted
inserted
replaced
49 jstring result; |
49 jstring result; |
50 try |
50 try |
51 { |
51 { |
52 result = java::util::JniUtils::wstringToJstring(aJni, *devAddress); |
52 result = java::util::JniUtils::wstringToJstring(aJni, *devAddress); |
53 } |
53 } |
54 catch (ExceptionBase ex) |
54 catch (ExceptionBase &ex) |
55 { |
55 { |
56 result = NULL; |
56 result = NULL; |
57 } |
57 } |
58 |
58 |
59 |
59 |
80 { |
80 { |
81 return NULL; |
81 return NULL; |
82 } |
82 } |
83 |
83 |
84 std::wstring *devName = control->getBluetoothName(); |
84 std::wstring *devName = control->getBluetoothName(); |
85 jstring result; |
85 |
86 try |
86 jstring result = NULL; |
87 { |
87 try |
88 result = java::util::JniUtils::wstringToJstring(aJni, *devName); |
88 { |
89 } |
89 if (NULL != devName) |
90 catch (ExceptionBase ex) |
90 { |
|
91 result = java::util::JniUtils::wstringToJstring(aJni, *devName); |
|
92 } |
|
93 } |
|
94 catch (ExceptionBase &ex) |
91 { |
95 { |
92 result = NULL; |
96 result = NULL; |
93 } |
97 } |
94 |
98 |
95 |
|
96 delete devName; |
99 delete devName; |
97 delete control; |
100 delete control; |
98 |
|
99 return result; |
101 return result; |
100 } |
102 } |
101 |
103 |
102 |
104 |
103 /* |
105 /* |
222 |
224 |
223 try |
225 try |
224 { |
226 { |
225 name = java::util::JniUtils::jstringToWstring(aJni, appName); |
227 name = java::util::JniUtils::jstringToWstring(aJni, appName); |
226 } |
228 } |
227 catch (ExceptionBase ex) |
229 catch (ExceptionBase &ex) |
228 { |
230 { |
229 name=L"Unknown Application"; |
231 name=L"Unknown Application"; |
230 } |
232 } |
231 |
233 |
232 BluetoothPlatformControl* control = |
234 BluetoothPlatformControl* control = |
268 |
270 |
269 try |
271 try |
270 { |
272 { |
271 name = java::util::JniUtils::jstringToWstring(aJni, appName); |
273 name = java::util::JniUtils::jstringToWstring(aJni, appName); |
272 } |
274 } |
273 catch (ExceptionBase ex) |
275 catch (ExceptionBase &ex) |
274 { |
276 { |
275 name=L"Unknown Application"; |
277 name=L"Unknown Application"; |
276 } |
278 } |
277 |
279 |
278 BluetoothPlatformControl* control = |
280 BluetoothPlatformControl* control = |
325 try |
327 try |
326 { |
328 { |
327 result = java::util::JniUtils::wstringToJstring(aJni, |
329 result = java::util::JniUtils::wstringToJstring(aJni, |
328 control->getSystemProperty(aPropertyId)); |
330 control->getSystemProperty(aPropertyId)); |
329 } |
331 } |
330 catch (ExceptionBase ex) |
332 catch (ExceptionBase &ex) |
331 { |
333 { |
332 result = NULL; |
334 result = NULL; |
333 } |
335 } |
334 |
336 |
335 delete control; |
337 delete control; |