2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
23 #include <JSWebAPIErrorFactory.h>
24 #include <SecurityExceptions.h>
26 #include <system_info.h>
27 #include <pkgmgr-info.h>
28 #include "JSDeviceCapabilitiesInfo.h"
29 #include "plugin_config.h"
32 #define MAXBUFSIZE 256
33 #define DEVICE_PROFILE "MOBILE_FULL"
34 #define DUID_KEY_STRING 28
35 #define DUID_BUFFER_SIZE 100
38 namespace Systeminfo {
39 using namespace WrtDeviceApis::CommonsJavaScript;
40 using namespace WrtDeviceApis::Commons;
41 using namespace DeviceAPI::Common;
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";
114 JSClassRef JSDeviceCapabilitiesInfo::m_classRef = NULL;
116 JSClassDefinition JSDeviceCapabilitiesInfo::m_classInfo = {
118 kJSClassAttributeNone,
119 "devicecapabilitiesinfo",
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 },
208 const JSClassRef JSDeviceCapabilitiesInfo::getClassRef()
211 m_classRef = JSClassCreate(&m_classInfo);
216 const JSClassDefinition* JSDeviceCapabilitiesInfo::getClassInfo()
221 void JSDeviceCapabilitiesInfo::Initialize(JSContextRef context, JSObjectRef object)
225 void JSDeviceCapabilitiesInfo::Finalize(JSObjectRef object)
228 JSDeviceCapabilitiesPriv* priv = static_cast<JSDeviceCapabilitiesPriv*>(JSObjectGetPrivate(object));
229 JSObjectSetPrivate(object, NULL);
230 LoggerD("Deleting DeviceCapabilitiesInfo object");
234 bool JSDeviceCapabilitiesInfo::hasProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName)
236 return JSUtils::hasProperty(m_properties, propertyName);
239 JSObjectRef JSDeviceCapabilitiesInfo::createJSObject(JSContextRef context, const DeviceCapabilitiesPropertiesPtr deviceCapabilitiesInfo)
242 JSDeviceCapabilitiesPriv *priv = new JSDeviceCapabilitiesPriv(context, deviceCapabilitiesInfo);
243 return JSObjectMake(context, getClassRef(), priv);
246 JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
249 JSDeviceCapabilitiesPriv *priv = static_cast<JSDeviceCapabilitiesPriv*>(JSObjectGetPrivate(object));
251 LoggerE("Private object not set.");
252 return JSValueMakeUndefined(context);
257 DeviceCapabilitiesPropertiesPtr deviceCapabilitiesInfo = priv->getObject();
258 Converter convert(context);
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;
265 LoggerE("get fail bluetooth value");
266 return JSValueMakeUndefined(context);
268 return convert.toJSValueRef(deviceCapabilitiesInfo->bluetooth);
269 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_NFC)) {
271 if(system_info_get_platform_bool("tizen.org/feature/network.nfc", &nfc) == SYSTEM_INFO_ERROR_NONE) {
272 deviceCapabilitiesInfo->nfc = nfc;
274 LoggerE("get fail nfc value");
275 return JSValueMakeUndefined(context);
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;
283 LoggerE("get fail nfc reserved push value");
284 return JSValueMakeUndefined(context);
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;
292 LoggerE("get fail multiTouchCount value");
293 return JSValueMakeUndefined(context);
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;
301 LoggerE("get fail inputKeyboard value");
302 return JSValueMakeUndefined(context);
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);
312 deviceCapabilitiesInfo->inputKeyboardLayout = false;
315 LoggerE("get fail inputKeyboardLayout value");
316 return JSValueMakeUndefined(context);
318 return convert.toJSValueRef(deviceCapabilitiesInfo->inputKeyboardLayout);
319 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_WIFI)) {
321 if(system_info_get_platform_bool("tizen.org/feature/network.wifi", &wifi) == SYSTEM_INFO_ERROR_NONE) {
322 deviceCapabilitiesInfo->wifi = wifi;
324 LoggerE("get fail wifi value");
325 return JSValueMakeUndefined(context);
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;
333 LoggerE("get fail wifiDirect value");
334 return JSValueMakeUndefined(context);
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;
342 LoggerE("get fail opengles value");
343 return JSValueMakeUndefined(context);
345 return convert.toJSValueRef(deviceCapabilitiesInfo->opengles);
346 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_OPENGLES_TEXTURE_FORMAT)) {
347 bool texture = false;
349 char* textureFormat = NULL;
350 char textureFormatFull[MAXBUFSIZE];
351 textureFormatFull[0] = '\0';
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");
357 if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.ptc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
359 strcat(textureFormatFull, " | ");
361 strcat(textureFormatFull, "ptc");
364 if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.etc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
366 strcat(textureFormatFull, " | ");
368 strcat(textureFormatFull, "etc");
371 if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.3dc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
373 strcat(textureFormatFull, " | ");
375 strcat(textureFormatFull, "3dc");
377 if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.atc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
379 strcat(textureFormatFull, " | ");
381 strcat(textureFormatFull, "atc");
384 if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.pvrtc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
386 strcat(textureFormatFull, " | ");
388 strcat(textureFormatFull, "pvrtc");
391 textureFormat = strdup(textureFormatFull);
393 if (textureFormat == NULL) {
394 LoggerE("get fail openglestextureFormat value");
395 return JSValueMakeUndefined(context);
398 deviceCapabilitiesInfo->openglestextureFormat = textureFormat;
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;
407 LoggerE("get fail openglesVersion1_1 value");
408 return JSValueMakeUndefined(context);
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;
416 LoggerE("get fail openglesVersion2_0 value");
417 return JSValueMakeUndefined(context);
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;
425 LoggerE("get fail fmRadio value");
426 return JSValueMakeUndefined(context);
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);
437 LoggerE("get fail platformVersion value");
438 return JSValueMakeUndefined(context);
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;
447 LoggerE("get fail platformName value");
448 return JSValueMakeUndefined(context);
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;
459 LoggerE("get fail webApiVersion value");
460 return JSValueMakeUndefined(context);
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);
471 LoggerE("get fail nativeApiVersion value");
472 return JSValueMakeUndefined(context);
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;
480 LoggerE("get fail cameraFront value");
481 return JSValueMakeUndefined(context);
483 return convert.toJSValueRef(deviceCapabilitiesInfo->cameraFront);
484 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERA)) {
486 if(system_info_get_platform_bool("tizen.org/feature/camera", &camera) == SYSTEM_INFO_ERROR_NONE) {
487 deviceCapabilitiesInfo->camera = camera;
489 LoggerE("get fail camera value");
490 return JSValueMakeUndefined(context);
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;
498 LoggerE("get fail cameraFrontFlash value");
499 return JSValueMakeUndefined(context);
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;
507 LoggerE("get fail cameraBack value");
508 return JSValueMakeUndefined(context);
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;
516 LoggerE("get fail cameraBackFlash value");
517 return JSValueMakeUndefined(context);
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;
525 LoggerE("get fail location value");
526 return JSValueMakeUndefined(context);
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;
534 LoggerE("get fail locationGps value");
535 return JSValueMakeUndefined(context);
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;
543 LoggerE("get fail locationWps value");
544 return JSValueMakeUndefined(context);
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", µphone) == SYSTEM_INFO_ERROR_NONE) {
550 deviceCapabilitiesInfo->microphone = microphone;
552 LoggerE("get fail microphone value");
553 return JSValueMakeUndefined(context);
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;
561 LoggerE("get fail usbHost value");
562 return JSValueMakeUndefined(context);
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;
570 LoggerE("get fail usbAccessory value");
571 return JSValueMakeUndefined(context);
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;
579 LoggerE("get fail screenOutputRca value");
580 return JSValueMakeUndefined(context);
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;
588 LoggerE("get fail screenOutputHdmi value");
589 return JSValueMakeUndefined(context);
591 return convert.toJSValueRef(deviceCapabilitiesInfo->screenOutputHdmi);
592 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PLATFORMCORECPUARCH)) {
593 bool cpuArch = false;
595 char* platformCoreCpuArch = NULL;
596 char platformCoreCpuArchFull[MAXBUFSIZE];
597 platformCoreCpuArchFull[0] = '\0';
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");
603 if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.armv7", &cpuArch) == SYSTEM_INFO_ERROR_NONE && cpuArch == true) {
605 strcat(platformCoreCpuArchFull, " | ");
607 strcat(platformCoreCpuArchFull, "armv7");
610 if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.x86", &cpuArch) == SYSTEM_INFO_ERROR_NONE && cpuArch == true) {
612 strcat(platformCoreCpuArchFull, " | ");
614 strcat(platformCoreCpuArchFull, "x86");
617 platformCoreCpuArch = strdup(platformCoreCpuArchFull);
619 if (platformCoreCpuArch == NULL) {
620 LoggerE("get fail platformCoreCpuArch value");
621 return JSValueMakeUndefined(context);
624 deviceCapabilitiesInfo->platformCoreCpuArch = platformCoreCpuArch;
625 free(platformCoreCpuArch);
627 return convert.toJSValueRef(deviceCapabilitiesInfo->platformCoreCpuArch);
628 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PLATFORMCOREFPUARCH)) {
629 bool fpuArch = false;
631 char* platformCoreFpuArch = NULL;
632 char platformCoreFpuArchFull[MAXBUFSIZE];
633 platformCoreFpuArchFull[0] = '\0';
635 if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.sse2", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
637 strcat(platformCoreFpuArchFull, "sse2");
639 if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.sse3", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
641 strcat(platformCoreFpuArchFull, " | ");
643 strcat(platformCoreFpuArchFull, "sse3");
646 if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.ssse3", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
648 strcat(platformCoreFpuArchFull, " | ");
650 strcat(platformCoreFpuArchFull, "ssse3");
653 if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.vfpv2", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
655 strcat(platformCoreFpuArchFull, " | ");
657 strcat(platformCoreFpuArchFull, "vfpv2");
660 if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.vfpv3", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
662 strcat(platformCoreFpuArchFull, " | ");
664 strcat(platformCoreFpuArchFull, "vfpv3");
666 platformCoreFpuArch = strdup(platformCoreFpuArchFull);
668 if (platformCoreFpuArch == NULL) {
669 LoggerE("get fail platformCoreFpuArch value");
670 return JSValueMakeUndefined(context);
673 deviceCapabilitiesInfo->platformCoreCpuArch = platformCoreFpuArch;
674 free(platformCoreFpuArch);
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;
682 LoggerE("get fail sipVoip value");
683 return JSValueMakeUndefined(context);
685 return convert.toJSValueRef(deviceCapabilitiesInfo->sipVoip);
686 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_DUID)) {
688 char duid[DUID_BUFFER_SIZE] = {0,};
689 fp = fopen("/opt/usr/etc/system_info_cache.ini", "r");
692 LoggerD("fail file open.");
693 return convert.toJSValueRef(deviceCapabilitiesInfo->duid);
696 while(fgets(duid, DUID_BUFFER_SIZE-1, fp)) {
697 if (strncmp(duid, "http://tizen.org/system/duid", DUID_KEY_STRING) == 0) {
698 LoggerD("duid : " << duid);
699 deviceCapabilitiesInfo->duid = duid;
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;
710 LoggerE("get fail speechRecognition value");
711 return JSValueMakeUndefined(context);
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;
719 LoggerE("get fail speechSynthesis value");
720 return JSValueMakeUndefined(context);
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;
728 LoggerE("get fail accelerometer value");
729 return JSValueMakeUndefined(context);
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;
737 LoggerE("get fail accelerometerWakeup value");
738 return JSValueMakeUndefined(context);
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;
746 LoggerE("get fail barometer value");
747 return JSValueMakeUndefined(context);
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;
755 LoggerE("get fail barometerWakeup value");
756 return JSValueMakeUndefined(context);
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;
764 LoggerE("get fail gyroscope value");
765 return JSValueMakeUndefined(context);
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;
773 LoggerE("get fail gyroscopeWakeup value");
774 return JSValueMakeUndefined(context);
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;
782 LoggerE("get fail magnetometer value");
783 return JSValueMakeUndefined(context);
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;
791 LoggerE("get fail magnetometerWakeup value");
792 return JSValueMakeUndefined(context);
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;
800 LoggerE("get fail photometer value");
801 return JSValueMakeUndefined(context);
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;
809 LoggerE("get fail photometerWakeup value");
810 return JSValueMakeUndefined(context);
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;
818 LoggerE("get fail proximity value");
819 return JSValueMakeUndefined(context);
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;
827 LoggerE("get fail proximityWakeup value");
828 return JSValueMakeUndefined(context);
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;
836 LoggerE("get fail tiltmeter value");
837 return JSValueMakeUndefined(context);
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;
845 LoggerE("get fail tiltmeterWakeup value");
846 return JSValueMakeUndefined(context);
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;
854 LoggerE("get fail dataEncryption value");
855 return JSValueMakeUndefined(context);
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;
863 LoggerE("get fail graphicsAcceleration value");
864 return JSValueMakeUndefined(context);
866 return convert.toJSValueRef(deviceCapabilitiesInfo->graphicsAcceleration);
867 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PUSH)) {
869 if(system_info_get_platform_bool("tizen.org/feature/network.push", &push) == SYSTEM_INFO_ERROR_NONE) {
870 deviceCapabilitiesInfo->push = push;
872 LoggerE("get fail push value");
873 return JSValueMakeUndefined(context);
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;
881 LoggerE("get fail telephony value");
882 return JSValueMakeUndefined(context);
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;
890 LoggerE("get fail telephonyMms value");
891 return JSValueMakeUndefined(context);
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;
899 LoggerE("get fail telephonySms value");
900 return JSValueMakeUndefined(context);
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;
908 LoggerE("get fail screenSizeNormal value");
909 return JSValueMakeUndefined(context);
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;
917 LoggerE("get fail screenSize480_800 value");
918 return JSValueMakeUndefined(context);
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;
926 LoggerE("get fail screenSize720_1280 value");
927 return JSValueMakeUndefined(context);
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;
935 LoggerE("get fail autoRotation value");
936 return JSValueMakeUndefined(context);
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;
944 LoggerE("get fail shellAppWidget value");
945 return JSValueMakeUndefined(context);
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;
953 LoggerE("get fail visionImageRecognition value");
954 return JSValueMakeUndefined(context);
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;
962 LoggerE("get fail visionQrcodeGeneration value");
963 return JSValueMakeUndefined(context);
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;
971 LoggerE("get fail visionQrcodeRecognition value");
972 return JSValueMakeUndefined(context);
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;
980 LoggerE("get fail visionFaceRecognition value");
981 return JSValueMakeUndefined(context);
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;
989 LoggerE("get fail secureElement value");
990 return JSValueMakeUndefined(context);
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;
998 LoggerE("get fail nativeOspCompatible value");
999 return JSValueMakeUndefined(context);
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);
1009 LoggerE("Exception: " << _rethrown_exception.GetMessage());
1010 JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::UNKNOWN_ERROR);
1012 return JSValueMakeUndefined(context);