4bce852856793872376be600156817317a466c90
[platform/framework/web/wrt-plugins-tizen.git] / src / Systeminfo / JSDeviceCapabilitiesInfo.cpp
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 #include <fstream>
19 #include <pcrecpp.h>
20 #include <memory>
21 #include <dlfcn.h>
22 #include <unistd.h>
23 #include <JSWebAPIErrorFactory.h>
24 #include <SecurityExceptions.h>
25 #include <sensors.h>
26 #include <system_info.h>
27 #include <pkgmgr-info.h> 
28 #include "JSDeviceCapabilitiesInfo.h"
29 #include "plugin_config.h"
30 #include <Logger.h>
31
32 #define MAXBUFSIZE 256
33 #define DEVICE_PROFILE "MOBILE_FULL"
34
35 namespace DeviceAPI {
36 namespace Systeminfo {
37 using namespace WrtDeviceApis::CommonsJavaScript;
38 using namespace WrtDeviceApis::Commons;
39 using namespace DeviceAPI::Common;
40
41 namespace {
42 const char* DEVICE_CAPABILITIES_BLUETOOTH = "bluetooth";
43 const char* DEVICE_CAPABILITIES_NFC = "nfc";
44 const char* DEVICE_CAPABILITIES_NFC_RESERVED_PUSH = "nfcReservedPush";
45 const char* DEVICE_CAPABILITIES_MULTITOUCHCOUNT = "multiTouchCount";
46 const char* DEVICE_CAPABILITIES_INPUTKEYBOARD = "inputKeyboard";
47 const char* DEVICE_CAPABILITIES_INPUTKEYBOARD_LAYOUT = "inputKeyboardLayout";
48 const char* DEVICE_CAPABILITIES_WIFI = "wifi";
49 const char* DEVICE_CAPABILITIES_WIFIDIRECT = "wifiDirect";
50 const char* DEVICE_CAPABILITIES_OPENGLES = "opengles";
51 const char* DEVICE_CAPABILITIES_OPENGLES_TEXTURE_FORMAT = "openglestextureFormat";
52 const char* DEVICE_CAPABILITIES_OPENGLESVERSION1_1 = "openglesVersion1_1";
53 const char* DEVICE_CAPABILITIES_OPENGLESVERSION2_0 = "openglesVersion2_0";
54 const char* DEVICE_CAPABILITIES_FMRADIO = "fmRadio";
55 const char* DEVICE_CAPABILITIES_PLATFORMVERSION = "platformVersion";
56 const char* DEVICE_CAPABILITIES_PLATFORMNAME = "platformName";
57 const char* DEVICE_CAPABILITIES_WEBAPIVERSION = "webApiVersion";
58 const char* DEVICE_CAPABILITIES_NATIVEAPIVERSION = "nativeApiVersion";
59 const char* DEVICE_CAPABILITIES_CAMERA = "camera";
60 const char* DEVICE_CAPABILITIES_CAMERAFRONT = "cameraFront";
61 const char* DEVICE_CAPABILITIES_CAMERAFRONTFLASH = "cameraFrontFlash";
62 const char* DEVICE_CAPABILITIES_CAMERABACK = "cameraBack";
63 const char* DEVICE_CAPABILITIES_CAMERABACKFLASH = "cameraBackFlash";
64 const char* DEVICE_CAPABILITIES_LOCATION = "location";
65 const char* DEVICE_CAPABILITIES_LOCATIONGPS = "locationGps";
66 const char* DEVICE_CAPABILITIES_LOCATIONWPS = "locationWps";
67 const char* DEVICE_CAPABILITIES_MICROPHONE = "microphone";
68 const char* DEVICE_CAPABILITIES_USBHOST = "usbHost";
69 const char* DEVICE_CAPABILITIES_USBACCESSORY = "usbAccessory";
70 const char* DEVICE_CAPABILITIES_SCREENOUTPUTRCA = "screenOutputRca";
71 const char* DEVICE_CAPABILITIES_SCREENOUTPUTHDMI = "screenOutputHdmi";
72 const char* DEVICE_CAPABILITIES_PLATFORMCORECPUARCH = "platformCoreCpuArch";
73 const char* DEVICE_CAPABILITIES_PLATFORMCOREFPUARCH = "platformCoreFpuArch";
74 const char* DEVICE_CAPABILITIES_SIPVOIP = "sipVoip";
75 const char* DEVICE_CAPABILITIES_DUID = "duid";
76 const char* DEVICE_CAPABILITIES_SPEECH_ROCOGNITION = "speechRecognition";
77 const char* DEVICE_CAPABILITIES_SPEECH_SYNTHESIS = "speechSynthesis";
78 const char* DEVICE_CAPABILITIES_ACCELEROMETER = "accelerometer";
79 const char* DEVICE_CAPABILITIES_ACCELEROMETER_WAKEUP = "accelerometerWakeup";
80 const char* DEVICE_CAPABILITIES_BAROMETER = "barometer";
81 const char* DEVICE_CAPABILITIES_BAROMETER_WAKEUP = "barometerWakeup";
82 const char* DEVICE_CAPABILITIES_GYROSCOPE = "gyroscope";
83 const char* DEVICE_CAPABILITIES_GYROSCOPE_WAKEUP = "gyroscopeWakeup";
84 const char* DEVICE_CAPABILITIES_MAGNETOMETER = "magnetometer";
85 const char* DEVICE_CAPABILITIES_MAGNETOMETER_WAKEUP = "magnetometerWakeup";
86 const char* DEVICE_CAPABILITIES_PHOTOMETER = "photometer";
87 const char* DEVICE_CAPABILITIES_PHOTOMETER_WAKEUP = "photometerWakeup";
88 const char* DEVICE_CAPABILITIES_PROXIMITY = "proximity";
89 const char* DEVICE_CAPABILITIES_PROXIMITY_WAKEUP = "proximityWakeup";
90 const char* DEVICE_CAPABILITIES_TILTMETER = "tiltmeter";
91 const char* DEVICE_CAPABILITIES_TILTMETER_WAKEUP = "tiltmeterWakeup";
92 const char* DEVICE_CAPABILITIES_DATA_ENCRYPTION = "dataEncryption";
93 const char* DEVICE_CAPABILITIES_GRAPHICS_ACCELERATION = "graphicsAcceleration";
94 const char* DEVICE_CAPABILITIES_PUSH = "push";
95 const char* DEVICE_CAPABILITIES_TELEPHONY = "telephony";
96 const char* DEVICE_CAPABILITIES_TELEPHONY_MMS = "telephonyMms";
97 const char* DEVICE_CAPABILITIES_TELEPHONY_SMS = "telephonySms";
98 const char* DEVICE_CAPABILITIES_SCREENSIZE_NORMAL = "screenSizeNormal";
99 const char* DEVICE_CAPABILITIES_SCREENSIZE_480_800 = "screenSize480_800";
100 const char* DEVICE_CAPABILITIES_SCREENSIZE_720_1280 = "screenSize720_1280";
101 const char* DEVICE_CAPABILITIES_AUTO_ROTATION = "autoRotation";
102 const char* DEVICE_CAPABILITIES_SHELL_APP_WIDGET = "shellAppWidget";
103 const char* DEVICE_CAPABILITIES_VISION_IMAGE_RECOGNITION = "visionImageRecognition";
104 const char* DEVICE_CAPABILITIES_VISION_QRCODE_GENERATION = "visionQrcodeGeneration";
105 const char* DEVICE_CAPABILITIES_VISION_QRCODE_RECOGNITION = "visionQrcodeRecognition";
106 const char* DEVICE_CAPABILITIES_VISION_FACE_RECOGNITION = "visionFaceRecognition";
107 const char* DEVICE_CAPABILITIES_SECURE_ELEMENT = "secureElement";
108 const char* DEVICE_CAPABILITIES_NATIVE_OSP_COMPATIBLE = "nativeOspCompatible";
109 const char* DEVICE_CAPABILITIES_PROFILE = "profile";
110
111
112 JSClassRef JSDeviceCapabilitiesInfo::m_classRef = NULL;
113
114 JSClassDefinition JSDeviceCapabilitiesInfo::m_classInfo = {
115     0,
116     kJSClassAttributeNone,
117     "devicecapabilitiesinfo",
118     0,
119     m_properties,
120     NULL,
121     Initialize,
122     Finalize,
123     hasProperty,
124     getProperty,
125     NULL,
126     NULL,
127     NULL,
128     NULL,
129     NULL,
130     NULL,
131     NULL
132 };
133
134 JSStaticValue JSDeviceCapabilitiesInfo::m_properties[] = {
135     { DEVICE_CAPABILITIES_BLUETOOTH, getProperty, NULL, kJSPropertyAttributeReadOnly },
136     { DEVICE_CAPABILITIES_NFC, getProperty, NULL, kJSPropertyAttributeReadOnly },
137     { DEVICE_CAPABILITIES_NFC_RESERVED_PUSH, getProperty, NULL, kJSPropertyAttributeReadOnly },
138     { DEVICE_CAPABILITIES_MULTITOUCHCOUNT, getProperty, NULL, kJSPropertyAttributeReadOnly },
139     { DEVICE_CAPABILITIES_INPUTKEYBOARD, getProperty, NULL, kJSPropertyAttributeReadOnly },
140     { DEVICE_CAPABILITIES_INPUTKEYBOARD_LAYOUT, getProperty, NULL, kJSPropertyAttributeReadOnly },
141     { DEVICE_CAPABILITIES_WIFI, getProperty, NULL, kJSPropertyAttributeReadOnly },
142     { DEVICE_CAPABILITIES_WIFIDIRECT, getProperty, NULL, kJSPropertyAttributeReadOnly },
143     { DEVICE_CAPABILITIES_OPENGLES, getProperty, NULL, kJSPropertyAttributeReadOnly },
144     { DEVICE_CAPABILITIES_OPENGLES_TEXTURE_FORMAT, getProperty, NULL, kJSPropertyAttributeReadOnly },
145     { DEVICE_CAPABILITIES_OPENGLESVERSION1_1, getProperty, NULL, kJSPropertyAttributeReadOnly },
146     { DEVICE_CAPABILITIES_OPENGLESVERSION2_0, getProperty, NULL, kJSPropertyAttributeReadOnly },
147     { DEVICE_CAPABILITIES_FMRADIO, getProperty, NULL, kJSPropertyAttributeReadOnly },
148     { DEVICE_CAPABILITIES_PLATFORMVERSION, getProperty, NULL, kJSPropertyAttributeReadOnly },
149     { DEVICE_CAPABILITIES_PLATFORMNAME, getProperty, NULL, kJSPropertyAttributeReadOnly },
150     { DEVICE_CAPABILITIES_WEBAPIVERSION, getProperty, NULL, kJSPropertyAttributeReadOnly },
151     { DEVICE_CAPABILITIES_NATIVEAPIVERSION, getProperty, NULL, kJSPropertyAttributeReadOnly },
152     { DEVICE_CAPABILITIES_CAMERA, getProperty, NULL, kJSPropertyAttributeReadOnly },
153     { DEVICE_CAPABILITIES_CAMERAFRONT, getProperty, NULL, kJSPropertyAttributeReadOnly },
154     { DEVICE_CAPABILITIES_CAMERAFRONTFLASH, getProperty, NULL, kJSPropertyAttributeReadOnly },
155     { DEVICE_CAPABILITIES_CAMERABACK, getProperty, NULL, kJSPropertyAttributeReadOnly },
156     { DEVICE_CAPABILITIES_CAMERABACKFLASH, getProperty, NULL, kJSPropertyAttributeReadOnly },
157     { DEVICE_CAPABILITIES_LOCATION, getProperty, NULL, kJSPropertyAttributeReadOnly },
158     { DEVICE_CAPABILITIES_LOCATIONGPS, getProperty, NULL, kJSPropertyAttributeReadOnly },
159     { DEVICE_CAPABILITIES_LOCATIONWPS, getProperty, NULL, kJSPropertyAttributeReadOnly },
160     { DEVICE_CAPABILITIES_MICROPHONE, getProperty, NULL, kJSPropertyAttributeReadOnly },
161     { DEVICE_CAPABILITIES_USBHOST, getProperty, NULL, kJSPropertyAttributeReadOnly },
162     { DEVICE_CAPABILITIES_USBACCESSORY, getProperty, NULL, kJSPropertyAttributeReadOnly },
163     { DEVICE_CAPABILITIES_SCREENOUTPUTRCA, getProperty, NULL, kJSPropertyAttributeReadOnly },
164     { DEVICE_CAPABILITIES_SCREENOUTPUTHDMI, getProperty, NULL, kJSPropertyAttributeReadOnly },
165     { DEVICE_CAPABILITIES_PLATFORMCORECPUARCH, getProperty, NULL, kJSPropertyAttributeReadOnly },
166     { DEVICE_CAPABILITIES_PLATFORMCOREFPUARCH, getProperty, NULL, kJSPropertyAttributeReadOnly },
167     { DEVICE_CAPABILITIES_SIPVOIP, getProperty, NULL, kJSPropertyAttributeReadOnly },
168     { DEVICE_CAPABILITIES_DUID, getProperty, NULL, kJSPropertyAttributeReadOnly },
169     { DEVICE_CAPABILITIES_SPEECH_ROCOGNITION, getProperty, NULL, kJSPropertyAttributeReadOnly },
170     { DEVICE_CAPABILITIES_SPEECH_SYNTHESIS, getProperty, NULL, kJSPropertyAttributeReadOnly },
171     { DEVICE_CAPABILITIES_ACCELEROMETER, getProperty, NULL, kJSPropertyAttributeReadOnly },
172     { DEVICE_CAPABILITIES_ACCELEROMETER_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
173     { DEVICE_CAPABILITIES_BAROMETER, getProperty, NULL, kJSPropertyAttributeReadOnly },
174     { DEVICE_CAPABILITIES_BAROMETER_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
175     { DEVICE_CAPABILITIES_GYROSCOPE, getProperty, NULL, kJSPropertyAttributeReadOnly },
176     { DEVICE_CAPABILITIES_GYROSCOPE_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
177     { DEVICE_CAPABILITIES_MAGNETOMETER, getProperty, NULL, kJSPropertyAttributeReadOnly },
178     { DEVICE_CAPABILITIES_MAGNETOMETER_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
179     { DEVICE_CAPABILITIES_PHOTOMETER, getProperty, NULL, kJSPropertyAttributeReadOnly },
180     { DEVICE_CAPABILITIES_PHOTOMETER_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
181     { DEVICE_CAPABILITIES_PROXIMITY, getProperty, NULL, kJSPropertyAttributeReadOnly },
182     { DEVICE_CAPABILITIES_PROXIMITY_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
183     { DEVICE_CAPABILITIES_TILTMETER, getProperty, NULL, kJSPropertyAttributeReadOnly },
184     { DEVICE_CAPABILITIES_TILTMETER_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
185     { DEVICE_CAPABILITIES_DATA_ENCRYPTION, getProperty, NULL, kJSPropertyAttributeReadOnly },
186     { DEVICE_CAPABILITIES_GRAPHICS_ACCELERATION, getProperty, NULL, kJSPropertyAttributeReadOnly },
187     { DEVICE_CAPABILITIES_PUSH, getProperty, NULL, kJSPropertyAttributeReadOnly },
188     { DEVICE_CAPABILITIES_TELEPHONY, getProperty, NULL, kJSPropertyAttributeReadOnly },
189     { DEVICE_CAPABILITIES_TELEPHONY_MMS, getProperty, NULL, kJSPropertyAttributeReadOnly },
190     { DEVICE_CAPABILITIES_TELEPHONY_SMS, getProperty, NULL, kJSPropertyAttributeReadOnly },
191     { DEVICE_CAPABILITIES_SCREENSIZE_NORMAL, getProperty, NULL, kJSPropertyAttributeReadOnly },
192     { DEVICE_CAPABILITIES_SCREENSIZE_480_800, getProperty, NULL, kJSPropertyAttributeReadOnly },
193     { DEVICE_CAPABILITIES_SCREENSIZE_720_1280, getProperty, NULL, kJSPropertyAttributeReadOnly },
194     { DEVICE_CAPABILITIES_AUTO_ROTATION, getProperty, NULL, kJSPropertyAttributeReadOnly },
195     { DEVICE_CAPABILITIES_SHELL_APP_WIDGET, getProperty, NULL, kJSPropertyAttributeReadOnly },
196     { DEVICE_CAPABILITIES_VISION_IMAGE_RECOGNITION, getProperty, NULL, kJSPropertyAttributeReadOnly },
197     { DEVICE_CAPABILITIES_VISION_QRCODE_GENERATION, getProperty, NULL, kJSPropertyAttributeReadOnly },
198     { DEVICE_CAPABILITIES_VISION_QRCODE_RECOGNITION, getProperty, NULL, kJSPropertyAttributeReadOnly },
199     { DEVICE_CAPABILITIES_VISION_FACE_RECOGNITION, getProperty, NULL, kJSPropertyAttributeReadOnly },
200     { DEVICE_CAPABILITIES_SECURE_ELEMENT, getProperty, NULL, kJSPropertyAttributeReadOnly },
201     { DEVICE_CAPABILITIES_NATIVE_OSP_COMPATIBLE, getProperty, NULL, kJSPropertyAttributeReadOnly },
202     { DEVICE_CAPABILITIES_PROFILE, getProperty, NULL, kJSPropertyAttributeReadOnly },
203     { 0, 0, 0, 0 }
204 };
205
206 const JSClassRef JSDeviceCapabilitiesInfo::getClassRef()
207 {
208     if (!m_classRef) {
209         m_classRef = JSClassCreate(&m_classInfo);
210     }
211     return m_classRef;
212 }
213
214 const JSClassDefinition* JSDeviceCapabilitiesInfo::getClassInfo()
215 {
216     return &m_classInfo;
217 }
218
219 void JSDeviceCapabilitiesInfo::Initialize(JSContextRef context, JSObjectRef object)
220 {
221 }
222
223 void JSDeviceCapabilitiesInfo::Finalize(JSObjectRef object)
224 {
225     LoggerD("Entered");
226     JSDeviceCapabilitiesPriv* priv = static_cast<JSDeviceCapabilitiesPriv*>(JSObjectGetPrivate(object));
227     JSObjectSetPrivate(object, NULL);
228     LoggerD("Deleting DeviceCapabilitiesInfo object");
229     delete priv;
230 }
231
232 bool JSDeviceCapabilitiesInfo::hasProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName)
233 {
234     return JSUtils::hasProperty(m_properties, propertyName);
235 }
236
237 JSObjectRef JSDeviceCapabilitiesInfo::createJSObject(JSContextRef context, const DeviceCapabilitiesPropertiesPtr deviceCapabilitiesInfo)
238 {
239     LoggerD("Enter");
240     JSDeviceCapabilitiesPriv *priv = new JSDeviceCapabilitiesPriv(context, deviceCapabilitiesInfo);
241     return JSObjectMake(context, getClassRef(), priv);
242 }
243
244 JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
245 {
246     LoggerD("Enter");
247     JSDeviceCapabilitiesPriv *priv = static_cast<JSDeviceCapabilitiesPriv*>(JSObjectGetPrivate(object));
248     if (NULL == priv) {
249         LoggerE("Private object not set.");
250         return JSValueMakeUndefined(context);
251     }
252
253     Try
254     {
255         DeviceCapabilitiesPropertiesPtr deviceCapabilitiesInfo = priv->getObject();
256         Converter convert(context);
257
258         if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_BLUETOOTH)) {
259             bool bluetooth = false;
260             if(system_info_get_platform_bool("tizen.org/feature/network.bluetooth", &bluetooth) == SYSTEM_INFO_ERROR_NONE) {
261                 deviceCapabilitiesInfo->bluetooth = bluetooth;
262             } else {
263                 LoggerE("get fail bluetooth value");
264                 return JSValueMakeUndefined(context);
265             }
266             return convert.toJSValueRef(deviceCapabilitiesInfo->bluetooth);
267         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_NFC)) {
268             bool nfc = false;
269             if(system_info_get_platform_bool("tizen.org/feature/network.nfc", &nfc) == SYSTEM_INFO_ERROR_NONE) {
270                 deviceCapabilitiesInfo->nfc = nfc;
271             } else {
272                 LoggerE("get fail nfc value");
273                 return JSValueMakeUndefined(context);
274             }
275             return convert.toJSValueRef(deviceCapabilitiesInfo->nfc);
276         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_NFC_RESERVED_PUSH)) {
277             bool nfcReservedPush = false;
278             if(system_info_get_platform_bool("tizen.org/feature/network.nfc.reserved_push", &nfcReservedPush) == SYSTEM_INFO_ERROR_NONE) {
279                 deviceCapabilitiesInfo->nfcReservedPush = nfcReservedPush;
280             } else {
281                 LoggerE("get fail nfc reserved push value");
282                 return JSValueMakeUndefined(context);
283             }
284             return convert.toJSValueRef(deviceCapabilitiesInfo->nfcReservedPush);
285         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MULTITOUCHCOUNT)) {
286             int multiTouchCount = 0;
287             if(system_info_get_platform_int("tizen.org/feature/multi_point_touch.point_count", &multiTouchCount) == SYSTEM_INFO_ERROR_NONE) {
288                 deviceCapabilitiesInfo->multiTouchCount = multiTouchCount;
289             } else {
290                 LoggerE("get fail multiTouchCount value");
291                 return JSValueMakeUndefined(context);
292             }
293             return convert.toJSValueRef(deviceCapabilitiesInfo->multiTouchCount);
294         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_INPUTKEYBOARD)) {
295             bool inputKeyboard = false;
296             if(system_info_get_platform_bool("tizen.org/feature/input.keyboard", &inputKeyboard) == SYSTEM_INFO_ERROR_NONE) {
297                 deviceCapabilitiesInfo->inputKeyboard = inputKeyboard;
298             } else {
299                 LoggerE("get fail inputKeyboard value");
300                 return JSValueMakeUndefined(context);
301             }
302             return convert.toJSValueRef(deviceCapabilitiesInfo->inputKeyboard);
303         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_INPUTKEYBOARD_LAYOUT)) {
304             char* inputKeyboardLayout = NULL;
305             if(system_info_get_platform_string("tizen.org/feature/input.keyboard.layout", &inputKeyboardLayout) == SYSTEM_INFO_ERROR_NONE) {
306                 if (inputKeyboardLayout) {
307                     deviceCapabilitiesInfo->inputKeyboardLayout = true;
308                     free(inputKeyboardLayout);
309                 } else {
310                     deviceCapabilitiesInfo->inputKeyboardLayout = false;
311                 }
312             } else {
313                 LoggerE("get fail inputKeyboardLayout value");
314                 return JSValueMakeUndefined(context);
315             }
316             return convert.toJSValueRef(deviceCapabilitiesInfo->inputKeyboardLayout);
317         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_WIFI)) {
318             bool wifi = false;
319             if(system_info_get_platform_bool("tizen.org/feature/network.wifi", &wifi) == SYSTEM_INFO_ERROR_NONE) {
320                 deviceCapabilitiesInfo->wifi = wifi;
321             } else {
322                 LoggerE("get fail wifi value");
323                 return JSValueMakeUndefined(context);
324             }
325             return convert.toJSValueRef(deviceCapabilitiesInfo->wifi);
326         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_WIFIDIRECT)) {
327             bool wifiDirect = false;
328             if(system_info_get_platform_bool("tizen.org/feature/network.wifi.direct", &wifiDirect) == SYSTEM_INFO_ERROR_NONE) {
329                 deviceCapabilitiesInfo->wifiDirect = wifiDirect;
330             } else {
331                 LoggerE("get fail wifiDirect value");
332                 return JSValueMakeUndefined(context);
333             }
334             return convert.toJSValueRef(deviceCapabilitiesInfo->wifiDirect);
335         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_OPENGLES)) {
336             bool opengles = NULL;
337             if(system_info_get_platform_bool("tizen.org/feature/opengles", &opengles) == SYSTEM_INFO_ERROR_NONE) {
338                 deviceCapabilitiesInfo->opengles = opengles;
339             } else {
340                 LoggerE("get fail opengles value");
341                 return JSValueMakeUndefined(context);
342             }
343             return convert.toJSValueRef(deviceCapabilitiesInfo->opengles);
344         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_OPENGLES_TEXTURE_FORMAT)) {
345             bool texture = false;
346             bool data = false;
347             char* textureFormat = NULL;
348                 char textureFormatFull[MAXBUFSIZE];
349             textureFormatFull[0] = '\0';
350
351             if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.utc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
352                 strcat(textureFormatFull, "utc");
353                 data = true;
354             }
355             if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.ptc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
356                 if (data) {
357                     strcat(textureFormatFull, " | ");
358                 }
359                 strcat(textureFormatFull, "ptc");
360                 data = true;
361             }
362             if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.etc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
363                 if (data) {
364                     strcat(textureFormatFull, " | ");
365                 }
366                 strcat(textureFormatFull, "etc");
367                 data = true;                
368             }
369             if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.3dc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
370                 if (data) {
371                     strcat(textureFormatFull, " | ");
372                 }
373                 strcat(textureFormatFull, "3dc");
374             }
375             if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.atc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
376                 if (data) {
377                     strcat(textureFormatFull, " | ");
378                 }
379                 strcat(textureFormatFull, "atc");
380                 data = true;                
381             }
382             if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.pvrtc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
383                 if (data) {
384                     strcat(textureFormatFull, " | ");
385                 }
386                 strcat(textureFormatFull, "pvrtc");
387             }
388
389             textureFormat = strdup(textureFormatFull);
390
391             if (textureFormat == NULL) {
392                 LoggerE("get fail openglestextureFormat value");
393                 return JSValueMakeUndefined(context);
394             }
395
396             deviceCapabilitiesInfo->openglestextureFormat = textureFormat;
397             free(textureFormat);
398  
399             return convert.toJSValueRef(deviceCapabilitiesInfo->openglestextureFormat);
400         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_OPENGLESVERSION1_1)) {
401             bool openglesVersion1_1 = false;
402             if(system_info_get_platform_bool("tizen.org/feature/opengles.version.1_1", &openglesVersion1_1) == SYSTEM_INFO_ERROR_NONE) {
403                 deviceCapabilitiesInfo->openglesVersion1_1 = openglesVersion1_1;
404             } else {
405                 LoggerE("get fail openglesVersion1_1 value");
406                 return JSValueMakeUndefined(context);
407             }
408             return convert.toJSValueRef(deviceCapabilitiesInfo->openglesVersion1_1);
409         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_OPENGLESVERSION2_0)) {
410             bool openglesVersion2_0 = false;
411             if(system_info_get_platform_bool("tizen.org/feature/opengles.version.2_0", &openglesVersion2_0) == SYSTEM_INFO_ERROR_NONE) {
412                 deviceCapabilitiesInfo->openglesVersion2_0 = openglesVersion2_0;
413             } else {
414                 LoggerE("get fail openglesVersion2_0 value");
415                 return JSValueMakeUndefined(context);
416             }      
417             return convert.toJSValueRef(deviceCapabilitiesInfo->openglesVersion2_0);
418         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_FMRADIO)) {
419             bool fmRadio = false;
420             if(system_info_get_platform_bool("tizen.org/feature/fmradio", &fmRadio) == SYSTEM_INFO_ERROR_NONE) {
421                 deviceCapabilitiesInfo->fmRadio = fmRadio;
422             } else {
423                 LoggerE("get fail fmRadio value");
424                 return JSValueMakeUndefined(context);
425             }
426             return convert.toJSValueRef(deviceCapabilitiesInfo->fmRadio);
427         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PLATFORMVERSION)) {
428             AceSecurityStatus status = SYSTEMINFO_CHECK_ACCESS(SYSTEMINFO_FUNCTION_API_GET_CAPABILITIES);
429             TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
430             char* platformVersion = NULL;
431             if(system_info_get_platform_string("tizen.org/feature/platform.version", &platformVersion) == SYSTEM_INFO_ERROR_NONE) {
432                 deviceCapabilitiesInfo->platformVersion = platformVersion;
433                 free(platformVersion);
434             } else {
435                 LoggerE("get fail platformVersion value");
436                 return JSValueMakeUndefined(context);
437             }          
438             return convert.toJSValueRef(deviceCapabilitiesInfo->platformVersion);
439         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PLATFORMNAME)) {
440             char* platformName = NULL;
441             if(system_info_get_platform_string("tizen.org/system/platform.name", &platformName) == SYSTEM_INFO_ERROR_NONE) {
442                 deviceCapabilitiesInfo->platformName = platformName;
443                 free(platformName);
444             } else {
445                 LoggerE("get fail platformName value");
446                 return JSValueMakeUndefined(context);
447             }         
448             return convert.toJSValueRef(deviceCapabilitiesInfo->platformName);
449         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_WEBAPIVERSION)) {
450             AceSecurityStatus status = SYSTEMINFO_CHECK_ACCESS(SYSTEMINFO_FUNCTION_API_GET_CAPABILITIES);
451             TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
452             char* webApiVersion = NULL;
453             if(system_info_get_platform_string("tizen.org/feature/platform.web.api.version", &webApiVersion) == SYSTEM_INFO_ERROR_NONE) {
454                 deviceCapabilitiesInfo->webApiVersion = webApiVersion;
455                 free(webApiVersion);
456             } else {
457                 LoggerE("get fail webApiVersion value");
458                 return JSValueMakeUndefined(context);
459             }
460             return convert.toJSValueRef(deviceCapabilitiesInfo->webApiVersion);
461         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_NATIVEAPIVERSION)) {
462             AceSecurityStatus status = SYSTEMINFO_CHECK_ACCESS(SYSTEMINFO_FUNCTION_API_GET_CAPABILITIES);
463             TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
464             char* nativeApiVersion = NULL;
465             if(system_info_get_platform_string("tizen.org/feature/platform.native.api.version", &nativeApiVersion) == SYSTEM_INFO_ERROR_NONE) {
466                 deviceCapabilitiesInfo->nativeApiVersion = nativeApiVersion;
467                 free(nativeApiVersion);
468             } else {
469                 LoggerE("get fail nativeApiVersion value");
470                 return JSValueMakeUndefined(context);
471             }
472             return convert.toJSValueRef(deviceCapabilitiesInfo->nativeApiVersion);
473         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERAFRONT)) {
474             bool cameraFront = false;
475             if(system_info_get_platform_bool("tizen.org/feature/camera.front", &cameraFront) == SYSTEM_INFO_ERROR_NONE) {
476                 deviceCapabilitiesInfo->cameraFront = cameraFront;
477             } else {
478                 LoggerE("get fail cameraFront value");
479                 return JSValueMakeUndefined(context);
480             }
481             return convert.toJSValueRef(deviceCapabilitiesInfo->cameraFront);
482         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERA)) {
483             bool camera = false;
484             if(system_info_get_platform_bool("tizen.org/feature/camera", &camera) == SYSTEM_INFO_ERROR_NONE) {
485                 deviceCapabilitiesInfo->camera = camera;
486             } else {
487                 LoggerE("get fail camera value");
488                 return JSValueMakeUndefined(context);
489             }
490             return convert.toJSValueRef(deviceCapabilitiesInfo->camera);
491         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERAFRONTFLASH)) {
492             bool cameraFrontFlash = false;
493             if(system_info_get_platform_bool("tizen.org/feature/camera.front.flash", &cameraFrontFlash) == SYSTEM_INFO_ERROR_NONE) {
494                 deviceCapabilitiesInfo->cameraFrontFlash = cameraFrontFlash;
495             } else {
496                 LoggerE("get fail cameraFrontFlash value");
497                 return JSValueMakeUndefined(context);
498             }        
499             return convert.toJSValueRef(deviceCapabilitiesInfo->cameraFrontFlash);
500         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERABACK)) {
501             bool cameraBack = false;
502             if(system_info_get_platform_bool("tizen.org/feature/camera.back", &cameraBack) == SYSTEM_INFO_ERROR_NONE) {
503                 deviceCapabilitiesInfo->cameraBack = cameraBack;
504             } else {
505                 LoggerE("get fail cameraBack value");
506                 return JSValueMakeUndefined(context);
507             }
508             return convert.toJSValueRef(deviceCapabilitiesInfo->cameraBack);
509         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERABACKFLASH)) {
510             bool cameraBackFlash = false;
511             if(system_info_get_platform_bool("tizen.org/feature/camera.back.flash", &cameraBackFlash) == SYSTEM_INFO_ERROR_NONE) {
512                 deviceCapabilitiesInfo->cameraBackFlash = cameraBackFlash;
513             } else {
514                 LoggerE("get fail cameraBackFlash value");
515                 return JSValueMakeUndefined(context);
516             }
517             return convert.toJSValueRef(deviceCapabilitiesInfo->cameraBackFlash);
518         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATION)) {
519             bool location = false;
520             if(system_info_get_platform_bool("tizen.org/feature/location", &location) == SYSTEM_INFO_ERROR_NONE) {
521                 deviceCapabilitiesInfo->location = location;
522             } else {
523                 LoggerE("get fail location value");
524                 return JSValueMakeUndefined(context);
525             }
526             return convert.toJSValueRef(deviceCapabilitiesInfo->location);
527         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATIONGPS)) {
528             bool locationGps = false;
529             if(system_info_get_platform_bool("tizen.org/feature/location.gps", &locationGps) == SYSTEM_INFO_ERROR_NONE) {
530                 deviceCapabilitiesInfo->locationGps = locationGps;
531             } else {
532                 LoggerE("get fail locationGps value");
533                 return JSValueMakeUndefined(context);
534             }
535             return convert.toJSValueRef(deviceCapabilitiesInfo->locationGps);
536         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATIONWPS)) {
537             bool locationWps = false;
538             if(system_info_get_platform_bool("tizen.org/feature/location.wps", &locationWps) == SYSTEM_INFO_ERROR_NONE) {
539                 deviceCapabilitiesInfo->locationWps = locationWps;
540             } else {
541                 LoggerE("get fail locationWps value");
542                 return JSValueMakeUndefined(context);
543             }
544             return convert.toJSValueRef(deviceCapabilitiesInfo->locationWps);
545         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MICROPHONE)) {
546             bool microphone = false;
547             if(system_info_get_platform_bool("tizen.org/feature/microphone", &microphone) == SYSTEM_INFO_ERROR_NONE) {
548                 deviceCapabilitiesInfo->microphone = microphone;
549             } else {
550                 LoggerE("get fail microphone value");
551                 return JSValueMakeUndefined(context);
552             }
553             return convert.toJSValueRef(deviceCapabilitiesInfo->microphone);
554         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_USBHOST)) {
555             bool usbHost = false;
556             if(system_info_get_platform_bool("tizen.org/feature/usb.host", &usbHost) == SYSTEM_INFO_ERROR_NONE) {
557                 deviceCapabilitiesInfo->usbHost = usbHost;
558             } else {
559                 LoggerE("get fail usbHost value");
560                 return JSValueMakeUndefined(context);
561             }
562             return convert.toJSValueRef(deviceCapabilitiesInfo->usbHost);
563         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_USBACCESSORY)) {
564             bool usbAccessory = false;
565             if(system_info_get_platform_bool("tizen.org/feature/usb.accessory", &usbAccessory) == SYSTEM_INFO_ERROR_NONE) {
566                 deviceCapabilitiesInfo->usbAccessory = usbAccessory;
567             } else {
568                 LoggerE("get fail usbAccessory value");
569                 return JSValueMakeUndefined(context);
570             }
571             return convert.toJSValueRef(deviceCapabilitiesInfo->usbAccessory);
572         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENOUTPUTRCA)) {
573             bool screenOutputRca = false;
574             if(system_info_get_platform_bool("tizen.org/feature/screen.output.rca", &screenOutputRca) == SYSTEM_INFO_ERROR_NONE) {
575                 deviceCapabilitiesInfo->screenOutputRca = screenOutputRca;
576             } else {
577                 LoggerE("get fail screenOutputRca value");
578                 return JSValueMakeUndefined(context);
579             }
580             return convert.toJSValueRef(deviceCapabilitiesInfo->screenOutputRca);
581         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENOUTPUTHDMI)) {
582             bool screenOutputHdmi = false;
583             if(system_info_get_platform_bool("tizen.org/feature/screen.output.hdmi", &screenOutputHdmi) == SYSTEM_INFO_ERROR_NONE) {
584                 deviceCapabilitiesInfo->screenOutputHdmi = screenOutputHdmi;
585             } else {
586                 LoggerE("get fail screenOutputHdmi value");
587                 return JSValueMakeUndefined(context);
588             }
589             return convert.toJSValueRef(deviceCapabilitiesInfo->screenOutputHdmi);
590         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PLATFORMCORECPUARCH)) {
591             bool cpuArch = false;
592             bool data = false;
593             char* platformCoreCpuArch = NULL;
594                 char platformCoreCpuArchFull[MAXBUFSIZE];
595             platformCoreCpuArchFull[0] = '\0';
596
597             if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.armv6", &cpuArch) == SYSTEM_INFO_ERROR_NONE && cpuArch == true) {
598                 strcat(platformCoreCpuArchFull, "armv6");
599                 data = true;
600             }
601             if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.armv7", &cpuArch) == SYSTEM_INFO_ERROR_NONE && cpuArch == true) {
602                 if (data) {
603                     strcat(platformCoreCpuArchFull, " | ");
604                 }
605                 strcat(platformCoreCpuArchFull, "armv7");
606                 data = true;            
607             }            
608             if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.x86", &cpuArch) == SYSTEM_INFO_ERROR_NONE && cpuArch == true) {
609                 if (data) {
610                     strcat(platformCoreCpuArchFull, " | ");
611                 }
612                 strcat(platformCoreCpuArchFull, "x86");
613             }
614
615             platformCoreCpuArch = strdup(platformCoreCpuArchFull);
616
617             if (platformCoreCpuArch == NULL) {
618                 LoggerE("get fail platformCoreCpuArch value");
619                 return JSValueMakeUndefined(context);
620             }
621
622             deviceCapabilitiesInfo->platformCoreCpuArch = platformCoreCpuArch;
623             free(platformCoreCpuArch);
624
625             return convert.toJSValueRef(deviceCapabilitiesInfo->platformCoreCpuArch);
626         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PLATFORMCOREFPUARCH)) {
627             bool fpuArch = false;
628             bool data = true;
629             char* platformCoreFpuArch = NULL;
630                 char platformCoreFpuArchFull[MAXBUFSIZE];
631             platformCoreFpuArchFull[0] = '\0';
632
633             if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.sse2", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
634                 data = true;
635                 strcat(platformCoreFpuArchFull, "sse2");
636             }
637             if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.sse3", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
638                 if(data) {
639                     strcat(platformCoreFpuArchFull, " | ");
640                 }
641                 strcat(platformCoreFpuArchFull, "sse3");
642                 data = true;
643             }
644             if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.ssse3", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
645                 if(data) {
646                     strcat(platformCoreFpuArchFull, " | ");
647                 }
648                 strcat(platformCoreFpuArchFull, "ssse3");
649                 data = true;
650             }
651             if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.vfpv2", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
652                 if(data) {
653                     strcat(platformCoreFpuArchFull, " | ");
654                 }
655                 strcat(platformCoreFpuArchFull, "vfpv2");
656                 data = true;
657             }
658             if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.vfpv3", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
659                 if(data) {
660                     strcat(platformCoreFpuArchFull, " | ");
661                 }                
662                 strcat(platformCoreFpuArchFull, "vfpv3");
663             }
664             platformCoreFpuArch = strdup(platformCoreFpuArchFull);
665
666             if (platformCoreFpuArch == NULL) {
667                 LoggerE("get fail platformCoreFpuArch value");
668                 return JSValueMakeUndefined(context);
669             }
670
671             deviceCapabilitiesInfo->platformCoreCpuArch = platformCoreFpuArch;
672             free(platformCoreFpuArch);        
673
674             return convert.toJSValueRef(deviceCapabilitiesInfo->platformCoreFpuArch);
675         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SIPVOIP)) {
676             bool sipVoip = false;
677             if(system_info_get_platform_bool("tizen.org/feature/sip.voip", &sipVoip) == SYSTEM_INFO_ERROR_NONE) {
678                 deviceCapabilitiesInfo->sipVoip = sipVoip;
679             } else {
680                 LoggerE("get fail sipVoip value");
681                 return JSValueMakeUndefined(context);
682             }
683             return convert.toJSValueRef(deviceCapabilitiesInfo->sipVoip);
684         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_DUID)) {
685             return convert.toJSValueRef(deviceCapabilitiesInfo->duid);
686         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SPEECH_ROCOGNITION)) {
687             bool speechRecognition = false;
688             if(system_info_get_platform_bool("tizen.org/feature/speech.recognition", &speechRecognition) == SYSTEM_INFO_ERROR_NONE) {
689                 deviceCapabilitiesInfo->speechRecognition = speechRecognition;
690             } else {
691                 LoggerE("get fail speechRecognition value");
692                 return JSValueMakeUndefined(context);
693             }
694             return convert.toJSValueRef(deviceCapabilitiesInfo->speechRecognition);
695         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SPEECH_SYNTHESIS)) {
696             bool speechSynthesis = false;        
697             if(system_info_get_platform_bool("tizen.org/feature/speech.synthesis", &speechSynthesis) == SYSTEM_INFO_ERROR_NONE) {
698                 deviceCapabilitiesInfo->speechSynthesis = speechSynthesis;
699             } else {
700                 LoggerE("get fail speechSynthesis value");
701                 return JSValueMakeUndefined(context);
702             }
703             return convert.toJSValueRef(deviceCapabilitiesInfo->speechSynthesis);
704         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_ACCELEROMETER)) {
705             bool accelerometer = false;
706             if(system_info_get_platform_bool("tizen.org/feature/sensor.accelerometer", &accelerometer) == SYSTEM_INFO_ERROR_NONE) {
707                 deviceCapabilitiesInfo->accelerometer = accelerometer;
708             } else {
709                 LoggerE("get fail accelerometer value");
710                 return JSValueMakeUndefined(context);
711             }
712             return convert.toJSValueRef(deviceCapabilitiesInfo->accelerometer);
713         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_ACCELEROMETER_WAKEUP)) {
714             bool accelerometerWakeup = false;
715             if(system_info_get_platform_bool("tizen.org/feature/sensor.accelerometer.wakeup", &accelerometerWakeup) == SYSTEM_INFO_ERROR_NONE) {
716                 deviceCapabilitiesInfo->accelerometerWakeup = accelerometerWakeup;
717             } else {
718                 LoggerE("get fail accelerometerWakeup value");
719                 return JSValueMakeUndefined(context);
720             }
721             return convert.toJSValueRef(deviceCapabilitiesInfo->accelerometerWakeup);
722         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_BAROMETER)) {
723             bool barometer = false;
724             if(system_info_get_platform_bool("tizen.org/feature/sensor.barometer", &barometer) == SYSTEM_INFO_ERROR_NONE) {
725                 deviceCapabilitiesInfo->barometer = barometer;
726             } else {
727                 LoggerE("get fail barometer value");
728                 return JSValueMakeUndefined(context);
729             }
730             return convert.toJSValueRef(deviceCapabilitiesInfo->barometer);
731         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_BAROMETER_WAKEUP)) {
732             bool barometerWakeup = false;
733             if(system_info_get_platform_bool("tizen.org/feature/sensor.barometer.wakeup", &barometerWakeup) == SYSTEM_INFO_ERROR_NONE) {
734                 deviceCapabilitiesInfo->barometerWakeup = barometerWakeup;
735             } else {
736                 LoggerE("get fail barometerWakeup value");
737                 return JSValueMakeUndefined(context);
738             }
739             return convert.toJSValueRef(deviceCapabilitiesInfo->barometerWakeup);
740         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_GYROSCOPE)) {
741             bool gyroscope = false;
742             if(system_info_get_platform_bool("tizen.org/feature/sensor.gyroscope", &gyroscope) == SYSTEM_INFO_ERROR_NONE) {
743                 deviceCapabilitiesInfo->gyroscope = gyroscope;
744             } else {
745                 LoggerE("get fail gyroscope value");
746                 return JSValueMakeUndefined(context);
747             }
748             return convert.toJSValueRef(deviceCapabilitiesInfo->gyroscope);
749         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_GYROSCOPE_WAKEUP)) {
750             bool gyroscopeWakeup = false;
751             if(system_info_get_platform_bool("tizen.org/feature/sensor.gyroscope.wakeup", &gyroscopeWakeup) == SYSTEM_INFO_ERROR_NONE) {
752                 deviceCapabilitiesInfo->gyroscopeWakeup = gyroscopeWakeup;
753             } else {
754                 LoggerE("get fail gyroscopeWakeup value");
755                 return JSValueMakeUndefined(context);
756             }
757             return convert.toJSValueRef(deviceCapabilitiesInfo->gyroscopeWakeup);
758         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MAGNETOMETER)) {
759             bool magnetometer = false;
760             if(system_info_get_platform_bool("tizen.org/feature/sensor.magnetometer", &magnetometer) == SYSTEM_INFO_ERROR_NONE) {
761                 deviceCapabilitiesInfo->magnetometer = magnetometer;
762             } else {
763                 LoggerE("get fail magnetometer value");
764                 return JSValueMakeUndefined(context);
765             }
766             return convert.toJSValueRef(deviceCapabilitiesInfo->magnetometer);
767         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MAGNETOMETER_WAKEUP)) {
768             bool magnetometerWakeup = false;
769             if(system_info_get_platform_bool("tizen.org/feature/sensor.magnetometer.wakeup", &magnetometerWakeup) == SYSTEM_INFO_ERROR_NONE) {
770                 deviceCapabilitiesInfo->magnetometerWakeup = magnetometerWakeup;
771             } else {
772                 LoggerE("get fail magnetometerWakeup value");
773                 return JSValueMakeUndefined(context);
774             }
775             return convert.toJSValueRef(deviceCapabilitiesInfo->magnetometerWakeup);
776         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PHOTOMETER)) {
777             bool photometer = false;
778             if(system_info_get_platform_bool("tizen.org/feature/sensor.photometer", &photometer) == SYSTEM_INFO_ERROR_NONE) {
779                 deviceCapabilitiesInfo->photometer = photometer;
780             } else {
781                 LoggerE("get fail photometer value");
782                 return JSValueMakeUndefined(context);
783             }
784             return convert.toJSValueRef(deviceCapabilitiesInfo->photometer);
785         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PHOTOMETER_WAKEUP)) {
786             bool photometerWakeup = false;
787             if(system_info_get_platform_bool("tizen.org/feature/sensor.photometer.wakeup", &photometerWakeup) == SYSTEM_INFO_ERROR_NONE) {
788                 deviceCapabilitiesInfo->photometerWakeup = photometerWakeup;
789             } else {
790                 LoggerE("get fail photometerWakeup value");
791                 return JSValueMakeUndefined(context);
792             }
793             return convert.toJSValueRef(deviceCapabilitiesInfo->photometerWakeup);
794         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PROXIMITY)) {
795             bool proximity = false;
796             if(system_info_get_platform_bool("tizen.org/feature/sensor.proximity", &proximity) == SYSTEM_INFO_ERROR_NONE) {
797                 deviceCapabilitiesInfo->proximity = proximity;
798             } else {
799                 LoggerE("get fail proximity value");
800                 return JSValueMakeUndefined(context);
801             }
802             return convert.toJSValueRef(deviceCapabilitiesInfo->proximity);
803         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PROXIMITY_WAKEUP)) {
804             bool proximityWakeup = false;
805             if(system_info_get_platform_bool("tizen.org/feature/sensor.proximity.wakeup", &proximityWakeup) == SYSTEM_INFO_ERROR_NONE) {
806                 deviceCapabilitiesInfo->proximityWakeup = proximityWakeup;
807             } else {
808                 LoggerE("get fail proximityWakeup value");
809                 return JSValueMakeUndefined(context);
810             }
811             return convert.toJSValueRef(deviceCapabilitiesInfo->proximityWakeup);
812         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TILTMETER)) {
813             bool tiltmeter = false;
814             if(system_info_get_platform_bool("tizen.org/feature/sensor.tiltmeter", &tiltmeter) == SYSTEM_INFO_ERROR_NONE) {
815                 deviceCapabilitiesInfo->tiltmeter = tiltmeter;
816             } else {
817                 LoggerE("get fail tiltmeter value");
818                 return JSValueMakeUndefined(context);
819             }
820             return convert.toJSValueRef(deviceCapabilitiesInfo->tiltmeter);
821         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TILTMETER_WAKEUP)) {
822             bool tiltmeterWakeup = false;
823             if(system_info_get_platform_bool("tizen.org/feature/sensor.tiltmeter.wakeup", &tiltmeterWakeup) == SYSTEM_INFO_ERROR_NONE) {
824                 deviceCapabilitiesInfo->tiltmeterWakeup = tiltmeterWakeup;
825             } else {
826                 LoggerE("get fail tiltmeterWakeup value");
827                 return JSValueMakeUndefined(context);
828             }
829             return convert.toJSValueRef(deviceCapabilitiesInfo->tiltmeterWakeup);
830         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_DATA_ENCRYPTION)) {
831             bool dataEncryption = false;
832             if(system_info_get_platform_bool("tizen.org/feature/database.encryption", &dataEncryption) == SYSTEM_INFO_ERROR_NONE) {
833                 deviceCapabilitiesInfo->dataEncryption = dataEncryption;
834             } else {
835                 LoggerE("get fail dataEncryption value");
836                 return JSValueMakeUndefined(context);
837             }
838             return convert.toJSValueRef(deviceCapabilitiesInfo->dataEncryption);
839         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_GRAPHICS_ACCELERATION)) {
840             bool graphicsAcceleration = false;
841             if(system_info_get_platform_bool("tizen.org/feature/graphics.acceleration", &graphicsAcceleration) == SYSTEM_INFO_ERROR_NONE) {
842                 deviceCapabilitiesInfo->graphicsAcceleration = graphicsAcceleration;
843             } else {
844                 LoggerE("get fail graphicsAcceleration value");
845                 return JSValueMakeUndefined(context);
846             }
847             return convert.toJSValueRef(deviceCapabilitiesInfo->graphicsAcceleration);
848         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PUSH)) {
849             bool push = false;
850             if(system_info_get_platform_bool("tizen.org/feature/network.push", &push) == SYSTEM_INFO_ERROR_NONE) {
851                 deviceCapabilitiesInfo->push = push;
852             } else {
853                 LoggerE("get fail push value");
854                 return JSValueMakeUndefined(context);
855             }
856             return convert.toJSValueRef(deviceCapabilitiesInfo->push);
857         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TELEPHONY)) {
858             bool telephony = false;
859             if(system_info_get_platform_bool("tizen.org/feature/network.telephony", &telephony) == SYSTEM_INFO_ERROR_NONE) {
860                 deviceCapabilitiesInfo->telephony = telephony;
861             } else {
862                 LoggerE("get fail telephony value");
863                 return JSValueMakeUndefined(context);
864             }
865             return convert.toJSValueRef(deviceCapabilitiesInfo->telephony);
866         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TELEPHONY_MMS)) {
867             bool telephonyMms = false;
868             if(system_info_get_platform_bool("tizen.org/feature/network.telephony.mms", &telephonyMms) == SYSTEM_INFO_ERROR_NONE) {
869                 deviceCapabilitiesInfo->telephonyMms = telephonyMms;
870             } else {
871                 LoggerE("get fail telephonyMms value");
872                 return JSValueMakeUndefined(context);
873             }
874             return convert.toJSValueRef(deviceCapabilitiesInfo->telephonyMms);
875         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TELEPHONY_SMS)) {
876             bool telephonySms = false;
877             if(system_info_get_platform_bool("tizen.org/feature/network.telephony.sms", &telephonySms) == SYSTEM_INFO_ERROR_NONE) {
878                 deviceCapabilitiesInfo->telephonySms = telephonySms;
879             } else {
880                 LoggerE("get fail telephonySms value");
881                 return JSValueMakeUndefined(context);
882             }
883             return convert.toJSValueRef(deviceCapabilitiesInfo->telephonySms);
884         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENSIZE_NORMAL)) {
885             bool screenSizeNormal = false;
886             if(system_info_get_platform_bool("tizen.org/feature/screen.size.normal", &screenSizeNormal) == SYSTEM_INFO_ERROR_NONE) {
887                 deviceCapabilitiesInfo->screenSizeNormal = screenSizeNormal;
888             } else {
889                 LoggerE("get fail screenSizeNormal value");
890                 return JSValueMakeUndefined(context);
891             }
892             return convert.toJSValueRef(deviceCapabilitiesInfo->screenSizeNormal);
893         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENSIZE_480_800)) {
894             bool screenSize480_800 = false;
895             if(system_info_get_platform_bool("tizen.org/feature/screen.size.normal.480.800", &screenSize480_800) == SYSTEM_INFO_ERROR_NONE) {
896                 deviceCapabilitiesInfo->screenSize480_800 = screenSize480_800;
897             } else {
898                 LoggerE("get fail screenSize480_800 value");
899                 return JSValueMakeUndefined(context);
900             }
901             return convert.toJSValueRef(deviceCapabilitiesInfo->screenSize480_800);
902         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENSIZE_720_1280)) {
903             bool screenSize720_1280 = false;
904             if(system_info_get_platform_bool("tizen.org/feature/screen.size.normal.720.1280", &screenSize720_1280) == SYSTEM_INFO_ERROR_NONE) {
905                 deviceCapabilitiesInfo->screenSize720_1280 = screenSize720_1280;
906             } else {
907                 LoggerE("get fail screenSize720_1280 value");
908                 return JSValueMakeUndefined(context);
909             }  
910             return convert.toJSValueRef(deviceCapabilitiesInfo->screenSize720_1280);
911         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_AUTO_ROTATION)) {
912             bool autoRotation = false;
913             if(system_info_get_platform_bool("tizen.org/feature/screen.auto_rotation", &autoRotation) == SYSTEM_INFO_ERROR_NONE) {
914                 deviceCapabilitiesInfo->autoRotation = autoRotation;
915             } else {
916                 LoggerE("get fail autoRotation value");
917                 return JSValueMakeUndefined(context);
918             }
919             return convert.toJSValueRef(deviceCapabilitiesInfo->autoRotation);
920         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SHELL_APP_WIDGET)) {
921             bool shellAppWidget = false;
922             if(system_info_get_platform_bool("tizen.org/feature/shell.appwidget", &shellAppWidget) == SYSTEM_INFO_ERROR_NONE) {
923                 deviceCapabilitiesInfo->shellAppWidget = shellAppWidget;
924             } else {
925                 LoggerE("get fail shellAppWidget value");
926                 return JSValueMakeUndefined(context);
927             }
928             return convert.toJSValueRef(deviceCapabilitiesInfo->shellAppWidget);
929         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_VISION_IMAGE_RECOGNITION)) {
930             bool visionImageRecognition = false;
931             if(system_info_get_platform_bool("tizen.org/feature/vision.image_recognition", &visionImageRecognition) == SYSTEM_INFO_ERROR_NONE) {
932                 deviceCapabilitiesInfo->visionImageRecognition = visionImageRecognition;
933             } else {
934                 LoggerE("get fail visionImageRecognition value");
935                 return JSValueMakeUndefined(context);
936             }
937             return convert.toJSValueRef(deviceCapabilitiesInfo->visionImageRecognition);
938         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_VISION_QRCODE_GENERATION)) {
939             bool visionQrcodeGeneration = false;
940             if(system_info_get_platform_bool("tizen.org/feature/vision.qrcode_generation", &visionQrcodeGeneration) == SYSTEM_INFO_ERROR_NONE) {
941                 deviceCapabilitiesInfo->visionQrcodeGeneration = visionQrcodeGeneration;
942             } else {
943                 LoggerE("get fail visionQrcodeGeneration value");
944                 return JSValueMakeUndefined(context);
945             }
946             return convert.toJSValueRef(deviceCapabilitiesInfo->visionQrcodeGeneration);
947         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_VISION_QRCODE_RECOGNITION)) {
948             bool visionQrcodeRecognition = false;
949             if(system_info_get_platform_bool("tizen.org/feature/vision.qrcode_recognition", &visionQrcodeRecognition) == SYSTEM_INFO_ERROR_NONE) {
950                 deviceCapabilitiesInfo->visionQrcodeRecognition = visionQrcodeRecognition;
951             } else {
952                 LoggerE("get fail visionQrcodeRecognition value");
953                 return JSValueMakeUndefined(context);
954             }
955             return convert.toJSValueRef(deviceCapabilitiesInfo->visionQrcodeRecognition);
956         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_VISION_FACE_RECOGNITION)) {
957             bool visionFaceRecognition = false;
958             if(system_info_get_platform_bool("tizen.org/feature/vision.face_recognition", &visionFaceRecognition) == SYSTEM_INFO_ERROR_NONE) {
959                 deviceCapabilitiesInfo->visionFaceRecognition = visionFaceRecognition;
960             } else {
961                 LoggerE("get fail visionFaceRecognition value");
962                 return JSValueMakeUndefined(context);
963             }
964             return convert.toJSValueRef(deviceCapabilitiesInfo->visionFaceRecognition);
965         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SECURE_ELEMENT)) {
966             bool secureElement = false;
967             if(system_info_get_platform_bool("tizen.org/feature/network.secure_element", &secureElement) == SYSTEM_INFO_ERROR_NONE) {
968                 deviceCapabilitiesInfo->secureElement = secureElement;
969             } else {
970                 LoggerE("get fail secureElement value");
971                 return JSValueMakeUndefined(context);
972             }
973             return convert.toJSValueRef(deviceCapabilitiesInfo->secureElement);
974         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_NATIVE_OSP_COMPATIBLE)) {
975             bool nativeOspCompatible = false;
976             if(system_info_get_platform_bool("tizen.org/feature/platform.native.osp_compatible", &nativeOspCompatible) == SYSTEM_INFO_ERROR_NONE) {
977                 deviceCapabilitiesInfo->nativeOspCompatible = nativeOspCompatible;
978             } else {
979                 LoggerE("get fail nativeOspCompatible value");
980                 return JSValueMakeUndefined(context);
981             }
982             return convert.toJSValueRef(deviceCapabilitiesInfo->nativeOspCompatible);
983         } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PROFILE)) {
984             deviceCapabilitiesInfo->profile = DEVICE_PROFILE;            
985             return convert.toJSValueRef(deviceCapabilitiesInfo->profile);        
986         }
987     }
988     Catch(Exception)
989     {
990         LoggerE("Exception: " << _rethrown_exception.GetMessage());
991         JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::UNKNOWN_ERROR);
992     }
993     return JSValueMakeUndefined(context);
994 }
995
996 }
997 }