Add duid cache feature
authorJoohyun Kim <joohyune.kim@samsung.com>
Wed, 12 Jun 2013 13:50:02 +0000 (22:50 +0900)
committerJoohyun Kim <joohyune.kim@samsung.com>
Wed, 12 Jun 2013 13:50:02 +0000 (22:50 +0900)
Change-Id: Ic6730116faf79472abbc3885eab7128173ce4edf
Signed-off-by: Joohyun Kim <joohyune.kim@samsung.com>
src/system/FSys_DeviceId.cpp
src/system/FSys_SystemInfo.cpp

index 6f384c8..5f4be61 100644 (file)
@@ -150,20 +150,22 @@ _DeviceId::GetId(Tizen::Base::String& deviceId, int type)
                int time_count = 0;
                int status = 0;
                TapiHandle* handle = null;
-               handle = tel_init(null);
-               SysTryReturnResult(NID_SYS, handle != null, E_SYSTEM, "It is failed to init TAPI.");
-
+               
                while(time_count < 30) //Wait 30 second.
                {
-                       ret = tel_check_modem_power_status(handle, &status);
-                       SysLog(NID_SYS, "Modem check result is %d, status is %d.", handle, status);
-                       SysTryReturnResult(NID_SYS, ret == TAPI_API_SUCCESS, E_SYSTEM,  "It is failed to get Modem status.");
+                       handle = tel_init(null);
 
-                       if(status == 0)
+                       if(handle != null)
                        {
-                               break;
+                               ret = tel_check_modem_power_status(handle, &status);
+                               SysLog(NID_SYS, "Modem check result is %d, status is %d.", handle, status);
+                               SysTryReturnResult(NID_SYS, ret == TAPI_API_SUCCESS, E_SYSTEM,  "It is failed to get Modem status.");
+
+                               if(status == 0)
+                               {
+                                       break;
+                               }
                        }
-
                        usleep(1000000);
                        time_count++;
                }
index 6434adc..4582dc2 100644 (file)
@@ -420,10 +420,6 @@ _SystemInfo::CachingSystemInformation(void)
        reg.AddValue(_SYSTEM_CACHING_SECTION, _MICROPHONE, systemValue);
        reg.Flush();
 
-       this->GetValue(_MODELNAME, sValue);
-       reg.AddValue(_SYSTEM_CACHING_SECTION, _MODELNAME, sValue);
-       reg.Flush();
-
        this->GetValue(_MULTIPOINTTOUCH_POINTCOUNT, nValue);
        reg.AddValue(_SYSTEM_CACHING_SECTION, _MULTIPOINTTOUCH_POINTCOUNT, nValue);
        reg.Flush();
@@ -1039,6 +1035,18 @@ _SystemInfo::CachingSystemInformation(void)
        reg.AddValue(_SYSTEM_CACHING_SECTION, _SECURE_ELEMENT, systemValue);
        reg.Flush();
 
+       this->GetValue(_MODELNAME, sValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _MODELNAME, sValue);
+       reg.Flush();
+
+       r = this->GetValue(_DUID, sValue);
+       if(r != E_SUCCESS)
+       {
+               sValue.Append(L"ERROR");
+       }
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _DUID, sValue);
+       reg.Flush();
+
        return E_SUCCESS;
 }