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"
36 namespace Systeminfo {
37 using namespace WrtDeviceApis::CommonsJavaScript;
38 using namespace WrtDeviceApis::Commons;
39 using namespace DeviceAPI::Common;
42 const char* DEVICE_CAPABILITIES_BLUETOOTH = "bluetooth";
43 const char* DEVICE_CAPABILITIES_NFC = "nfc";
44 const char* DEVICE_CAPABILITIES_NFC_RESERVED_PUSH = "nfcReservedPush";
45 const char* DEVICE_CAPABILITIES_MULTITOUCHCOUNT = "multiTouchCount";
46 const char* DEVICE_CAPABILITIES_INPUTKEYBOARD = "inputKeyboard";
47 const char* DEVICE_CAPABILITIES_INPUTKEYBOARD_LAYOUT = "inputKeyboardLayout";
48 const char* DEVICE_CAPABILITIES_WIFI = "wifi";
49 const char* DEVICE_CAPABILITIES_WIFIDIRECT = "wifiDirect";
50 const char* DEVICE_CAPABILITIES_OPENGLES = "opengles";
51 const char* DEVICE_CAPABILITIES_OPENGLES_TEXTURE_FORMAT = "openglestextureFormat";
52 const char* DEVICE_CAPABILITIES_OPENGLESVERSION1_1 = "openglesVersion1_1";
53 const char* DEVICE_CAPABILITIES_OPENGLESVERSION2_0 = "openglesVersion2_0";
54 const char* DEVICE_CAPABILITIES_FMRADIO = "fmRadio";
55 const char* DEVICE_CAPABILITIES_PLATFORMVERSION = "platformVersion";
56 const char* DEVICE_CAPABILITIES_PLATFORMNAME = "platformName";
57 const char* DEVICE_CAPABILITIES_WEBAPIVERSION = "webApiVersion";
58 const char* DEVICE_CAPABILITIES_NATIVEAPIVERSION = "nativeApiVersion";
59 const char* DEVICE_CAPABILITIES_CAMERA = "camera";
60 const char* DEVICE_CAPABILITIES_CAMERAFRONT = "cameraFront";
61 const char* DEVICE_CAPABILITIES_CAMERAFRONTFLASH = "cameraFrontFlash";
62 const char* DEVICE_CAPABILITIES_CAMERABACK = "cameraBack";
63 const char* DEVICE_CAPABILITIES_CAMERABACKFLASH = "cameraBackFlash";
64 const char* DEVICE_CAPABILITIES_LOCATION = "location";
65 const char* DEVICE_CAPABILITIES_LOCATIONGPS = "locationGps";
66 const char* DEVICE_CAPABILITIES_LOCATIONWPS = "locationWps";
67 const char* DEVICE_CAPABILITIES_MICROPHONE = "microphone";
68 const char* DEVICE_CAPABILITIES_USBHOST = "usbHost";
69 const char* DEVICE_CAPABILITIES_USBACCESSORY = "usbAccessory";
70 const char* DEVICE_CAPABILITIES_SCREENOUTPUTRCA = "screenOutputRca";
71 const char* DEVICE_CAPABILITIES_SCREENOUTPUTHDMI = "screenOutputHdmi";
72 const char* DEVICE_CAPABILITIES_PLATFORMCORECPUARCH = "platformCoreCpuArch";
73 const char* DEVICE_CAPABILITIES_PLATFORMCOREFPUARCH = "platformCoreFpuArch";
74 const char* DEVICE_CAPABILITIES_SIPVOIP = "sipVoip";
75 const char* DEVICE_CAPABILITIES_DUID = "duid";
76 const char* DEVICE_CAPABILITIES_SPEECH_ROCOGNITION = "speechRecognition";
77 const char* DEVICE_CAPABILITIES_SPEECH_SYNTHESIS = "speechSynthesis";
78 const char* DEVICE_CAPABILITIES_ACCELEROMETER = "accelerometer";
79 const char* DEVICE_CAPABILITIES_ACCELEROMETER_WAKEUP = "accelerometerWakeup";
80 const char* DEVICE_CAPABILITIES_BAROMETER = "barometer";
81 const char* DEVICE_CAPABILITIES_BAROMETER_WAKEUP = "barometerWakeup";
82 const char* DEVICE_CAPABILITIES_GYROSCOPE = "gyroscope";
83 const char* DEVICE_CAPABILITIES_GYROSCOPE_WAKEUP = "gyroscopeWakeup";
84 const char* DEVICE_CAPABILITIES_MAGNETOMETER = "magnetometer";
85 const char* DEVICE_CAPABILITIES_MAGNETOMETER_WAKEUP = "magnetometerWakeup";
86 const char* DEVICE_CAPABILITIES_PHOTOMETER = "photometer";
87 const char* DEVICE_CAPABILITIES_PHOTOMETER_WAKEUP = "photometerWakeup";
88 const char* DEVICE_CAPABILITIES_PROXIMITY = "proximity";
89 const char* DEVICE_CAPABILITIES_PROXIMITY_WAKEUP = "proximityWakeup";
90 const char* DEVICE_CAPABILITIES_TILTMETER = "tiltmeter";
91 const char* DEVICE_CAPABILITIES_TILTMETER_WAKEUP = "tiltmeterWakeup";
92 const char* DEVICE_CAPABILITIES_DATA_ENCRYPTION = "dataEncryption";
93 const char* DEVICE_CAPABILITIES_GRAPHICS_ACCELERATION = "graphicsAcceleration";
94 const char* DEVICE_CAPABILITIES_PUSH = "push";
95 const char* DEVICE_CAPABILITIES_TELEPHONY = "telephony";
96 const char* DEVICE_CAPABILITIES_TELEPHONY_MMS = "telephonyMms";
97 const char* DEVICE_CAPABILITIES_TELEPHONY_SMS = "telephonySms";
98 const char* DEVICE_CAPABILITIES_SCREENSIZE_NORMAL = "screenSizeNormal";
99 const char* DEVICE_CAPABILITIES_SCREENSIZE_480_800 = "screenSize480_800";
100 const char* DEVICE_CAPABILITIES_SCREENSIZE_720_1280 = "screenSize720_1280";
101 const char* DEVICE_CAPABILITIES_AUTO_ROTATION = "autoRotation";
102 const char* DEVICE_CAPABILITIES_SHELL_APP_WIDGET = "shellAppWidget";
103 const char* DEVICE_CAPABILITIES_VISION_IMAGE_RECOGNITION = "visionImageRecognition";
104 const char* DEVICE_CAPABILITIES_VISION_QRCODE_GENERATION = "visionQrcodeGeneration";
105 const char* DEVICE_CAPABILITIES_VISION_QRCODE_RECOGNITION = "visionQrcodeRecognition";
106 const char* DEVICE_CAPABILITIES_VISION_FACE_RECOGNITION = "visionFaceRecognition";
107 const char* DEVICE_CAPABILITIES_SECURE_ELEMENT = "secureElement";
108 const char* DEVICE_CAPABILITIES_NATIVE_OSP_COMPATIBLE = "nativeOspCompatible";
109 const char* DEVICE_CAPABILITIES_PROFILE = "profile";
112 JSClassRef JSDeviceCapabilitiesInfo::m_classRef = NULL;
114 JSClassDefinition JSDeviceCapabilitiesInfo::m_classInfo = {
116 kJSClassAttributeNone,
117 "devicecapabilitiesinfo",
134 JSStaticValue JSDeviceCapabilitiesInfo::m_properties[] = {
135 { DEVICE_CAPABILITIES_BLUETOOTH, getProperty, NULL, kJSPropertyAttributeReadOnly },
136 { DEVICE_CAPABILITIES_NFC, getProperty, NULL, kJSPropertyAttributeReadOnly },
137 { DEVICE_CAPABILITIES_NFC_RESERVED_PUSH, getProperty, NULL, kJSPropertyAttributeReadOnly },
138 { DEVICE_CAPABILITIES_MULTITOUCHCOUNT, getProperty, NULL, kJSPropertyAttributeReadOnly },
139 { DEVICE_CAPABILITIES_INPUTKEYBOARD, getProperty, NULL, kJSPropertyAttributeReadOnly },
140 { DEVICE_CAPABILITIES_INPUTKEYBOARD_LAYOUT, getProperty, NULL, kJSPropertyAttributeReadOnly },
141 { DEVICE_CAPABILITIES_WIFI, getProperty, NULL, kJSPropertyAttributeReadOnly },
142 { DEVICE_CAPABILITIES_WIFIDIRECT, getProperty, NULL, kJSPropertyAttributeReadOnly },
143 { DEVICE_CAPABILITIES_OPENGLES, getProperty, NULL, kJSPropertyAttributeReadOnly },
144 { DEVICE_CAPABILITIES_OPENGLES_TEXTURE_FORMAT, getProperty, NULL, kJSPropertyAttributeReadOnly },
145 { DEVICE_CAPABILITIES_OPENGLESVERSION1_1, getProperty, NULL, kJSPropertyAttributeReadOnly },
146 { DEVICE_CAPABILITIES_OPENGLESVERSION2_0, getProperty, NULL, kJSPropertyAttributeReadOnly },
147 { DEVICE_CAPABILITIES_FMRADIO, getProperty, NULL, kJSPropertyAttributeReadOnly },
148 { DEVICE_CAPABILITIES_PLATFORMVERSION, getProperty, NULL, kJSPropertyAttributeReadOnly },
149 { DEVICE_CAPABILITIES_PLATFORMNAME, getProperty, NULL, kJSPropertyAttributeReadOnly },
150 { DEVICE_CAPABILITIES_WEBAPIVERSION, getProperty, NULL, kJSPropertyAttributeReadOnly },
151 { DEVICE_CAPABILITIES_NATIVEAPIVERSION, getProperty, NULL, kJSPropertyAttributeReadOnly },
152 { DEVICE_CAPABILITIES_CAMERA, getProperty, NULL, kJSPropertyAttributeReadOnly },
153 { DEVICE_CAPABILITIES_CAMERAFRONT, getProperty, NULL, kJSPropertyAttributeReadOnly },
154 { DEVICE_CAPABILITIES_CAMERAFRONTFLASH, getProperty, NULL, kJSPropertyAttributeReadOnly },
155 { DEVICE_CAPABILITIES_CAMERABACK, getProperty, NULL, kJSPropertyAttributeReadOnly },
156 { DEVICE_CAPABILITIES_CAMERABACKFLASH, getProperty, NULL, kJSPropertyAttributeReadOnly },
157 { DEVICE_CAPABILITIES_LOCATION, getProperty, NULL, kJSPropertyAttributeReadOnly },
158 { DEVICE_CAPABILITIES_LOCATIONGPS, getProperty, NULL, kJSPropertyAttributeReadOnly },
159 { DEVICE_CAPABILITIES_LOCATIONWPS, getProperty, NULL, kJSPropertyAttributeReadOnly },
160 { DEVICE_CAPABILITIES_MICROPHONE, getProperty, NULL, kJSPropertyAttributeReadOnly },
161 { DEVICE_CAPABILITIES_USBHOST, getProperty, NULL, kJSPropertyAttributeReadOnly },
162 { DEVICE_CAPABILITIES_USBACCESSORY, getProperty, NULL, kJSPropertyAttributeReadOnly },
163 { DEVICE_CAPABILITIES_SCREENOUTPUTRCA, getProperty, NULL, kJSPropertyAttributeReadOnly },
164 { DEVICE_CAPABILITIES_SCREENOUTPUTHDMI, getProperty, NULL, kJSPropertyAttributeReadOnly },
165 { DEVICE_CAPABILITIES_PLATFORMCORECPUARCH, getProperty, NULL, kJSPropertyAttributeReadOnly },
166 { DEVICE_CAPABILITIES_PLATFORMCOREFPUARCH, getProperty, NULL, kJSPropertyAttributeReadOnly },
167 { DEVICE_CAPABILITIES_SIPVOIP, getProperty, NULL, kJSPropertyAttributeReadOnly },
168 { DEVICE_CAPABILITIES_DUID, getProperty, NULL, kJSPropertyAttributeReadOnly },
169 { DEVICE_CAPABILITIES_SPEECH_ROCOGNITION, getProperty, NULL, kJSPropertyAttributeReadOnly },
170 { DEVICE_CAPABILITIES_SPEECH_SYNTHESIS, getProperty, NULL, kJSPropertyAttributeReadOnly },
171 { DEVICE_CAPABILITIES_ACCELEROMETER, getProperty, NULL, kJSPropertyAttributeReadOnly },
172 { DEVICE_CAPABILITIES_ACCELEROMETER_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
173 { DEVICE_CAPABILITIES_BAROMETER, getProperty, NULL, kJSPropertyAttributeReadOnly },
174 { DEVICE_CAPABILITIES_BAROMETER_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
175 { DEVICE_CAPABILITIES_GYROSCOPE, getProperty, NULL, kJSPropertyAttributeReadOnly },
176 { DEVICE_CAPABILITIES_GYROSCOPE_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
177 { DEVICE_CAPABILITIES_MAGNETOMETER, getProperty, NULL, kJSPropertyAttributeReadOnly },
178 { DEVICE_CAPABILITIES_MAGNETOMETER_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
179 { DEVICE_CAPABILITIES_PHOTOMETER, getProperty, NULL, kJSPropertyAttributeReadOnly },
180 { DEVICE_CAPABILITIES_PHOTOMETER_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
181 { DEVICE_CAPABILITIES_PROXIMITY, getProperty, NULL, kJSPropertyAttributeReadOnly },
182 { DEVICE_CAPABILITIES_PROXIMITY_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
183 { DEVICE_CAPABILITIES_TILTMETER, getProperty, NULL, kJSPropertyAttributeReadOnly },
184 { DEVICE_CAPABILITIES_TILTMETER_WAKEUP, getProperty, NULL, kJSPropertyAttributeReadOnly },
185 { DEVICE_CAPABILITIES_DATA_ENCRYPTION, getProperty, NULL, kJSPropertyAttributeReadOnly },
186 { DEVICE_CAPABILITIES_GRAPHICS_ACCELERATION, getProperty, NULL, kJSPropertyAttributeReadOnly },
187 { DEVICE_CAPABILITIES_PUSH, getProperty, NULL, kJSPropertyAttributeReadOnly },
188 { DEVICE_CAPABILITIES_TELEPHONY, getProperty, NULL, kJSPropertyAttributeReadOnly },
189 { DEVICE_CAPABILITIES_TELEPHONY_MMS, getProperty, NULL, kJSPropertyAttributeReadOnly },
190 { DEVICE_CAPABILITIES_TELEPHONY_SMS, getProperty, NULL, kJSPropertyAttributeReadOnly },
191 { DEVICE_CAPABILITIES_SCREENSIZE_NORMAL, getProperty, NULL, kJSPropertyAttributeReadOnly },
192 { DEVICE_CAPABILITIES_SCREENSIZE_480_800, getProperty, NULL, kJSPropertyAttributeReadOnly },
193 { DEVICE_CAPABILITIES_SCREENSIZE_720_1280, getProperty, NULL, kJSPropertyAttributeReadOnly },
194 { DEVICE_CAPABILITIES_AUTO_ROTATION, getProperty, NULL, kJSPropertyAttributeReadOnly },
195 { DEVICE_CAPABILITIES_SHELL_APP_WIDGET, getProperty, NULL, kJSPropertyAttributeReadOnly },
196 { DEVICE_CAPABILITIES_VISION_IMAGE_RECOGNITION, getProperty, NULL, kJSPropertyAttributeReadOnly },
197 { DEVICE_CAPABILITIES_VISION_QRCODE_GENERATION, getProperty, NULL, kJSPropertyAttributeReadOnly },
198 { DEVICE_CAPABILITIES_VISION_QRCODE_RECOGNITION, getProperty, NULL, kJSPropertyAttributeReadOnly },
199 { DEVICE_CAPABILITIES_VISION_FACE_RECOGNITION, getProperty, NULL, kJSPropertyAttributeReadOnly },
200 { DEVICE_CAPABILITIES_SECURE_ELEMENT, getProperty, NULL, kJSPropertyAttributeReadOnly },
201 { DEVICE_CAPABILITIES_NATIVE_OSP_COMPATIBLE, getProperty, NULL, kJSPropertyAttributeReadOnly },
202 { DEVICE_CAPABILITIES_PROFILE, getProperty, NULL, kJSPropertyAttributeReadOnly },
206 const JSClassRef JSDeviceCapabilitiesInfo::getClassRef()
209 m_classRef = JSClassCreate(&m_classInfo);
214 const JSClassDefinition* JSDeviceCapabilitiesInfo::getClassInfo()
219 void JSDeviceCapabilitiesInfo::Initialize(JSContextRef context, JSObjectRef object)
223 void JSDeviceCapabilitiesInfo::Finalize(JSObjectRef object)
226 JSDeviceCapabilitiesPriv* priv = static_cast<JSDeviceCapabilitiesPriv*>(JSObjectGetPrivate(object));
227 JSObjectSetPrivate(object, NULL);
228 LoggerD("Deleting DeviceCapabilitiesInfo object");
232 bool JSDeviceCapabilitiesInfo::hasProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName)
234 return JSUtils::hasProperty(m_properties, propertyName);
237 JSObjectRef JSDeviceCapabilitiesInfo::createJSObject(JSContextRef context, const DeviceCapabilitiesPropertiesPtr deviceCapabilitiesInfo)
240 JSDeviceCapabilitiesPriv *priv = new JSDeviceCapabilitiesPriv(context, deviceCapabilitiesInfo);
241 return JSObjectMake(context, getClassRef(), priv);
244 JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
247 JSDeviceCapabilitiesPriv *priv = static_cast<JSDeviceCapabilitiesPriv*>(JSObjectGetPrivate(object));
249 LoggerE("Private object not set.");
250 return JSValueMakeUndefined(context);
255 DeviceCapabilitiesPropertiesPtr deviceCapabilitiesInfo = priv->getObject();
256 Converter convert(context);
258 if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_BLUETOOTH)) {
259 bool bluetooth = false;
260 if(system_info_get_platform_bool("tizen.org/feature/network.bluetooth", &bluetooth) == SYSTEM_INFO_ERROR_NONE) {
261 deviceCapabilitiesInfo->bluetooth = bluetooth;
263 LoggerE("get fail bluetooth value");
264 return JSValueMakeUndefined(context);
266 return convert.toJSValueRef(deviceCapabilitiesInfo->bluetooth);
267 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_NFC)) {
269 if(system_info_get_platform_bool("tizen.org/feature/network.nfc", &nfc) == SYSTEM_INFO_ERROR_NONE) {
270 deviceCapabilitiesInfo->nfc = nfc;
272 LoggerE("get fail nfc value");
273 return JSValueMakeUndefined(context);
275 return convert.toJSValueRef(deviceCapabilitiesInfo->nfc);
276 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_NFC_RESERVED_PUSH)) {
277 bool nfcReservedPush = false;
278 if(system_info_get_platform_bool("tizen.org/feature/network.nfc.reserved_push", &nfcReservedPush) == SYSTEM_INFO_ERROR_NONE) {
279 deviceCapabilitiesInfo->nfcReservedPush = nfcReservedPush;
281 LoggerE("get fail nfc reserved push value");
282 return JSValueMakeUndefined(context);
284 return convert.toJSValueRef(deviceCapabilitiesInfo->nfcReservedPush);
285 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MULTITOUCHCOUNT)) {
286 int multiTouchCount = 0;
287 if(system_info_get_platform_int("tizen.org/feature/multi_point_touch.point_count", &multiTouchCount) == SYSTEM_INFO_ERROR_NONE) {
288 deviceCapabilitiesInfo->multiTouchCount = multiTouchCount;
290 LoggerE("get fail multiTouchCount value");
291 return JSValueMakeUndefined(context);
293 return convert.toJSValueRef(deviceCapabilitiesInfo->multiTouchCount);
294 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_INPUTKEYBOARD)) {
295 bool inputKeyboard = false;
296 if(system_info_get_platform_bool("tizen.org/feature/input.keyboard", &inputKeyboard) == SYSTEM_INFO_ERROR_NONE) {
297 deviceCapabilitiesInfo->inputKeyboard = inputKeyboard;
299 LoggerE("get fail inputKeyboard value");
300 return JSValueMakeUndefined(context);
302 return convert.toJSValueRef(deviceCapabilitiesInfo->inputKeyboard);
303 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_INPUTKEYBOARD_LAYOUT)) {
304 char* inputKeyboardLayout = NULL;
305 if(system_info_get_platform_string("tizen.org/feature/input.keyboard.layout", &inputKeyboardLayout) == SYSTEM_INFO_ERROR_NONE) {
306 if (inputKeyboardLayout) {
307 deviceCapabilitiesInfo->inputKeyboardLayout = true;
308 free(inputKeyboardLayout);
310 deviceCapabilitiesInfo->inputKeyboardLayout = false;
313 LoggerE("get fail inputKeyboardLayout value");
314 return JSValueMakeUndefined(context);
316 return convert.toJSValueRef(deviceCapabilitiesInfo->inputKeyboardLayout);
317 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_WIFI)) {
319 if(system_info_get_platform_bool("tizen.org/feature/network.wifi", &wifi) == SYSTEM_INFO_ERROR_NONE) {
320 deviceCapabilitiesInfo->wifi = wifi;
322 LoggerE("get fail wifi value");
323 return JSValueMakeUndefined(context);
325 return convert.toJSValueRef(deviceCapabilitiesInfo->wifi);
326 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_WIFIDIRECT)) {
327 bool wifiDirect = false;
328 if(system_info_get_platform_bool("tizen.org/feature/network.wifi.direct", &wifiDirect) == SYSTEM_INFO_ERROR_NONE) {
329 deviceCapabilitiesInfo->wifiDirect = wifiDirect;
331 LoggerE("get fail wifiDirect value");
332 return JSValueMakeUndefined(context);
334 return convert.toJSValueRef(deviceCapabilitiesInfo->wifiDirect);
335 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_OPENGLES)) {
336 bool opengles = NULL;
337 if(system_info_get_platform_bool("tizen.org/feature/opengles", &opengles) == SYSTEM_INFO_ERROR_NONE) {
338 deviceCapabilitiesInfo->opengles = opengles;
340 LoggerE("get fail opengles value");
341 return JSValueMakeUndefined(context);
343 return convert.toJSValueRef(deviceCapabilitiesInfo->opengles);
344 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_OPENGLES_TEXTURE_FORMAT)) {
345 bool texture = false;
347 char* textureFormat = NULL;
348 char textureFormatFull[MAXBUFSIZE];
349 textureFormatFull[0] = '\0';
351 if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.utc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
352 strcat(textureFormatFull, "utc");
355 if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.ptc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
357 strcat(textureFormatFull, " | ");
359 strcat(textureFormatFull, "ptc");
362 if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.etc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
364 strcat(textureFormatFull, " | ");
366 strcat(textureFormatFull, "etc");
369 if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.3dc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
371 strcat(textureFormatFull, " | ");
373 strcat(textureFormatFull, "3dc");
375 if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.atc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
377 strcat(textureFormatFull, " | ");
379 strcat(textureFormatFull, "atc");
382 if (system_info_get_platform_bool("tizen.org/feature/opengles.texture_format.pvrtc", &texture) == SYSTEM_INFO_ERROR_NONE && texture == true) {
384 strcat(textureFormatFull, " | ");
386 strcat(textureFormatFull, "pvrtc");
389 textureFormat = strdup(textureFormatFull);
391 if (textureFormat == NULL) {
392 LoggerE("get fail openglestextureFormat value");
393 return JSValueMakeUndefined(context);
396 deviceCapabilitiesInfo->openglestextureFormat = textureFormat;
399 return convert.toJSValueRef(deviceCapabilitiesInfo->openglestextureFormat);
400 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_OPENGLESVERSION1_1)) {
401 bool openglesVersion1_1 = false;
402 if(system_info_get_platform_bool("tizen.org/feature/opengles.version.1_1", &openglesVersion1_1) == SYSTEM_INFO_ERROR_NONE) {
403 deviceCapabilitiesInfo->openglesVersion1_1 = openglesVersion1_1;
405 LoggerE("get fail openglesVersion1_1 value");
406 return JSValueMakeUndefined(context);
408 return convert.toJSValueRef(deviceCapabilitiesInfo->openglesVersion1_1);
409 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_OPENGLESVERSION2_0)) {
410 bool openglesVersion2_0 = false;
411 if(system_info_get_platform_bool("tizen.org/feature/opengles.version.2_0", &openglesVersion2_0) == SYSTEM_INFO_ERROR_NONE) {
412 deviceCapabilitiesInfo->openglesVersion2_0 = openglesVersion2_0;
414 LoggerE("get fail openglesVersion2_0 value");
415 return JSValueMakeUndefined(context);
417 return convert.toJSValueRef(deviceCapabilitiesInfo->openglesVersion2_0);
418 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_FMRADIO)) {
419 bool fmRadio = false;
420 if(system_info_get_platform_bool("tizen.org/feature/fmradio", &fmRadio) == SYSTEM_INFO_ERROR_NONE) {
421 deviceCapabilitiesInfo->fmRadio = fmRadio;
423 LoggerE("get fail fmRadio value");
424 return JSValueMakeUndefined(context);
426 return convert.toJSValueRef(deviceCapabilitiesInfo->fmRadio);
427 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PLATFORMVERSION)) {
428 AceSecurityStatus status = SYSTEMINFO_CHECK_ACCESS(SYSTEMINFO_FUNCTION_API_GET_CAPABILITIES);
429 TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
430 char* platformVersion = NULL;
431 if(system_info_get_platform_string("tizen.org/feature/platform.version", &platformVersion) == SYSTEM_INFO_ERROR_NONE) {
432 deviceCapabilitiesInfo->platformVersion = platformVersion;
433 free(platformVersion);
435 LoggerE("get fail platformVersion value");
436 return JSValueMakeUndefined(context);
438 return convert.toJSValueRef(deviceCapabilitiesInfo->platformVersion);
439 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PLATFORMNAME)) {
440 char* platformName = NULL;
441 if(system_info_get_platform_string("tizen.org/system/platform.name", &platformName) == SYSTEM_INFO_ERROR_NONE) {
442 deviceCapabilitiesInfo->platformName = platformName;
445 LoggerE("get fail platformName value");
446 return JSValueMakeUndefined(context);
448 return convert.toJSValueRef(deviceCapabilitiesInfo->platformName);
449 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_WEBAPIVERSION)) {
450 AceSecurityStatus status = SYSTEMINFO_CHECK_ACCESS(SYSTEMINFO_FUNCTION_API_GET_CAPABILITIES);
451 TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
452 char* webApiVersion = NULL;
453 if(system_info_get_platform_string("tizen.org/feature/platform.web.api.version", &webApiVersion) == SYSTEM_INFO_ERROR_NONE) {
454 deviceCapabilitiesInfo->webApiVersion = webApiVersion;
457 LoggerE("get fail webApiVersion value");
458 return JSValueMakeUndefined(context);
460 return convert.toJSValueRef(deviceCapabilitiesInfo->webApiVersion);
461 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_NATIVEAPIVERSION)) {
462 AceSecurityStatus status = SYSTEMINFO_CHECK_ACCESS(SYSTEMINFO_FUNCTION_API_GET_CAPABILITIES);
463 TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
464 char* nativeApiVersion = NULL;
465 if(system_info_get_platform_string("tizen.org/feature/platform.native.api.version", &nativeApiVersion) == SYSTEM_INFO_ERROR_NONE) {
466 deviceCapabilitiesInfo->nativeApiVersion = nativeApiVersion;
467 free(nativeApiVersion);
469 LoggerE("get fail nativeApiVersion value");
470 return JSValueMakeUndefined(context);
472 return convert.toJSValueRef(deviceCapabilitiesInfo->nativeApiVersion);
473 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERAFRONT)) {
474 bool cameraFront = false;
475 if(system_info_get_platform_bool("tizen.org/feature/camera.front", &cameraFront) == SYSTEM_INFO_ERROR_NONE) {
476 deviceCapabilitiesInfo->cameraFront = cameraFront;
478 LoggerE("get fail cameraFront value");
479 return JSValueMakeUndefined(context);
481 return convert.toJSValueRef(deviceCapabilitiesInfo->cameraFront);
482 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERA)) {
484 if(system_info_get_platform_bool("tizen.org/feature/camera", &camera) == SYSTEM_INFO_ERROR_NONE) {
485 deviceCapabilitiesInfo->camera = camera;
487 LoggerE("get fail camera value");
488 return JSValueMakeUndefined(context);
490 return convert.toJSValueRef(deviceCapabilitiesInfo->camera);
491 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERAFRONTFLASH)) {
492 bool cameraFrontFlash = false;
493 if(system_info_get_platform_bool("tizen.org/feature/camera.front.flash", &cameraFrontFlash) == SYSTEM_INFO_ERROR_NONE) {
494 deviceCapabilitiesInfo->cameraFrontFlash = cameraFrontFlash;
496 LoggerE("get fail cameraFrontFlash value");
497 return JSValueMakeUndefined(context);
499 return convert.toJSValueRef(deviceCapabilitiesInfo->cameraFrontFlash);
500 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERABACK)) {
501 bool cameraBack = false;
502 if(system_info_get_platform_bool("tizen.org/feature/camera.back", &cameraBack) == SYSTEM_INFO_ERROR_NONE) {
503 deviceCapabilitiesInfo->cameraBack = cameraBack;
505 LoggerE("get fail cameraBack value");
506 return JSValueMakeUndefined(context);
508 return convert.toJSValueRef(deviceCapabilitiesInfo->cameraBack);
509 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERABACKFLASH)) {
510 bool cameraBackFlash = false;
511 if(system_info_get_platform_bool("tizen.org/feature/camera.back.flash", &cameraBackFlash) == SYSTEM_INFO_ERROR_NONE) {
512 deviceCapabilitiesInfo->cameraBackFlash = cameraBackFlash;
514 LoggerE("get fail cameraBackFlash value");
515 return JSValueMakeUndefined(context);
517 return convert.toJSValueRef(deviceCapabilitiesInfo->cameraBackFlash);
518 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATION)) {
519 bool location = false;
520 if(system_info_get_platform_bool("tizen.org/feature/location", &location) == SYSTEM_INFO_ERROR_NONE) {
521 deviceCapabilitiesInfo->location = location;
523 LoggerE("get fail location value");
524 return JSValueMakeUndefined(context);
526 return convert.toJSValueRef(deviceCapabilitiesInfo->location);
527 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATIONGPS)) {
528 bool locationGps = false;
529 if(system_info_get_platform_bool("tizen.org/feature/location.gps", &locationGps) == SYSTEM_INFO_ERROR_NONE) {
530 deviceCapabilitiesInfo->locationGps = locationGps;
532 LoggerE("get fail locationGps value");
533 return JSValueMakeUndefined(context);
535 return convert.toJSValueRef(deviceCapabilitiesInfo->locationGps);
536 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATIONWPS)) {
537 bool locationWps = false;
538 if(system_info_get_platform_bool("tizen.org/feature/location.wps", &locationWps) == SYSTEM_INFO_ERROR_NONE) {
539 deviceCapabilitiesInfo->locationWps = locationWps;
541 LoggerE("get fail locationWps value");
542 return JSValueMakeUndefined(context);
544 return convert.toJSValueRef(deviceCapabilitiesInfo->locationWps);
545 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MICROPHONE)) {
546 bool microphone = false;
547 if(system_info_get_platform_bool("tizen.org/feature/microphone", µphone) == SYSTEM_INFO_ERROR_NONE) {
548 deviceCapabilitiesInfo->microphone = microphone;
550 LoggerE("get fail microphone value");
551 return JSValueMakeUndefined(context);
553 return convert.toJSValueRef(deviceCapabilitiesInfo->microphone);
554 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_USBHOST)) {
555 bool usbHost = false;
556 if(system_info_get_platform_bool("tizen.org/feature/usb.host", &usbHost) == SYSTEM_INFO_ERROR_NONE) {
557 deviceCapabilitiesInfo->usbHost = usbHost;
559 LoggerE("get fail usbHost value");
560 return JSValueMakeUndefined(context);
562 return convert.toJSValueRef(deviceCapabilitiesInfo->usbHost);
563 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_USBACCESSORY)) {
564 bool usbAccessory = false;
565 if(system_info_get_platform_bool("tizen.org/feature/usb.accessory", &usbAccessory) == SYSTEM_INFO_ERROR_NONE) {
566 deviceCapabilitiesInfo->usbAccessory = usbAccessory;
568 LoggerE("get fail usbAccessory value");
569 return JSValueMakeUndefined(context);
571 return convert.toJSValueRef(deviceCapabilitiesInfo->usbAccessory);
572 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENOUTPUTRCA)) {
573 bool screenOutputRca = false;
574 if(system_info_get_platform_bool("tizen.org/feature/screen.output.rca", &screenOutputRca) == SYSTEM_INFO_ERROR_NONE) {
575 deviceCapabilitiesInfo->screenOutputRca = screenOutputRca;
577 LoggerE("get fail screenOutputRca value");
578 return JSValueMakeUndefined(context);
580 return convert.toJSValueRef(deviceCapabilitiesInfo->screenOutputRca);
581 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENOUTPUTHDMI)) {
582 bool screenOutputHdmi = false;
583 if(system_info_get_platform_bool("tizen.org/feature/screen.output.hdmi", &screenOutputHdmi) == SYSTEM_INFO_ERROR_NONE) {
584 deviceCapabilitiesInfo->screenOutputHdmi = screenOutputHdmi;
586 LoggerE("get fail screenOutputHdmi value");
587 return JSValueMakeUndefined(context);
589 return convert.toJSValueRef(deviceCapabilitiesInfo->screenOutputHdmi);
590 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PLATFORMCORECPUARCH)) {
591 bool cpuArch = false;
593 char* platformCoreCpuArch = NULL;
594 char platformCoreCpuArchFull[MAXBUFSIZE];
595 platformCoreCpuArchFull[0] = '\0';
597 if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.armv6", &cpuArch) == SYSTEM_INFO_ERROR_NONE && cpuArch == true) {
598 strcat(platformCoreCpuArchFull, "armv6");
601 if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.armv7", &cpuArch) == SYSTEM_INFO_ERROR_NONE && cpuArch == true) {
603 strcat(platformCoreCpuArchFull, " | ");
605 strcat(platformCoreCpuArchFull, "armv7");
608 if (system_info_get_platform_bool("tizen.org/feature/platform.core.cpu.arch.x86", &cpuArch) == SYSTEM_INFO_ERROR_NONE && cpuArch == true) {
610 strcat(platformCoreCpuArchFull, " | ");
612 strcat(platformCoreCpuArchFull, "x86");
615 platformCoreCpuArch = strdup(platformCoreCpuArchFull);
617 if (platformCoreCpuArch == NULL) {
618 LoggerE("get fail platformCoreCpuArch value");
619 return JSValueMakeUndefined(context);
622 deviceCapabilitiesInfo->platformCoreCpuArch = platformCoreCpuArch;
623 free(platformCoreCpuArch);
625 return convert.toJSValueRef(deviceCapabilitiesInfo->platformCoreCpuArch);
626 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PLATFORMCOREFPUARCH)) {
627 bool fpuArch = false;
629 char* platformCoreFpuArch = NULL;
630 char platformCoreFpuArchFull[MAXBUFSIZE];
631 platformCoreFpuArchFull[0] = '\0';
633 if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.sse2", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
635 strcat(platformCoreFpuArchFull, "sse2");
637 if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.sse3", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
639 strcat(platformCoreFpuArchFull, " | ");
641 strcat(platformCoreFpuArchFull, "sse3");
644 if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.ssse3", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
646 strcat(platformCoreFpuArchFull, " | ");
648 strcat(platformCoreFpuArchFull, "ssse3");
651 if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.vfpv2", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
653 strcat(platformCoreFpuArchFull, " | ");
655 strcat(platformCoreFpuArchFull, "vfpv2");
658 if (system_info_get_platform_bool("tizen.org/feature/platform.core.fpu.arch.vfpv3", &fpuArch) == SYSTEM_INFO_ERROR_NONE && fpuArch == true) {
660 strcat(platformCoreFpuArchFull, " | ");
662 strcat(platformCoreFpuArchFull, "vfpv3");
664 platformCoreFpuArch = strdup(platformCoreFpuArchFull);
666 if (platformCoreFpuArch == NULL) {
667 LoggerE("get fail platformCoreFpuArch value");
668 return JSValueMakeUndefined(context);
671 deviceCapabilitiesInfo->platformCoreCpuArch = platformCoreFpuArch;
672 free(platformCoreFpuArch);
674 return convert.toJSValueRef(deviceCapabilitiesInfo->platformCoreFpuArch);
675 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SIPVOIP)) {
676 bool sipVoip = false;
677 if(system_info_get_platform_bool("tizen.org/feature/sip.voip", &sipVoip) == SYSTEM_INFO_ERROR_NONE) {
678 deviceCapabilitiesInfo->sipVoip = sipVoip;
680 LoggerE("get fail sipVoip value");
681 return JSValueMakeUndefined(context);
683 return convert.toJSValueRef(deviceCapabilitiesInfo->sipVoip);
684 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_DUID)) {
685 return convert.toJSValueRef(deviceCapabilitiesInfo->duid);
686 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SPEECH_ROCOGNITION)) {
687 bool speechRecognition = false;
688 if(system_info_get_platform_bool("tizen.org/feature/speech.recognition", &speechRecognition) == SYSTEM_INFO_ERROR_NONE) {
689 deviceCapabilitiesInfo->speechRecognition = speechRecognition;
691 LoggerE("get fail speechRecognition value");
692 return JSValueMakeUndefined(context);
694 return convert.toJSValueRef(deviceCapabilitiesInfo->speechRecognition);
695 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SPEECH_SYNTHESIS)) {
696 bool speechSynthesis = false;
697 if(system_info_get_platform_bool("tizen.org/feature/speech.synthesis", &speechSynthesis) == SYSTEM_INFO_ERROR_NONE) {
698 deviceCapabilitiesInfo->speechSynthesis = speechSynthesis;
700 LoggerE("get fail speechSynthesis value");
701 return JSValueMakeUndefined(context);
703 return convert.toJSValueRef(deviceCapabilitiesInfo->speechSynthesis);
704 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_ACCELEROMETER)) {
705 bool accelerometer = false;
706 if(system_info_get_platform_bool("tizen.org/feature/sensor.accelerometer", &accelerometer) == SYSTEM_INFO_ERROR_NONE) {
707 deviceCapabilitiesInfo->accelerometer = accelerometer;
709 LoggerE("get fail accelerometer value");
710 return JSValueMakeUndefined(context);
712 return convert.toJSValueRef(deviceCapabilitiesInfo->accelerometer);
713 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_ACCELEROMETER_WAKEUP)) {
714 bool accelerometerWakeup = false;
715 if(system_info_get_platform_bool("tizen.org/feature/sensor.accelerometer.wakeup", &accelerometerWakeup) == SYSTEM_INFO_ERROR_NONE) {
716 deviceCapabilitiesInfo->accelerometerWakeup = accelerometerWakeup;
718 LoggerE("get fail accelerometerWakeup value");
719 return JSValueMakeUndefined(context);
721 return convert.toJSValueRef(deviceCapabilitiesInfo->accelerometerWakeup);
722 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_BAROMETER)) {
723 bool barometer = false;
724 if(system_info_get_platform_bool("tizen.org/feature/sensor.barometer", &barometer) == SYSTEM_INFO_ERROR_NONE) {
725 deviceCapabilitiesInfo->barometer = barometer;
727 LoggerE("get fail barometer value");
728 return JSValueMakeUndefined(context);
730 return convert.toJSValueRef(deviceCapabilitiesInfo->barometer);
731 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_BAROMETER_WAKEUP)) {
732 bool barometerWakeup = false;
733 if(system_info_get_platform_bool("tizen.org/feature/sensor.barometer.wakeup", &barometerWakeup) == SYSTEM_INFO_ERROR_NONE) {
734 deviceCapabilitiesInfo->barometerWakeup = barometerWakeup;
736 LoggerE("get fail barometerWakeup value");
737 return JSValueMakeUndefined(context);
739 return convert.toJSValueRef(deviceCapabilitiesInfo->barometerWakeup);
740 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_GYROSCOPE)) {
741 bool gyroscope = false;
742 if(system_info_get_platform_bool("tizen.org/feature/sensor.gyroscope", &gyroscope) == SYSTEM_INFO_ERROR_NONE) {
743 deviceCapabilitiesInfo->gyroscope = gyroscope;
745 LoggerE("get fail gyroscope value");
746 return JSValueMakeUndefined(context);
748 return convert.toJSValueRef(deviceCapabilitiesInfo->gyroscope);
749 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_GYROSCOPE_WAKEUP)) {
750 bool gyroscopeWakeup = false;
751 if(system_info_get_platform_bool("tizen.org/feature/sensor.gyroscope.wakeup", &gyroscopeWakeup) == SYSTEM_INFO_ERROR_NONE) {
752 deviceCapabilitiesInfo->gyroscopeWakeup = gyroscopeWakeup;
754 LoggerE("get fail gyroscopeWakeup value");
755 return JSValueMakeUndefined(context);
757 return convert.toJSValueRef(deviceCapabilitiesInfo->gyroscopeWakeup);
758 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MAGNETOMETER)) {
759 bool magnetometer = false;
760 if(system_info_get_platform_bool("tizen.org/feature/sensor.magnetometer", &magnetometer) == SYSTEM_INFO_ERROR_NONE) {
761 deviceCapabilitiesInfo->magnetometer = magnetometer;
763 LoggerE("get fail magnetometer value");
764 return JSValueMakeUndefined(context);
766 return convert.toJSValueRef(deviceCapabilitiesInfo->magnetometer);
767 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MAGNETOMETER_WAKEUP)) {
768 bool magnetometerWakeup = false;
769 if(system_info_get_platform_bool("tizen.org/feature/sensor.magnetometer.wakeup", &magnetometerWakeup) == SYSTEM_INFO_ERROR_NONE) {
770 deviceCapabilitiesInfo->magnetometerWakeup = magnetometerWakeup;
772 LoggerE("get fail magnetometerWakeup value");
773 return JSValueMakeUndefined(context);
775 return convert.toJSValueRef(deviceCapabilitiesInfo->magnetometerWakeup);
776 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PHOTOMETER)) {
777 bool photometer = false;
778 if(system_info_get_platform_bool("tizen.org/feature/sensor.photometer", &photometer) == SYSTEM_INFO_ERROR_NONE) {
779 deviceCapabilitiesInfo->photometer = photometer;
781 LoggerE("get fail photometer value");
782 return JSValueMakeUndefined(context);
784 return convert.toJSValueRef(deviceCapabilitiesInfo->photometer);
785 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PHOTOMETER_WAKEUP)) {
786 bool photometerWakeup = false;
787 if(system_info_get_platform_bool("tizen.org/feature/sensor.photometer.wakeup", &photometerWakeup) == SYSTEM_INFO_ERROR_NONE) {
788 deviceCapabilitiesInfo->photometerWakeup = photometerWakeup;
790 LoggerE("get fail photometerWakeup value");
791 return JSValueMakeUndefined(context);
793 return convert.toJSValueRef(deviceCapabilitiesInfo->photometerWakeup);
794 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PROXIMITY)) {
795 bool proximity = false;
796 if(system_info_get_platform_bool("tizen.org/feature/sensor.proximity", &proximity) == SYSTEM_INFO_ERROR_NONE) {
797 deviceCapabilitiesInfo->proximity = proximity;
799 LoggerE("get fail proximity value");
800 return JSValueMakeUndefined(context);
802 return convert.toJSValueRef(deviceCapabilitiesInfo->proximity);
803 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PROXIMITY_WAKEUP)) {
804 bool proximityWakeup = false;
805 if(system_info_get_platform_bool("tizen.org/feature/sensor.proximity.wakeup", &proximityWakeup) == SYSTEM_INFO_ERROR_NONE) {
806 deviceCapabilitiesInfo->proximityWakeup = proximityWakeup;
808 LoggerE("get fail proximityWakeup value");
809 return JSValueMakeUndefined(context);
811 return convert.toJSValueRef(deviceCapabilitiesInfo->proximityWakeup);
812 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TILTMETER)) {
813 bool tiltmeter = false;
814 if(system_info_get_platform_bool("tizen.org/feature/sensor.tiltmeter", &tiltmeter) == SYSTEM_INFO_ERROR_NONE) {
815 deviceCapabilitiesInfo->tiltmeter = tiltmeter;
817 LoggerE("get fail tiltmeter value");
818 return JSValueMakeUndefined(context);
820 return convert.toJSValueRef(deviceCapabilitiesInfo->tiltmeter);
821 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TILTMETER_WAKEUP)) {
822 bool tiltmeterWakeup = false;
823 if(system_info_get_platform_bool("tizen.org/feature/sensor.tiltmeter.wakeup", &tiltmeterWakeup) == SYSTEM_INFO_ERROR_NONE) {
824 deviceCapabilitiesInfo->tiltmeterWakeup = tiltmeterWakeup;
826 LoggerE("get fail tiltmeterWakeup value");
827 return JSValueMakeUndefined(context);
829 return convert.toJSValueRef(deviceCapabilitiesInfo->tiltmeterWakeup);
830 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_DATA_ENCRYPTION)) {
831 bool dataEncryption = false;
832 if(system_info_get_platform_bool("tizen.org/feature/database.encryption", &dataEncryption) == SYSTEM_INFO_ERROR_NONE) {
833 deviceCapabilitiesInfo->dataEncryption = dataEncryption;
835 LoggerE("get fail dataEncryption value");
836 return JSValueMakeUndefined(context);
838 return convert.toJSValueRef(deviceCapabilitiesInfo->dataEncryption);
839 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_GRAPHICS_ACCELERATION)) {
840 bool graphicsAcceleration = false;
841 if(system_info_get_platform_bool("tizen.org/feature/graphics.acceleration", &graphicsAcceleration) == SYSTEM_INFO_ERROR_NONE) {
842 deviceCapabilitiesInfo->graphicsAcceleration = graphicsAcceleration;
844 LoggerE("get fail graphicsAcceleration value");
845 return JSValueMakeUndefined(context);
847 return convert.toJSValueRef(deviceCapabilitiesInfo->graphicsAcceleration);
848 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PUSH)) {
850 if(system_info_get_platform_bool("tizen.org/feature/network.push", &push) == SYSTEM_INFO_ERROR_NONE) {
851 deviceCapabilitiesInfo->push = push;
853 LoggerE("get fail push value");
854 return JSValueMakeUndefined(context);
856 return convert.toJSValueRef(deviceCapabilitiesInfo->push);
857 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TELEPHONY)) {
858 bool telephony = false;
859 if(system_info_get_platform_bool("tizen.org/feature/network.telephony", &telephony) == SYSTEM_INFO_ERROR_NONE) {
860 deviceCapabilitiesInfo->telephony = telephony;
862 LoggerE("get fail telephony value");
863 return JSValueMakeUndefined(context);
865 return convert.toJSValueRef(deviceCapabilitiesInfo->telephony);
866 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TELEPHONY_MMS)) {
867 bool telephonyMms = false;
868 if(system_info_get_platform_bool("tizen.org/feature/network.telephony.mms", &telephonyMms) == SYSTEM_INFO_ERROR_NONE) {
869 deviceCapabilitiesInfo->telephonyMms = telephonyMms;
871 LoggerE("get fail telephonyMms value");
872 return JSValueMakeUndefined(context);
874 return convert.toJSValueRef(deviceCapabilitiesInfo->telephonyMms);
875 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_TELEPHONY_SMS)) {
876 bool telephonySms = false;
877 if(system_info_get_platform_bool("tizen.org/feature/network.telephony.sms", &telephonySms) == SYSTEM_INFO_ERROR_NONE) {
878 deviceCapabilitiesInfo->telephonySms = telephonySms;
880 LoggerE("get fail telephonySms value");
881 return JSValueMakeUndefined(context);
883 return convert.toJSValueRef(deviceCapabilitiesInfo->telephonySms);
884 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENSIZE_NORMAL)) {
885 bool screenSizeNormal = false;
886 if(system_info_get_platform_bool("tizen.org/feature/screen.size.normal", &screenSizeNormal) == SYSTEM_INFO_ERROR_NONE) {
887 deviceCapabilitiesInfo->screenSizeNormal = screenSizeNormal;
889 LoggerE("get fail screenSizeNormal value");
890 return JSValueMakeUndefined(context);
892 return convert.toJSValueRef(deviceCapabilitiesInfo->screenSizeNormal);
893 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENSIZE_480_800)) {
894 bool screenSize480_800 = false;
895 if(system_info_get_platform_bool("tizen.org/feature/screen.size.normal.480.800", &screenSize480_800) == SYSTEM_INFO_ERROR_NONE) {
896 deviceCapabilitiesInfo->screenSize480_800 = screenSize480_800;
898 LoggerE("get fail screenSize480_800 value");
899 return JSValueMakeUndefined(context);
901 return convert.toJSValueRef(deviceCapabilitiesInfo->screenSize480_800);
902 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENSIZE_720_1280)) {
903 bool screenSize720_1280 = false;
904 if(system_info_get_platform_bool("tizen.org/feature/screen.size.normal.720.1280", &screenSize720_1280) == SYSTEM_INFO_ERROR_NONE) {
905 deviceCapabilitiesInfo->screenSize720_1280 = screenSize720_1280;
907 LoggerE("get fail screenSize720_1280 value");
908 return JSValueMakeUndefined(context);
910 return convert.toJSValueRef(deviceCapabilitiesInfo->screenSize720_1280);
911 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_AUTO_ROTATION)) {
912 bool autoRotation = false;
913 if(system_info_get_platform_bool("tizen.org/feature/screen.auto_rotation", &autoRotation) == SYSTEM_INFO_ERROR_NONE) {
914 deviceCapabilitiesInfo->autoRotation = autoRotation;
916 LoggerE("get fail autoRotation value");
917 return JSValueMakeUndefined(context);
919 return convert.toJSValueRef(deviceCapabilitiesInfo->autoRotation);
920 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SHELL_APP_WIDGET)) {
921 bool shellAppWidget = false;
922 if(system_info_get_platform_bool("tizen.org/feature/shell.appwidget", &shellAppWidget) == SYSTEM_INFO_ERROR_NONE) {
923 deviceCapabilitiesInfo->shellAppWidget = shellAppWidget;
925 LoggerE("get fail shellAppWidget value");
926 return JSValueMakeUndefined(context);
928 return convert.toJSValueRef(deviceCapabilitiesInfo->shellAppWidget);
929 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_VISION_IMAGE_RECOGNITION)) {
930 bool visionImageRecognition = false;
931 if(system_info_get_platform_bool("tizen.org/feature/vision.image_recognition", &visionImageRecognition) == SYSTEM_INFO_ERROR_NONE) {
932 deviceCapabilitiesInfo->visionImageRecognition = visionImageRecognition;
934 LoggerE("get fail visionImageRecognition value");
935 return JSValueMakeUndefined(context);
937 return convert.toJSValueRef(deviceCapabilitiesInfo->visionImageRecognition);
938 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_VISION_QRCODE_GENERATION)) {
939 bool visionQrcodeGeneration = false;
940 if(system_info_get_platform_bool("tizen.org/feature/vision.qrcode_generation", &visionQrcodeGeneration) == SYSTEM_INFO_ERROR_NONE) {
941 deviceCapabilitiesInfo->visionQrcodeGeneration = visionQrcodeGeneration;
943 LoggerE("get fail visionQrcodeGeneration value");
944 return JSValueMakeUndefined(context);
946 return convert.toJSValueRef(deviceCapabilitiesInfo->visionQrcodeGeneration);
947 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_VISION_QRCODE_RECOGNITION)) {
948 bool visionQrcodeRecognition = false;
949 if(system_info_get_platform_bool("tizen.org/feature/vision.qrcode_recognition", &visionQrcodeRecognition) == SYSTEM_INFO_ERROR_NONE) {
950 deviceCapabilitiesInfo->visionQrcodeRecognition = visionQrcodeRecognition;
952 LoggerE("get fail visionQrcodeRecognition value");
953 return JSValueMakeUndefined(context);
955 return convert.toJSValueRef(deviceCapabilitiesInfo->visionQrcodeRecognition);
956 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_VISION_FACE_RECOGNITION)) {
957 bool visionFaceRecognition = false;
958 if(system_info_get_platform_bool("tizen.org/feature/vision.face_recognition", &visionFaceRecognition) == SYSTEM_INFO_ERROR_NONE) {
959 deviceCapabilitiesInfo->visionFaceRecognition = visionFaceRecognition;
961 LoggerE("get fail visionFaceRecognition value");
962 return JSValueMakeUndefined(context);
964 return convert.toJSValueRef(deviceCapabilitiesInfo->visionFaceRecognition);
965 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SECURE_ELEMENT)) {
966 bool secureElement = false;
967 if(system_info_get_platform_bool("tizen.org/feature/network.secure_element", &secureElement) == SYSTEM_INFO_ERROR_NONE) {
968 deviceCapabilitiesInfo->secureElement = secureElement;
970 LoggerE("get fail secureElement value");
971 return JSValueMakeUndefined(context);
973 return convert.toJSValueRef(deviceCapabilitiesInfo->secureElement);
974 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_NATIVE_OSP_COMPATIBLE)) {
975 bool nativeOspCompatible = false;
976 if(system_info_get_platform_bool("tizen.org/feature/platform.native.osp_compatible", &nativeOspCompatible) == SYSTEM_INFO_ERROR_NONE) {
977 deviceCapabilitiesInfo->nativeOspCompatible = nativeOspCompatible;
979 LoggerE("get fail nativeOspCompatible value");
980 return JSValueMakeUndefined(context);
982 return convert.toJSValueRef(deviceCapabilitiesInfo->nativeOspCompatible);
983 } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PROFILE)) {
984 deviceCapabilitiesInfo->profile = DEVICE_PROFILE;
985 return convert.toJSValueRef(deviceCapabilitiesInfo->profile);
990 LoggerE("Exception: " << _rethrown_exception.GetMessage());
991 JSWebAPIErrorFactory::postException(context, exception, JSWebAPIErrorFactory::UNKNOWN_ERROR);
993 return JSValueMakeUndefined(context);