X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FSysteminfo%2FJSDeviceCapabilitiesInfo.cpp;h=e2117d7eadf719be52092fd8633fbd66859ebe26;hb=e4137d49fcc9ca1d20434a4a6f40a795f9e84cac;hp=4bce852856793872376be600156817317a466c90;hpb=15b1975313aef7beba8259dc5e4f0e928eed9bc9;p=platform%2Fframework%2Fweb%2Fwrt-plugins-tizen.git diff --git a/src/Systeminfo/JSDeviceCapabilitiesInfo.cpp b/src/Systeminfo/JSDeviceCapabilitiesInfo.cpp index 4bce852..e2117d7 100755 --- a/src/Systeminfo/JSDeviceCapabilitiesInfo.cpp +++ b/src/Systeminfo/JSDeviceCapabilitiesInfo.cpp @@ -31,6 +31,8 @@ #define MAXBUFSIZE 256 #define DEVICE_PROFILE "MOBILE_FULL" +#define DUID_KEY_STRING 28 +#define DUID_BUFFER_SIZE 100 namespace DeviceAPI { namespace Systeminfo { @@ -682,6 +684,23 @@ JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectR } return convert.toJSValueRef(deviceCapabilitiesInfo->sipVoip); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_DUID)) { + FILE *fp = NULL; + char duid[DUID_BUFFER_SIZE] = {0,}; + fp = fopen("/opt/usr/etc/system_info_cache.ini", "r"); + + if(fp == NULL) { + LoggerD("fail file open."); + return convert.toJSValueRef(deviceCapabilitiesInfo->duid); + } + + while(fgets(duid, DUID_BUFFER_SIZE-1, fp)) { + if (strncmp(duid, "http://tizen.org/system/duid", DUID_KEY_STRING) == 0) { + LoggerD("duid : " << duid); + deviceCapabilitiesInfo->duid = duid; + break; + } + } + fclose(fp); return convert.toJSValueRef(deviceCapabilitiesInfo->duid); } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SPEECH_ROCOGNITION)) { bool speechRecognition = false;