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