SystemInfo refactoring
authordavid_kim31 <david_kim31@samsung.com>
Tue, 30 Jul 2013 08:48:07 +0000 (17:48 +0900)
committerdavid_kim31 <david_kim31@samsung.com>
Tue, 30 Jul 2013 08:53:48 +0000 (17:53 +0900)
Change-Id: Ibc3aeeb5923e72600ee2eabc53ff3764901ff3ed
Signed-off-by: david_kim31 <david_kim31@samsung.com>
CMakeLists.txt
inc/CommonService.h
packaging/osp-common-service.spec
src/CommonService.cpp
src/system/CMakeLists.txt
src/system/FSys_DeviceId.cpp [new file with mode: 0644]
src/system/FSys_DeviceId.h [new file with mode: 0644]
src/system/FSys_SystemInfoService.cpp [new file with mode: 0644]
src/system/FSys_SystemInfoService.h [new file with mode: 0644]

index f4cfb90..697b6c1 100644 (file)
@@ -81,6 +81,9 @@ TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw -lchromium")
 TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-uifw" )
 TARGET_LINK_LIBRARIES(${this_target} "-lutilX" )
 TARGET_LINK_LIBRARIES(${this_target} "-lecore_x" )
+TARGET_LINK_LIBRARIES(${this_target} "-lSLP-tapi" )
+TARGET_LINK_LIBRARIES(${this_target} "-lcapi-system-info" )
+TARGET_LINK_LIBRARIES(${this_target} "-lcapi-network-wifi" )
 TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp-server -losp-appfw-server")
 TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp-server -losp-system-server")
 TARGET_LINK_LIBRARIES(${this_target} "-ldl")
index e3f2f6d..05b67c8 100644 (file)
@@ -35,6 +35,7 @@ class _UiManagerStub;
 
 namespace Tizen { namespace System
 {
+class _SystemInfoService;
 class _SettingService;
 class _RuntimeInfoStub;
 class _DeviceManagerStub;
@@ -66,6 +67,7 @@ private:
 
        Tizen::App::_PackageManagerStub* __pPackageManagerStub;
        std::unique_ptr<Tizen::Ui::_UiManagerStub> __pUiManagerStub;
+       Tizen::System::_SystemInfoService* __pSystemInfoService;
        Tizen::System::_SettingService* __pSettingService;
        Tizen::System::_RuntimeInfoStub* __pRuntimeInfoStub;
        Tizen::System::_DeviceManagerStub* __pDeviceManagerStub;
index 2db575a..31eaf99 100644 (file)
@@ -7,6 +7,7 @@ License:        Apache License, Version 2.0 or Flora
 Source0:       %{name}-%{version}.tar.gz
 BuildRequires:  cmake
 BuildRequires: pkgconfig(osp-system-server)
+BuildRequires: pkgconfig(capi-system-info)
 BuildRequires: pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(chromium)
 BuildRequires: pkgconfig(capi-appfw-package-manager)
@@ -18,6 +19,7 @@ BuildRequires:        osp-uifw-internal-devel
 BuildRequires:  pkgconfig(ecore)
 BuildRequires:  pkgconfig(x11)
 BuildRequires:         pkgconfig(utilX)
+BuildRequires: pkgconfig(tapi)
 BuildRequires:  hash-signer
 
 # runtime requires
index c9f0062..01a8df2 100644 (file)
@@ -21,6 +21,7 @@
 #include "CommonService.h"
 #include "FApp_PackageManagerStub.h"
 #include "FUi_UiManagerStub.h"
+#include "system/FSys_SystemInfoService.h"
 #include "system/FSys_SettingService.h"
 #include "FSys_RuntimeInfoStub.h"
 #include "FSys_DeviceManagerStub.h"
@@ -62,7 +63,7 @@ bool
 CommonService::OnAppInitialized(void)
 {
        InitializeServices();
-       
+       __pSystemInfoService->CachingSystemInformation();
        return true;
 }
 
@@ -104,6 +105,7 @@ CommonService::InitializeServices(void)
        SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "Propagating.");
 
        __pUiManagerStub = move(pUiManagerStub);
+       __pSystemInfoService = _SystemInfoService::GetInstance();
        __pSettingService = _SettingService::GetInstance();
        __pRuntimeInfoStub = _RuntimeInfoStub::GetInstance();
 
index 5d0ae74..66daee0 100644 (file)
@@ -3,11 +3,17 @@ SET (this_target system_service)
 INCLUDE_DIRECTORIES(
        ${SLP_INCLUDE_DIRS}
        ${CMAKE_SOURCE_DIR}/inc
+       /usr/include/system
+       /usr/include/network
+       /usr/include/telephony
+       /usr/include/telephony-client
        /usr/include/osp/system-server
        ./
        )
 
 SET (${this_target}_SOURCE_FILES
+       FSys_DeviceId.cpp
+       FSys_SystemInfoService.cpp
        FSys_SettingService.cpp
        FSys_RuntimeInfoStub.cpp
        FSys_DeviceManagerStub.cpp
diff --git a/src/system/FSys_DeviceId.cpp b/src/system/FSys_DeviceId.cpp
new file mode 100644 (file)
index 0000000..e987a86
--- /dev/null
@@ -0,0 +1,403 @@
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file               FSys_DeviceId.cpp
+ * @brief              This is the implementation file for _DeviceId class.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <wifi.h>
+#include <bluetooth.h>
+
+#include <system_info.h>
+#include <telephony_network.h>
+#include <telephony-client/ITapiModem.h>
+
+#include <FSys_SystemInfoImpl.h>
+#include <FTextUtf8Encoder.h>
+#include <FTextUtf8Encoding.h>
+#include <FTextUtf8Decoder.h>
+#include <FBase_StringConverter.h>
+#include <FBaseSysLog.h>
+#include "FSys_DeviceId.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Text;
+
+namespace Tizen { namespace System
+{
+
+const int _CRYPT_KEY_SIZE = 8;
+const int _SEED_LENGTH = 15;
+const char _BLUETOOTH_ADDR[] = "/csa/bluetooth/.bd_addr";
+
+static const char BASE32_CHAR_SET[] = "abcdefghijklmnopqrstuvwxyz0123456789";
+
+static const unsigned long long int __gCrc64Table[] =
+{
+       0x0000000000000000ULL, 0x01B0000000000000ULL, 0x0360000000000000ULL, 0x02D0000000000000ULL,
+       0x06C0000000000000ULL, 0x0770000000000000ULL, 0x05A0000000000000ULL, 0x0410000000000000ULL,
+       0x0D80000000000000ULL, 0x0C30000000000000ULL, 0x0EE0000000000000ULL, 0x0F50000000000000ULL,
+       0x0B40000000000000ULL, 0x0AF0000000000000ULL, 0x0820000000000000ULL, 0x0990000000000000ULL,
+       0x1B00000000000000ULL, 0x1AB0000000000000ULL, 0x1860000000000000ULL, 0x19D0000000000000ULL,
+       0x1DC0000000000000ULL, 0x1C70000000000000ULL, 0x1EA0000000000000ULL, 0x1F10000000000000ULL,
+       0x1680000000000000ULL, 0x1730000000000000ULL, 0x15E0000000000000ULL, 0x1450000000000000ULL,
+       0x1040000000000000ULL, 0x11F0000000000000ULL, 0x1320000000000000ULL, 0x1290000000000000ULL,
+       0x3600000000000000ULL, 0x37B0000000000000ULL, 0x3560000000000000ULL, 0x34D0000000000000ULL,
+       0x30C0000000000000ULL, 0x3170000000000000ULL, 0x33A0000000000000ULL, 0x3210000000000000ULL,
+       0x3B80000000000000ULL, 0x3A30000000000000ULL, 0x38E0000000000000ULL, 0x3950000000000000ULL,
+       0x3D40000000000000ULL, 0x3CF0000000000000ULL, 0x3E20000000000000ULL, 0x3F90000000000000ULL,
+       0x2D00000000000000ULL, 0x2CB0000000000000ULL, 0x2E60000000000000ULL, 0x2FD0000000000000ULL,
+       0x2BC0000000000000ULL, 0x2A70000000000000ULL, 0x28A0000000000000ULL, 0x2910000000000000ULL,
+       0x2080000000000000ULL, 0x2130000000000000ULL, 0x23E0000000000000ULL, 0x2250000000000000ULL,
+       0x2640000000000000ULL, 0x27F0000000000000ULL, 0x2520000000000000ULL, 0x2490000000000000ULL,
+       0x6C00000000000000ULL, 0x6DB0000000000000ULL, 0x6F60000000000000ULL, 0x6ED0000000000000ULL,
+       0x6AC0000000000000ULL, 0x6B70000000000000ULL, 0x69A0000000000000ULL, 0x6810000000000000ULL,
+       0x6180000000000000ULL, 0x6030000000000000ULL, 0x62E0000000000000ULL, 0x6350000000000000ULL,
+       0x6740000000000000ULL, 0x66F0000000000000ULL, 0x6420000000000000ULL, 0x6590000000000000ULL,
+       0x7700000000000000ULL, 0x76B0000000000000ULL, 0x7460000000000000ULL, 0x75D0000000000000ULL,
+       0x71C0000000000000ULL, 0x7070000000000000ULL, 0x72A0000000000000ULL, 0x7310000000000000ULL,
+       0x7A80000000000000ULL, 0x7B30000000000000ULL, 0x79E0000000000000ULL, 0x7850000000000000ULL,
+       0x7C40000000000000ULL, 0x7DF0000000000000ULL, 0x7F20000000000000ULL, 0x7E90000000000000ULL,
+       0x5A00000000000000ULL, 0x5BB0000000000000ULL, 0x5960000000000000ULL, 0x58D0000000000000ULL,
+       0x5CC0000000000000ULL, 0x5D70000000000000ULL, 0x5FA0000000000000ULL, 0x5E10000000000000ULL,
+       0x5780000000000000ULL, 0x5630000000000000ULL, 0x54E0000000000000ULL, 0x5550000000000000ULL,
+       0x5140000000000000ULL, 0x50F0000000000000ULL, 0x5220000000000000ULL, 0x5390000000000000ULL,
+       0x4100000000000000ULL, 0x40B0000000000000ULL, 0x4260000000000000ULL, 0x43D0000000000000ULL,
+       0x47C0000000000000ULL, 0x4670000000000000ULL, 0x44A0000000000000ULL, 0x4510000000000000ULL,
+       0x4C80000000000000ULL, 0x4D30000000000000ULL, 0x4FE0000000000000ULL, 0x4E50000000000000ULL,
+       0x4A40000000000000ULL, 0x4BF0000000000000ULL, 0x4920000000000000ULL, 0x4890000000000000ULL,
+       0xD800000000000000ULL, 0xD9B0000000000000ULL, 0xDB60000000000000ULL, 0xDAD0000000000000ULL,
+       0xDEC0000000000000ULL, 0xDF70000000000000ULL, 0xDDA0000000000000ULL, 0xDC10000000000000ULL,
+       0xD580000000000000ULL, 0xD430000000000000ULL, 0xD6E0000000000000ULL, 0xD750000000000000ULL,
+       0xD340000000000000ULL, 0xD2F0000000000000ULL, 0xD020000000000000ULL, 0xD190000000000000ULL,
+       0xC300000000000000ULL, 0xC2B0000000000000ULL, 0xC060000000000000ULL, 0xC1D0000000000000ULL,
+       0xC5C0000000000000ULL, 0xC470000000000000ULL, 0xC6A0000000000000ULL, 0xC710000000000000ULL,
+       0xCE80000000000000ULL, 0xCF30000000000000ULL, 0xCDE0000000000000ULL, 0xCC50000000000000ULL,
+       0xC840000000000000ULL, 0xC9F0000000000000ULL, 0xCB20000000000000ULL, 0xCA90000000000000ULL,
+       0xEE00000000000000ULL, 0xEFB0000000000000ULL, 0xED60000000000000ULL, 0xECD0000000000000ULL,
+       0xE8C0000000000000ULL, 0xE970000000000000ULL, 0xEBA0000000000000ULL, 0xEA10000000000000ULL,
+       0xE380000000000000ULL, 0xE230000000000000ULL, 0xE0E0000000000000ULL, 0xE150000000000000ULL,
+       0xE540000000000000ULL, 0xE4F0000000000000ULL, 0xE620000000000000ULL, 0xE790000000000000ULL,
+       0xF500000000000000ULL, 0xF4B0000000000000ULL, 0xF660000000000000ULL, 0xF7D0000000000000ULL,
+       0xF3C0000000000000ULL, 0xF270000000000000ULL, 0xF0A0000000000000ULL, 0xF110000000000000ULL,
+       0xF880000000000000ULL, 0xF930000000000000ULL, 0xFBE0000000000000ULL, 0xFA50000000000000ULL,
+       0xFE40000000000000ULL, 0xFFF0000000000000ULL, 0xFD20000000000000ULL, 0xFC90000000000000ULL,
+       0xB400000000000000ULL, 0xB5B0000000000000ULL, 0xB760000000000000ULL, 0xB6D0000000000000ULL,
+       0xB2C0000000000000ULL, 0xB370000000000000ULL, 0xB1A0000000000000ULL, 0xB010000000000000ULL,
+       0xB980000000000000ULL, 0xB830000000000000ULL, 0xBAE0000000000000ULL, 0xBB50000000000000ULL,
+       0xBF40000000000000ULL, 0xBEF0000000000000ULL, 0xBC20000000000000ULL, 0xBD90000000000000ULL,
+       0xAF00000000000000ULL, 0xAEB0000000000000ULL, 0xAC60000000000000ULL, 0xADD0000000000000ULL,
+       0xA9C0000000000000ULL, 0xA870000000000000ULL, 0xAAA0000000000000ULL, 0xAB10000000000000ULL,
+       0xA280000000000000ULL, 0xA330000000000000ULL, 0xA1E0000000000000ULL, 0xA050000000000000ULL,
+       0xA440000000000000ULL, 0xA5F0000000000000ULL, 0xA720000000000000ULL, 0xA690000000000000ULL,
+       0x8200000000000000ULL, 0x83B0000000000000ULL, 0x8160000000000000ULL, 0x80D0000000000000ULL,
+       0x84C0000000000000ULL, 0x8570000000000000ULL, 0x87A0000000000000ULL, 0x8610000000000000ULL,
+       0x8F80000000000000ULL, 0x8E30000000000000ULL, 0x8CE0000000000000ULL, 0x8D50000000000000ULL,
+       0x8940000000000000ULL, 0x88F0000000000000ULL, 0x8A20000000000000ULL, 0x8B90000000000000ULL,
+       0x9900000000000000ULL, 0x98B0000000000000ULL, 0x9A60000000000000ULL, 0x9BD0000000000000ULL,
+       0x9FC0000000000000ULL, 0x9E70000000000000ULL, 0x9CA0000000000000ULL, 0x9D10000000000000ULL,
+       0x9480000000000000ULL, 0x9530000000000000ULL, 0x97E0000000000000ULL, 0x9650000000000000ULL,
+       0x9240000000000000ULL, 0x93F0000000000000ULL, 0x9120000000000000ULL, 0x9090000000000000ULL
+};
+
+
+String _DeviceId::__deviceId = "";
+
+result
+_DeviceId::GetId(Tizen::Base::String& deviceId, int type)
+{
+       int ret = 0;
+       result r = E_SUCCESS;
+
+       if(__deviceId != "")
+       {
+               deviceId = __deviceId;
+               return r;
+       }
+
+       char* pDeviceString = null;
+
+       unsigned long long tempRes = 0;
+
+       //0xCAFEBABECAFEBABE
+       const char keyValue[_CRYPT_KEY_SIZE] = {0xCA, 0xFE, 0xBA, 0xBE, 0xCA, 0xFE, 0xBA, 0xBE};
+
+       char pFirstCrypt[_SEED_LENGTH + 1] = {0,};
+       ByteBuffer crc64Input;
+       ByteBuffer crc64Result;
+       ByteBuffer base32Result;
+
+       Utf8Encoding utf8;
+
+       if(type == 0)
+       {
+               int time_count = 0;
+               int status = 0;
+               TapiHandle* handle = null;
+
+               while(time_count < 30) //Wait 30 second.
+               {
+                       if(handle == null)
+                       {
+                               handle = tel_init(null);
+                       }
+
+                       if(handle != null)
+                       {
+                               ret = tel_check_modem_power_status(handle, &status);
+                               SysLog(NID_SYS, "Modem check result is %d, status is %d.", handle, status);
+                               if(ret != TAPI_API_SUCCESS)
+                               {
+                                       tel_deinit(handle);
+                                       SysLogException(NID_SYS, E_SYSTEM, "It is failed to get IMEI.");
+                                       return E_SYSTEM;
+                               }
+
+                               if(status == 0)
+                               {
+                                       break;
+                               }
+                       }
+                       usleep(1000000);
+                       time_count++;
+               }
+
+               if(handle != null)
+               {
+                       if(status == 0)
+                       {
+                               pDeviceString = tel_get_misc_me_imei_sync(handle);
+                               tel_deinit(handle);
+                               SysTryReturnResult(NID_SYS, pDeviceString != null, E_SYSTEM, "It is failed to get IMEI");
+                       }
+                       else
+                       {
+                               tel_deinit(handle);
+                               SysLogException(NID_SYS, E_SYSTEM, "Modem is not ready to get IMEI.");
+                               return E_SYSTEM;
+                       }
+               }
+               else
+               {
+                       SysLogException(NID_SYS, E_SYSTEM, "Modem handle is not ready.");
+                       return E_SYSTEM;
+               }
+       }
+       else if(type == 1)
+       {
+               char* wifiMacAddress = null;
+               ret = wifi_get_mac_address(&wifiMacAddress);
+               SysTryReturnResult(NID_SYS, ret == WIFI_ERROR_NONE && wifiMacAddress != null, E_SYSTEM, "It is failed to get Wi-Fi MAC address.");
+
+               SysLog(NID_SYS, "Wifi Address is [%s]", wifiMacAddress);
+
+               pDeviceString = (char*)malloc(_SEED_LENGTH);
+               memset(pDeviceString, 0, _SEED_LENGTH);
+
+               char* temp = wifiMacAddress;
+               strcat(pDeviceString, "WIF");
+               for(int i = 0; i < 6; i++)
+               {
+                       strncat(pDeviceString, temp, 2);
+                       temp+=3;
+               }
+
+               free(wifiMacAddress);
+       }
+       else if(type == 2)
+       {
+               FILE* fp = null;
+               fp = fopen(_BLUETOOTH_ADDR, "r");
+               SysTryReturnResult(NID_SYS, fp!= null, E_SYSTEM, "It is failed to get Bluetooth address.");
+
+               char buffer[32] = {0,};
+               char* temp = buffer;
+               int size_of_assign = 0;
+
+               size_of_assign = fscanf(fp, "%s", temp);
+               if(size_of_assign < 4)
+               {
+                       SysLogException(NID_SYS, E_SYSTEM, "It is failed to read file. [%d]", size_of_assign);
+                       fclose(fp);
+                       return E_SYSTEM;
+               }
+               temp+=4;
+
+               size_of_assign = fscanf(fp, "%s", temp);
+               if(size_of_assign < 2)
+               {
+                       SysLogException(NID_SYS, E_SYSTEM, "It is failed to read file. [%d]", size_of_assign);
+                       fclose(fp);
+                       return E_SYSTEM;
+               }
+               temp+=2;
+
+               size_of_assign = fscanf(fp, "%s", temp);
+               if(size_of_assign < 6)
+               {
+                       SysLogException(NID_SYS, E_SYSTEM, "It is failed to read file. [%d]", size_of_assign);
+                       fclose(fp);
+                       return E_SYSTEM;
+               }
+               fclose(fp);
+
+               strupr(buffer);
+               SysLog(NID_SYS, "Bluetooth Address is [%s]", buffer);
+
+               pDeviceString = (char*)malloc(_SEED_LENGTH);
+               memset(pDeviceString, 0, _SEED_LENGTH);
+
+               strcat(pDeviceString, "BLU");
+               strcat(pDeviceString, buffer);
+       }
+       else
+       {
+               return E_SYSTEM;
+       }
+
+       int nCryptKeyCount = 0;
+       for (int i = 0; i < _SEED_LENGTH; i++)
+       {
+               pFirstCrypt[i] = (char) (((pDeviceString)[i] ^ keyValue[nCryptKeyCount]));
+               nCryptKeyCount ++;
+               if(nCryptKeyCount == _CRYPT_KEY_SIZE)
+               {
+                       nCryptKeyCount = 0;
+               }
+       }
+
+       r = crc64Input.Construct(_SEED_LENGTH);
+       SysTryCatch(NID_SYS, !IsFailed(r), r = E_SYSTEM, r, "[%s] It is failed to construct ByteBuffer", GetErrorMessage(r));
+
+       r = crc64Input.SetArray((byte*) pFirstCrypt, 0, _SEED_LENGTH);
+       SysTryCatch(NID_SYS, !IsFailed(r), r = E_SYSTEM, r, "[%s] It is failed to set array to ByteBuffer", GetErrorMessage(r));
+       crc64Input.Flip();
+
+       r = GenerateCrc64(crc64Input, tempRes);
+       SysTryCatch(NID_SYS, !IsFailed(r), r = E_SYSTEM, r, "[%s] It is failed to generate CRC64 value", GetErrorMessage(r));
+
+       r = crc64Result.Construct(sizeof(tempRes));
+       SysTryCatch(NID_SYS, !IsFailed(r), r = E_SYSTEM, r, "[%s] It is failed to construct ByteBuffer", GetErrorMessage(r));
+       r = crc64Result.SetArray((byte*) &tempRes, 0, sizeof(tempRes));
+       SysTryCatch(NID_SYS, !IsFailed(r), r = E_SYSTEM, r, "[%s] It is failed to set array to ByteBuffer", GetErrorMessage(r));
+       crc64Result.Flip();
+
+       r = Base32Encode(crc64Result, base32Result);
+       SysTryCatch(NID_SYS, !IsFailed(r), , r, "[%s] It is failed to encode as Base64", GetErrorMessage(r));
+
+       r = utf8.GetString(base32Result, __deviceId);
+       SysTryCatch(NID_SYS, !IsFailed(r), r = E_SYSTEM, r, "[%s] It is failed to convert ByteBuffer to String", GetErrorMessage(r));
+
+       deviceId = __deviceId;
+CATCH:
+       if (pDeviceString != null)
+       {
+               free(pDeviceString);
+       }
+
+       return r;
+}
+
+result
+_DeviceId::GenerateCrc64(Tizen::Base::ByteBuffer& input, unsigned long long int& value)
+{
+       result r = E_SUCCESS;
+
+       byte* pPu8 = const_cast <byte*>(input.GetPointer());
+       unsigned long long int* pCrcTable = null;
+       int inputSize = input.GetRemaining();
+
+       value = 0ULL;
+
+       pCrcTable = const_cast <unsigned long long int*> (__gCrc64Table);
+
+       while (inputSize--)
+       {
+               value = pCrcTable[(value ^ *pPu8++) & 0xff] ^ (value >> 8);
+       }
+
+       return r;
+}
+
+result
+_DeviceId::Base32Encode(Tizen::Base::ByteBuffer& input, Tizen::Base::ByteBuffer& output)
+{
+       result r = E_SUCCESS;
+
+       byte* pEncodingPointer = null;
+       byte* pSrcPointer = null;
+       byte* pStorePtr = null;
+       int i = 0;
+
+       const byte* pInputData = input.GetPointer();
+       int inputSize = input.GetRemaining();
+
+       byte* pBuffer = null;
+       int bufferLength = 0;
+
+       int pSrcSize = inputSize+1;
+
+       pSrcPointer = (byte*)malloc(sizeof(byte)*pSrcSize);
+       SysTryReturn(NID_SYS, pSrcPointer != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] It is failed to allocate memory");
+       pStorePtr = pSrcPointer;
+        memset(pSrcPointer,0,sizeof(byte)*pSrcSize);
+        memcpy(pSrcPointer,pInputData,sizeof(byte)*inputSize);
+
+       bufferLength = 8 * (inputSize / 5 + 1) + 1;
+       pBuffer = (byte*) calloc(1, bufferLength);
+       SysTryCatch(NID_SYS, pBuffer != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] It is failed to allocate memory");
+
+       pEncodingPointer = pBuffer;
+
+       for (i = 0; i < inputSize; i += 5)
+       {
+               pEncodingPointer[0] = BASE32_CHAR_SET[(pSrcPointer[0] >> 3)];
+               pEncodingPointer[1] = BASE32_CHAR_SET[((pSrcPointer[0] & 0x07) << 2) | ((pSrcPointer[1] & 0xc0) >> 6)];
+               pEncodingPointer[2] = (i + 1 < inputSize) ? BASE32_CHAR_SET[((pSrcPointer[1] & 0x3e) >> 1)] : '\0';
+               pEncodingPointer[3] = (i + 1 < inputSize) ? BASE32_CHAR_SET[((pSrcPointer[1] & 0x01) << 4) | ((pSrcPointer[2] & 0xf0) >> 4)] : '\0';
+               pEncodingPointer[4] = (i + 2 < inputSize) ? BASE32_CHAR_SET[((pSrcPointer[2] & 0x0f) << 1) | ((pSrcPointer[3] & 0x80) >> 7)] : '\0';
+               pEncodingPointer[5] = (i + 3 < inputSize) ? BASE32_CHAR_SET[((pSrcPointer[3] & 0x3e) >> 2)] : '\0';
+               pEncodingPointer[6] = (i + 3 < inputSize) ? BASE32_CHAR_SET[((pSrcPointer[3] & 0x03) << 3) | ((pSrcPointer[4] & 0xe0) >> 5)] : '\0';
+               pEncodingPointer[7] = (i + 4 < inputSize) ? BASE32_CHAR_SET[((pSrcPointer[4] & 0x1f))] : '\0';
+
+               pSrcPointer += 5;
+               pEncodingPointer += 8;
+       }
+
+       r = output.Construct(bufferLength);
+       SysTryCatch(NID_SYS, !IsFailed(r), r = E_SYSTEM, r, "[%s] It is failed to construct ByteBuffer.");
+       r = output.SetArray(pBuffer, 0, bufferLength);
+       SysTryCatch(NID_SYS, !IsFailed(r), r = E_SYSTEM, r, "[%s] It is failed to set array to ByteBuffer.");
+       output.Flip();
+
+CATCH:
+       if (pBuffer != null)
+       {
+               free(pBuffer);
+       }
+       if (pStorePtr != null)
+       {
+               free(pStorePtr);
+       }
+
+       return r;
+}
+
+}} // Tizen::System
+
diff --git a/src/system/FSys_DeviceId.h b/src/system/FSys_DeviceId.h
new file mode 100644 (file)
index 0000000..a6ca39c
--- /dev/null
@@ -0,0 +1,72 @@
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file               FSys_DeviceId.h
+ * @brief              This is the header file for _DeviceId class.
+ */
+
+
+#ifndef _FSYS_INTERNAL_DEVICE_ID_H_
+#define _FSYS_INTERNAL_DEVICE_ID_H_
+
+
+#include <FOspConfig.h>
+
+namespace Tizen { namespace Base
+{
+class String;
+class ByteBuffer;
+}}
+
+namespace Tizen { namespace System
+{
+
+
+class _DeviceId
+{
+public:
+       /**
+        * Gets device unique ID.
+        *
+        * @since   1.0
+        * @return  An error code
+        * @param[out]  deviceId          The device unique ID.
+        * @exception   E_SUCCESS         The method is successful.
+        * @exception   E_OUT_OF_MEMORY   The memory is insufficient.
+        * @exception   E_SYSTEM          A system error has occurred.
+        */
+       static result GetId(Tizen::Base::String& deviceId, int type = 0);
+
+private:
+       /**
+     * This is the default constructor for this class.
+     */
+       _DeviceId(void);
+
+       /**
+     * This is the destructor for this class.
+     */
+       ~_DeviceId(void);
+
+       static result GenerateCrc64(Tizen::Base::ByteBuffer& input, unsigned long long int& value);
+       static result Base32Encode(Tizen::Base::ByteBuffer& input, Tizen::Base::ByteBuffer& output);
+       static Tizen::Base::String __deviceId;
+}; //_DeviceId
+
+}}
+
+#endif // _FSYS_INTERNAL_DEVICE_ID_H_
diff --git a/src/system/FSys_SystemInfoService.cpp b/src/system/FSys_SystemInfoService.cpp
new file mode 100644 (file)
index 0000000..fda9663
--- /dev/null
@@ -0,0 +1,1211 @@
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file               FSys_SystemInfoService.cpp
+ * @brief              This is the implementation file for _SystemInfoService class.
+ */
+
+#include <unique_ptr.h>
+#include <sys/stat.h>
+#include <sys/utsname.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+#include <media/sound_manager.h>
+#include <system_info.h>
+
+#include <FBaseColIMapEnumerator.h>
+#include <FBaseInteger.h>
+#include <FBaseSysLog.h>
+#include <FBaseUtilStringUtil.h>
+#include <FBaseUtilStringTokenizer.h>
+#include <FIoFile.h>
+#include <FIoRegistry.h>
+#include <FIoDirectory.h>
+#include <FSysIDeviceEventListener.h>
+#include <FSysIScreenEventListener.h>
+#include <FSysIChargingEventListener.h>
+#include <FSysIBatteryEventListener.h>
+
+#include <FAppPkg_PackageManagerImpl.h>
+#include <FBase_NativeError.h>
+#include <FBase_StringConverter.h>
+#include <FIo_RegistryImpl.h>
+#include <FSys_DeviceId.h>
+#include <FSys_SystemInfoService.h>
+
+using namespace std;
+using namespace Tizen::App;
+using namespace Tizen::App::Package;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::Io;
+
+namespace Tizen { namespace System
+{
+//Camera
+static const wchar_t* _CAMERA = L"http://tizen.org/feature/camera";
+static const wchar_t* _CAMERA_BACK = L"http://tizen.org/feature/camera.back";
+static const wchar_t* _CAMERA_BACK_FLASH = L"http://tizen.org/feature/camera.back.flash";
+static const wchar_t* _CAMERA_FRONT = L"http://tizen.org/feature/camera.front";
+static const wchar_t* _CAMERA_FRONT_FLASH = L"http://tizen.org/feature/camera.front.flash";
+//Database
+static const wchar_t* _DATABASE_ENCRYPTION = L"http://tizen.org/feature/database.encryption";
+static const char* _DATABASE_LIBRARY_PATH = "/usr/lib/libsqlite3.so.0";
+static const char* _DATABASE_ENCRYPTION_SYMBOL = "sqlite3_key";
+//FM Radio
+static const wchar_t* _FMRADIO = L"http://tizen.org/feature/fmradio";
+//Graphic
+static const wchar_t* _GRAPHIC_ACCELERATION = L"http://tizen.org/feature/graphics.acceleration";
+//Input
+static const wchar_t* _INPUT_KEYBOARD = L"http://tizen.org/feature/input.keyboard";
+static const wchar_t* _INPUT_KEYBOARD_LAYOUT = L"http://tizen.org/feature/input.keyboard.layout";
+static const wchar_t* _INPUT_KEYS_BACK = L"http://tizen.org/feature/input.keys.back";
+static const wchar_t* _INPUT_KEYS_MENU = L"http://tizen.org/feature/input.keys.menu";
+//Location
+static const wchar_t* _LOCATION = L"http://tizen.org/feature/location";
+static const wchar_t* _LOCATION_GPS = L"http://tizen.org/feature/location.gps";
+static const wchar_t* _LOCATION_WPS = L"http://tizen.org/feature/location.wps";
+//Microphone
+static const wchar_t* _MICROPHONE = L"http://tizen.org/feature/microphone";
+//Multi point
+static const wchar_t* _MULTIPOINTTOUCH_PINCHZOOM = L"http://tizen.org/feature/multi_point_touch.pinch_zoom";
+static const wchar_t* _MULTIPOINTTOUCH_POINTCOUNT = L"http://tizen.org/feature/multi_point_touch.point_count";
+//Network bluetooth
+static const wchar_t* _NETWORK_BLUETOOTH = L"http://tizen.org/feature/network.bluetooth";
+//Network NFC
+static const wchar_t* _NETWORK_NFC = L"http://tizen.org/feature/network.nfc";
+static const wchar_t* _NETWORK_NFC_RESERVED_PUSH = L"http://tizen.org/feature/network.nfc.reserved_push";
+//Network push
+static const wchar_t* _NETWORK_PUSH = L"http://tizen.org/feature/network.push";
+static const wchar_t* _NETWORK_PUSH_BIN = L"/usr/bin/pushd";
+static const wchar_t* _NETWORK_SECURE_ELEMENT = L"http://tizen.org/feature/network.secure_element";
+static const wchar_t* _SECURE_ELEMENT_BIN = L"/usr/bin/smartcard-daemon";
+//Network telephony
+static const wchar_t* _NETWORK_TELEPHONY = L"http://tizen.org/feature/network.telephony";
+static const wchar_t* _NETWORK_TELEPHONY_MMS = L"http://tizen.org/feature/network.telephony.mms";
+static const wchar_t* _NETWORK_TELEPHONY_SMS = L"http://tizen.org/feature/network.telephony.sms";
+static const wchar_t* _NETWORK_TELEPHONY_SMS_CBS = L"http://tizen.org/feature/network.telephony.sms.cbs";
+static const wchar_t* _NETWORK_TELEPHONY_SERVICE_CDMA = L"http://tizen.org/feature/network.telephony.service.cdma";
+static const wchar_t* _NETWORK_TELEPHONY_SERVICE_EDGE = L"http://tizen.org/feature/network.telephony.service.edge";
+static const wchar_t* _NETWORK_TELEPHONY_SERVICE_GPRS = L"http://tizen.org/feature/network.telephony.service.gprs";
+static const wchar_t* _NETWORK_TELEPHONY_SERVICE_GSM = L"http://tizen.org/feature/network.telephony.service.gsm";
+static const wchar_t* _NETWORK_TELEPHONY_SERVICE_HSDPA = L"http://tizen.org/feature/network.telephony.service.hsdpa";
+static const wchar_t* _NETWORK_TELEPHONY_SERVICE_HSPA = L"http://tizen.org/feature/network.telephony.service.hspa";
+static const wchar_t* _NETWORK_TELEPHONY_SERVICE_HSUPA = L"http://tizen.org/feature/network.telephony.service.hsupa";
+static const wchar_t* _NETWORK_TELEPHONY_SERVICE_LTE = L"http://tizen.org/feature/network.telephony.service.lte";
+static const wchar_t* _NETWORK_TELEPHONY_SERVICE_UMTS = L"http://tizen.org/feature/network.telephony.service.umts";
+static const wchar_t* _NETWORK_TELEPHONY_SERVICE_BIN = L"/usr/bin/telephony-daemon";
+static const wchar_t* _NETWORK_TELEPHONY_MODEM_BIN = L"/boot/modem.bin";
+//Network WIFI
+static const wchar_t* _NETWORK_WIFI = L"http://tizen.org/feature/network.wifi";
+static const wchar_t* _NETWORK_WIFI_DIRECT = L"http://tizen.org/feature/network.wifi.direct";
+//Opengles
+static const wchar_t* _OPENGLES = L"http://tizen.org/feature/opengles";
+static const wchar_t* _OPENGLES_TEXTUREFORMAT_3DC = L"http://tizen.org/feature/opengles.texture_format.3dc";
+static const wchar_t* _OPENGLES_TEXTUREFORMAT_ATC = L"http://tizen.org/feature/opengles.texture_format.atc";
+static const wchar_t* _OPENGLES_TEXTUREFORMAT_ETC = L"http://tizen.org/feature/opengles.texture_format.etc";
+static const wchar_t* _OPENGLES_TEXTUREFORMAT_PTC = L"http://tizen.org/feature/opengles.texture_format.ptc";
+static const wchar_t* _OPENGLES_TEXTUREFORMAT_PVRTC = L"http://tizen.org/feature/opengles.texture_format.pvrtc";
+static const wchar_t* _OPENGLES_TEXTUREFORMAT_UTC = L"http://tizen.org/feature/opengles.texture_format.utc";
+static const wchar_t* _OPENGLES_VERSION_1_1 = L"http://tizen.org/feature/opengles.version.1_1";
+static const wchar_t* _OPENGLES_VERSION_2_0 = L"http://tizen.org/feature/opengles.version.2_0";
+//Platform core CPU
+static const wchar_t* _PLATFORM_CORE_CPU_ARCH_ARMV6 = L"http://tizen.org/feature/platform.core.cpu.arch.armv6";
+static const wchar_t* _PLATFORM_CORE_CPU_ARCH_ARMV7 = L"http://tizen.org/feature/platform.core.cpu.arch.armv7";
+static const wchar_t* _PLATFORM_CORE_CPU_ARCH_X86 = L"http://tizen.org/feature/platform.core.cpu.arch.x86";
+//Platform core FPU
+static const wchar_t* _PLATFORM_CORE_FPU_ARCH_SSE2 = L"http://tizen.org/feature/platform.core.fpu.arch.sse2";
+static const wchar_t* _PLATFORM_CORE_FPU_ARCH_SSE3 = L"http://tizen.org/feature/platform.core.fpu.arch.sse3";
+static const wchar_t* _PLATFORM_CORE_FPU_ARCH_SSSE3 = L"http://tizen.org/feature/platform.core.fpu.arch.ssse3";
+static const wchar_t* _PLATFORM_CORE_FPU_ARCH_VFPV2 = L"http://tizen.org/feature/platform.core.fpu.arch.vfpv2";
+static const wchar_t* _PLATFORM_CORE_FPU_ARCH_VFPV3 = L"http://tizen.org/feature/platform.core.fpu.arch.vfpv3";
+//Platform Version
+static const wchar_t* _PLATFORM_NATIVE_API_VERSION = L"http://tizen.org/feature/platform.native.api.version";
+static const wchar_t* _PLATFORM_NATIVE_OSP_COMPATIBLE = L"http://tizen.org/feature/platform.native.osp_compatible";
+static const wchar_t* _PLATFORM_VERSION = L"http://tizen.org/feature/platform.version";
+static const wchar_t* _PLATFORM_WEB_API_VERSION = L"http://tizen.org/feature/platform.web.api.version";
+//Screen
+static const wchar_t* _SCREEN_AUTO_ROTATION = L"http://tizen.org/feature/screen.auto_rotation";
+static const wchar_t* _SCREEN_BPP = L"http://tizen.org/feature/screen.bpp";
+static const wchar_t* _SCREEN_COORDINATE_SYSTEM_SIZE_LARGE = L"http://tizen.org/feature/screen.coordinate_system.size.large";
+static const wchar_t* _SCREEN_COORDINATE_SYSTEM_SIZE_NORMAL = L"http://tizen.org/feature/screen.coordinate_system.size.normal";
+static const wchar_t* _SCREEN_DESKTOPMODE = L"http://tizen.org/feature/screen.desktop_mode";
+static const wchar_t* _SCREEN_DPI = L"http://tizen.org/feature/screen.dpi";
+static const wchar_t* _SCREEN_HEIGHT = L"http://tizen.org/feature/screen.height";
+static const wchar_t* _SCREEN_SIZE_LARGE = L"http://tizen.org/feature/screen.size.large";
+static const wchar_t* _SCREEN_SIZE_NORMAL = L"http://tizen.org/feature/screen.size.normal";
+static const wchar_t* _SCREEN_SIZE_NORMAL_480_800 = L"http://tizen.org/feature/screen.size.normal.480.800";
+static const wchar_t* _SCREEN_SIZE_NORMAL_720_1280 = L"http://tizen.org/feature/screen.size.normal.720.1280";
+static const wchar_t* _SCREEN_WIDTH = L"http://tizen.org/feature/screen.width";
+//Screen HDMI RCA
+static const wchar_t* _SCREEN_OUTPUT_HDMI = L"http://tizen.org/feature/screen.output.hdmi";
+static const wchar_t* _SCREEN_OUTPUT_RCA = L"http://tizen.org/feature/screen.output.rca";
+//Shell
+static const wchar_t* _SHELL_APPWIDGET = L"http://tizen.org/feature/shell.appwidget";
+//Sensor
+static const wchar_t* _SENSOR_ACCELEROMETER = L"http://tizen.org/feature/sensor.accelerometer";
+static const wchar_t* _SENSOR_ACCELEROMETER_WAKEUP = L"http://tizen.org/feature/sensor.accelerometer.wakeup";
+static const wchar_t* _SENSOR_BAROMETER = L"http://tizen.org/feature/sensor.barometer";
+static const wchar_t* _SENSOR_BAROMETER_WAKEUP = L"http://tizen.org/feature/sensor.barometer.wakeup";
+static const wchar_t* _SENSOR_GYROSCOPE = L"http://tizen.org/feature/sensor.gyroscope";
+static const wchar_t* _SENSOR_GYROSCOPE_WAKEUP = L"http://tizen.org/feature/sensor.gyroscope.wakeup";
+static const wchar_t* _SENSOR_MAGNETOMETER = L"http://tizen.org/feature/sensor.magnetometer";
+static const wchar_t* _SENSOR_MAGNETOMETER_WAKEUP = L"http://tizen.org/feature/sensor.magnetometer.wakeup";
+static const wchar_t* _SENSOR_PHOTOMETER = L"http://tizen.org/feature/sensor.photometer";
+static const wchar_t* _SENSOR_PHOTOMETER_WAKEUP = L"http://tizen.org/feature/sensor.photometer.wakeup";
+static const wchar_t* _SENSOR_PROXIMITY = L"http://tizen.org/feature/sensor.proximity";
+static const wchar_t* _SENSOR_PROXIMITY_WAKEUP = L"http://tizen.org/feature/sensor.proximity.wakeup";
+static const wchar_t* _SENSOR_TILTMETER = L"http://tizen.org/feature/sensor.tiltmeter";
+static const wchar_t* _SENSOR_TILTMETER_WAKEUP = L"http://tizen.org/feature/sensor.tiltmeter.wakeup";
+//SIP VOIP
+static const wchar_t* _SIP_VOIP = L"http://tizen.org/feature/sip.voip";
+//Speech Recognition
+static const wchar_t* _SPEECH_RECOGNITION = L"http://tizen.org/feature/speech.recognition";
+static const wchar_t* _SPEECH_SYNTHESIS = L"http://tizen.org/feature/speech.synthesis";
+static const wchar_t* _TTS_LIB = L"/usr/lib/libtts.so";
+//USB
+static const wchar_t* _USB_ACCESSORY = L"http://tizen.org/feature/usb.accessory";
+static const wchar_t* _USB_CLIENT = L"http://tizen.org/feature/usb.client";
+static const wchar_t* _USB_HOST = L"http://tizen.org/feature/usb.host";
+static const wchar_t* _ACCESSORY_LIB = L"/opt/apps/aospd00043/lib/libosp-cond-accessory.so";
+//Vision
+static const wchar_t* _VISION_FACE_RECOGNITION = L"http://tizen.org/feature/vision.face_recognition";
+static const wchar_t* _VISION_IMAGE_RECOGNITION = L"http://tizen.org/feature/vision.image_recognition";
+static const wchar_t* _VISION_QRCODE_GENERATION = L"http://tizen.org/feature/vision.qrcode_generation";
+static const wchar_t* _VISION_QRCODE_RECOGNITION = L"http://tizen.org/feature/vision.qrcode_recognition";
+static const wchar_t* _AR_ENGINE_LIB = L"/usr/lib/osp/libarengine.so";
+
+static const wchar_t* _BUILD_STRING = L"http://tizen.org/system/build.string";
+//DUID
+static const wchar_t* _DUID = L"http://tizen.org/system/duid";
+//Model name
+static const wchar_t* _MODELNAME = L"http://tizen.org/system/model_name";
+//Platform name
+static const wchar_t* _PLATFORM_NAME = L"http://tizen.org/system/platform.name";
+//Sound
+static const wchar_t* _SOUND_MEDIA_VOLUME_MAX = L"http://tizen.org/system/sound.media.volume.resolution.max";
+static const wchar_t* _SOUND_NOTIFICATION_VOLUME_MAX = L"http://tizen.org/system/sound.notification.volume.resolution.max";
+static const wchar_t* _SOUND_RINGTONE_VOLUME_MAX = L"http://tizen.org/system/sound.ringtone.volume.resolution.max";
+static const wchar_t* _SOUND_SYSTEM_VOLUME_MAX = L"http://tizen.org/system/sound.system.volume.resolution.max";
+
+
+//Communication
+static const int _SYSTEM_GET_PARAM_TYPE = 1;
+static const wchar_t* _SYSTEM_GET_BOOL = L"osp.system.command.system.get.bool";
+static const wchar_t* _SYSTEM_GET_INT = L"osp.system.command.system.get.int";
+static const wchar_t* _SYSTEM_GET_STRING = L"osp.system.command.system.get.string";
+
+static const wchar_t* _SYSTEM_OK = L"osp.system.result.ok";
+static const wchar_t* _SYSTEM_OBJ_NOT_FOUND = L"osp.system.result.obj_not_found";
+static const wchar_t* _SYSTEM_ERROR = L"osp.system.result.error";
+
+static const wchar_t* _SYSTEM_CACHING_FILE = L"/opt/usr/etc/system_info_cache.ini";
+static const wchar_t* _SYSTEM_CACHING_SECTION = L"SystemInformation";
+
+static const wchar_t* _SYSTEM_CACHING_TRUE = L"true";
+static const wchar_t* _SYSTEM_CACHING_FALSE = L"false";
+
+_SystemInfoService* _SystemInfoService::__pSystemInfoService = null;
+
+_SystemInfoService::_SystemInfoService()
+{
+}
+
+_SystemInfoService::~_SystemInfoService()
+{
+}
+
+_SystemInfoService*
+_SystemInfoService::GetInstance(void)
+{
+       static pthread_once_t onceBlock = PTHREAD_ONCE_INIT;
+       if(__pSystemInfoService == null)
+       {
+               pthread_once(&onceBlock, InitSingleton);
+       }
+       return __pSystemInfoService;
+}
+
+void
+_SystemInfoService::InitSingleton(void)
+{
+       _SystemInfoService* pSystemInfoService = new (nothrow) _SystemInfoService();
+       SysTryReturnVoidResult(NID_SYS, pSystemInfoService != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+       __pSystemInfoService = pSystemInfoService;
+       atexit(DestroySingleton);
+}
+
+void
+_SystemInfoService::DestroySingleton(void)
+{
+       delete __pSystemInfoService;
+}
+
+result
+_SystemInfoService::CachingSystemInformation(void)
+{
+       Registry reg;
+       result r = E_SUCCESS;
+       String systemValue;
+
+       r = reg.Construct(_SYSTEM_CACHING_FILE, "w+");
+       SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, "It is failed to create the cache file.");
+
+       r = reg.AddSection(_SYSTEM_CACHING_SECTION);
+       SysTryReturnResult(NID_SYS, r == E_SUCCESS, r, "It is failed to create section on the cache file.");
+
+       bool bValue = false;
+       int nValue = 0;
+       String sValue;
+
+       //For improve launch performance
+       this->GetValue(_SCREEN_DPI, nValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_DPI, nValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_HEIGHT, nValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_HEIGHT, nValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_WIDTH, nValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_WIDTH, nValue);
+       reg.Flush();
+
+       this->GetValue(_CAMERA, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _CAMERA, systemValue);
+       reg.Flush();
+
+       this->GetValue(_CAMERA_BACK, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _CAMERA_BACK, systemValue);
+       reg.Flush();
+
+       this->GetValue(_CAMERA_BACK_FLASH, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _CAMERA_BACK_FLASH, systemValue);
+       reg.Flush();
+
+       this->GetValue(_CAMERA_FRONT, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _CAMERA_FRONT, systemValue);
+       reg.Flush();
+
+       this->GetValue(_CAMERA_FRONT_FLASH, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _CAMERA_FRONT_FLASH, systemValue);
+       reg.Flush();
+
+       this->GetValue(_DATABASE_ENCRYPTION, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _DATABASE_ENCRYPTION, systemValue);
+       reg.Flush();
+
+       this->GetValue(_FMRADIO, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _FMRADIO, systemValue);
+       reg.Flush();
+
+       this->GetValue(_GRAPHIC_ACCELERATION, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _GRAPHIC_ACCELERATION, systemValue);
+       reg.Flush();
+
+       this->GetValue(_INPUT_KEYBOARD, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _INPUT_KEYBOARD, systemValue);
+       reg.Flush();
+
+       this->GetValue(_INPUT_KEYBOARD_LAYOUT, sValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _INPUT_KEYBOARD_LAYOUT, sValue);
+       reg.Flush();
+
+       this->GetValue(_INPUT_KEYS_BACK, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _INPUT_KEYS_BACK, systemValue);
+       reg.Flush();
+
+       this->GetValue(_INPUT_KEYS_MENU, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _INPUT_KEYS_MENU, systemValue);
+       reg.Flush();
+
+       this->GetValue(_LOCATION, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _LOCATION, systemValue);
+       reg.Flush();
+
+       this->GetValue(_LOCATION_GPS, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _LOCATION_GPS, systemValue);
+       reg.Flush();
+
+       this->GetValue(_LOCATION_WPS, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _LOCATION_WPS, systemValue);
+       reg.Flush();
+
+       this->GetValue(_MICROPHONE, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _MICROPHONE, systemValue);
+       reg.Flush();
+
+       this->GetValue(_MULTIPOINTTOUCH_PINCHZOOM, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _MULTIPOINTTOUCH_PINCHZOOM, systemValue);
+       reg.Flush();
+
+       this->GetValue(_MULTIPOINTTOUCH_POINTCOUNT, nValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _MULTIPOINTTOUCH_POINTCOUNT, nValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_BLUETOOTH, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_BLUETOOTH, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_NFC, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_NFC, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_NFC_RESERVED_PUSH, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_NFC_RESERVED_PUSH, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_PUSH, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_PUSH, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_SECURE_ELEMENT, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_SECURE_ELEMENT, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY_MMS, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY_MMS, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY_SMS, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY_SMS, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY_SMS_CBS, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY_SMS_CBS, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY_SERVICE_CDMA, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY_SERVICE_CDMA, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY_SERVICE_EDGE, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY_SERVICE_EDGE, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY_SERVICE_GPRS, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY_SERVICE_GPRS, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY_SERVICE_GSM, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY_SERVICE_GSM, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY_SERVICE_HSDPA, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY_SERVICE_HSDPA, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY_SERVICE_HSPA, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY_SERVICE_HSPA, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY_SERVICE_HSUPA, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY_SERVICE_HSUPA, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY_SERVICE_LTE, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY_SERVICE_LTE, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_TELEPHONY_SERVICE_UMTS, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_TELEPHONY_SERVICE_UMTS, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_WIFI, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_WIFI, systemValue);
+       reg.Flush();
+
+       this->GetValue(_NETWORK_WIFI_DIRECT, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _NETWORK_WIFI_DIRECT, systemValue);
+       reg.Flush();
+
+       this->GetValue(_OPENGLES, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _OPENGLES, systemValue);
+       reg.Flush();
+
+       this->GetValue(_OPENGLES_TEXTUREFORMAT_3DC, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _OPENGLES_TEXTUREFORMAT_3DC, systemValue);
+       reg.Flush();
+
+       this->GetValue(_OPENGLES_TEXTUREFORMAT_ATC, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _OPENGLES_TEXTUREFORMAT_ATC, systemValue);
+       reg.Flush();
+
+       this->GetValue(_OPENGLES_TEXTUREFORMAT_ETC, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _OPENGLES_TEXTUREFORMAT_ETC, systemValue);
+       reg.Flush();
+
+       this->GetValue(_OPENGLES_TEXTUREFORMAT_PTC, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _OPENGLES_TEXTUREFORMAT_PTC, systemValue);
+       reg.Flush();
+
+       this->GetValue(_OPENGLES_TEXTUREFORMAT_PVRTC, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _OPENGLES_TEXTUREFORMAT_PVRTC, systemValue);
+       reg.Flush();
+
+       this->GetValue(_OPENGLES_TEXTUREFORMAT_UTC, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _OPENGLES_TEXTUREFORMAT_UTC, systemValue);
+       reg.Flush();
+
+       this->GetValue(_OPENGLES_VERSION_1_1, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _OPENGLES_VERSION_1_1, systemValue);
+       reg.Flush();
+
+       this->GetValue(_OPENGLES_VERSION_2_0, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _OPENGLES_VERSION_2_0, systemValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_CORE_CPU_ARCH_ARMV6, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_CORE_CPU_ARCH_ARMV6, systemValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_CORE_CPU_ARCH_ARMV7, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_CORE_CPU_ARCH_ARMV7, systemValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_CORE_CPU_ARCH_X86, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_CORE_CPU_ARCH_X86, systemValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_CORE_FPU_ARCH_SSE2, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_CORE_FPU_ARCH_SSE2, systemValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_CORE_FPU_ARCH_SSE3, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_CORE_FPU_ARCH_SSE3, systemValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_CORE_FPU_ARCH_SSSE3, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_CORE_FPU_ARCH_SSSE3, systemValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_CORE_FPU_ARCH_VFPV2, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_CORE_FPU_ARCH_VFPV2, systemValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_CORE_FPU_ARCH_VFPV3, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_CORE_FPU_ARCH_VFPV3, systemValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_NATIVE_API_VERSION, sValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_NATIVE_API_VERSION, sValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_NATIVE_OSP_COMPATIBLE, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_NATIVE_OSP_COMPATIBLE, systemValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_VERSION, sValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_VERSION, sValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_WEB_API_VERSION, sValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_WEB_API_VERSION, sValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_AUTO_ROTATION, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_AUTO_ROTATION, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_BPP, nValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_BPP, nValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_COORDINATE_SYSTEM_SIZE_LARGE, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_COORDINATE_SYSTEM_SIZE_LARGE, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_COORDINATE_SYSTEM_SIZE_NORMAL, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_COORDINATE_SYSTEM_SIZE_NORMAL, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_DESKTOPMODE, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_DESKTOPMODE, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_SIZE_LARGE, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_SIZE_LARGE, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_SIZE_NORMAL, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_SIZE_NORMAL, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_SIZE_NORMAL_480_800, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_SIZE_NORMAL_480_800, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_SIZE_NORMAL_720_1280, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_SIZE_NORMAL_720_1280, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_OUTPUT_HDMI, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_OUTPUT_HDMI, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SCREEN_OUTPUT_RCA, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SCREEN_OUTPUT_RCA, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SHELL_APPWIDGET, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SHELL_APPWIDGET, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_ACCELEROMETER, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_ACCELEROMETER, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_ACCELEROMETER_WAKEUP, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_ACCELEROMETER_WAKEUP, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_BAROMETER, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_BAROMETER, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_BAROMETER_WAKEUP, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_BAROMETER_WAKEUP, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_GYROSCOPE, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_GYROSCOPE, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_GYROSCOPE_WAKEUP, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_GYROSCOPE_WAKEUP, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_MAGNETOMETER, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_MAGNETOMETER, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_MAGNETOMETER_WAKEUP, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_MAGNETOMETER_WAKEUP, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_PHOTOMETER, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_PHOTOMETER, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_PHOTOMETER_WAKEUP, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_PHOTOMETER_WAKEUP, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_PROXIMITY, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_PROXIMITY, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_PROXIMITY_WAKEUP, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_PROXIMITY_WAKEUP, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_TILTMETER, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_TILTMETER, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SENSOR_TILTMETER_WAKEUP, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SENSOR_TILTMETER_WAKEUP, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SIP_VOIP, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SIP_VOIP, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SPEECH_RECOGNITION, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SPEECH_RECOGNITION, systemValue);
+       reg.Flush();
+
+       this->GetValue(_SPEECH_SYNTHESIS, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SPEECH_SYNTHESIS, systemValue);
+       reg.Flush();
+
+       this->GetValue(_USB_ACCESSORY, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _USB_ACCESSORY, systemValue);
+       reg.Flush();
+
+       this->GetValue(_USB_CLIENT, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _USB_CLIENT, systemValue);
+       reg.Flush();
+
+       this->GetValue(_USB_HOST, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _USB_HOST, systemValue);
+       reg.Flush();
+
+       this->GetValue(_VISION_FACE_RECOGNITION, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _VISION_FACE_RECOGNITION, systemValue);
+       reg.Flush();
+
+       this->GetValue(_VISION_IMAGE_RECOGNITION, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _VISION_IMAGE_RECOGNITION, systemValue);
+       reg.Flush();
+
+       this->GetValue(_VISION_QRCODE_GENERATION, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _VISION_QRCODE_GENERATION, systemValue);
+       reg.Flush();
+
+       this->GetValue(_VISION_QRCODE_RECOGNITION, bValue);
+       if(bValue == true)
+               systemValue = _SYSTEM_CACHING_TRUE;
+       else
+               systemValue = _SYSTEM_CACHING_FALSE;
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _VISION_QRCODE_RECOGNITION, systemValue);
+       reg.Flush();
+
+       this->GetValue(_BUILD_STRING, systemValue);
+       reg.Flush();
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _BUILD_STRING, systemValue);
+       reg.Flush();
+
+       r = this->GetValue(_DUID, sValue);
+       if(r != E_SUCCESS)
+       {
+               sValue.Append(L"ERROR");
+       }
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _DUID, sValue);
+       reg.Flush();
+
+       this->GetValue(_MODELNAME, sValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _MODELNAME, sValue);
+       reg.Flush();
+
+       this->GetValue(_PLATFORM_NAME, sValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _PLATFORM_NAME, sValue);
+       reg.Flush();
+
+       this->GetValue(_SOUND_MEDIA_VOLUME_MAX, nValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SOUND_MEDIA_VOLUME_MAX, nValue);
+       reg.Flush();
+
+       this->GetValue(_SOUND_NOTIFICATION_VOLUME_MAX, nValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SOUND_NOTIFICATION_VOLUME_MAX, nValue);
+       reg.Flush();
+
+       this->GetValue(_SOUND_RINGTONE_VOLUME_MAX, nValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SOUND_RINGTONE_VOLUME_MAX, nValue);
+       reg.Flush();
+
+       this->GetValue(_SOUND_SYSTEM_VOLUME_MAX, nValue);
+       reg.AddValue(_SYSTEM_CACHING_SECTION, _SOUND_SYSTEM_VOLUME_MAX, nValue);
+       reg.Flush();
+
+       return E_SUCCESS;
+}
+
+result
+_SystemInfoService::GetValue(const String& key, String& value)
+{
+       int ret = 0;
+       result r = E_SUCCESS;
+       char* pValue = null;
+
+       SysLog(NID_SYS, "Request Key is %ls.", key.GetPointer());
+       if (key == _DUID)
+       {
+               bool supported = false;
+               SysLog(NID_SYS, "It trys to get DUID from telephony.");
+               this->GetValue(_NETWORK_TELEPHONY, supported);
+               if(supported == true)
+               {
+                       r = _DeviceId::GetId(value, 0);
+               }
+               else
+               {
+                       SysLog(NID_SYS, "It trys to get DUID from wifi.");
+                       this->GetValue(_NETWORK_WIFI, supported);
+                       if(supported == true)
+                       {
+                               r = _DeviceId::GetId(value, 1);
+                       }
+                       else
+                       {
+                               SysLog(NID_SYS, "It trys to get DUID from bluetooth.");
+                               this->GetValue(_NETWORK_BLUETOOTH, supported);
+                               if(supported == true)
+                               {
+                                       r = _DeviceId::GetId(value, 2);
+                               }
+                               else
+                               {
+                                       SysLogException(NID_SYS, E_SYSTEM, "It is failed to get telephony, wifi, bluetooth information.");
+                                       return E_SYSTEM;
+                               }
+                       }
+               }
+               SysTryReturnResult(NID_SYS, r == E_SUCCESS, E_SYSTEM, "It is failed to get the key[%ls]", key.GetPointer());
+       }
+       else if (key == _MODELNAME)
+       {
+               ret = system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &pValue);
+               SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE && pValue, E_SYSTEM, "It is failed to get the SYSTEM_INFO_KEY_MODEL");
+
+               r = StringUtil::Utf8ToString(pValue, value);
+               SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, r, "[%s] StringUtil::Utf8ToString It is failed", GetErrorMessage(r));
+       }
+       else if (key == _BUILD_STRING)
+       {
+               ret = system_info_get_value_string(SYSTEM_INFO_KEY_BUILD_STRING, &pValue);
+               SysTryReturnResult(NID_SYS, ret == SYSTEM_INFO_ERROR_NONE, E_SYSTEM, "[E_SYSTEM] system_info_get_value_string : \"SYSTEM_INFO_KEY_TIZEN_VERSION_STRING\"It is failed");
+
+               r = StringUtil::Utf8ToString(pValue, value);
+               SysTryCatch(NID_SYS, r == E_SUCCESS, r = E_SYSTEM, r, "[%s] StringUtil::Utf8ToString It is failed", GetErrorMessage(r));
+       }
+       else
+       {
+               String tizenKey;
+               key.SubString(7, tizenKey);
+
+               ClearLastResult();
+               unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tizenKey));
+               r = GetLastResult();
+               SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r));
+               int ret = system_info_get_platform_string(systemKey.get(), &pValue);
+
+               SysTryReturnResult(NID_SYS, ret == 0, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", key.GetPointer());
+
+               r = StringUtil::Utf8ToString(pValue, value);
+               free(pValue);
+               pValue = null;
+
+               return r;
+       }
+
+CATCH:
+       if(pValue != null)
+       {
+               free(pValue);
+       }
+
+       return r;
+
+}
+
+result
+_SystemInfoService::GetValue(const String& key, int& value)
+{
+       int ret = 0;
+       result r = E_SUCCESS;
+
+       SysLog(NID_SYS, "Request Key is %ls.", key.GetPointer());
+
+       String tizenKey;
+       key.SubString(7, tizenKey);
+
+       ClearLastResult();
+       unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tizenKey));
+       r = GetLastResult();
+       SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r));
+       ret = system_info_get_platform_int(systemKey.get(), &value);
+
+       SysTryReturnResult(NID_SYS, ret == 0, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", key.GetPointer());
+       r = E_SUCCESS;
+
+       return r;
+}
+
+result
+_SystemInfoService::GetValue(const String& key, bool& value)
+{
+       int ret = 0;
+       result r = E_SUCCESS;
+
+       SysLog(NID_SYS, "Request Key is %ls.", key.GetPointer());
+
+       if (key == _SCREEN_DESKTOPMODE)
+       {
+               value = false;
+       }
+       else if (key == _USB_CLIENT)
+       {
+               value = true;
+       }
+       else
+       {
+               String tizenKey;
+               key.SubString(7, tizenKey);
+
+               ClearLastResult();
+               unique_ptr< char[] > systemKey(_StringConverter::CopyToCharArrayN(tizenKey));
+               r = GetLastResult();
+               SysTryReturn(NID_SYS, r == E_SUCCESS, E_SYSTEM, r, "[%s] StringUtil::StringToUtf8N It is failed", GetErrorMessage(r));
+
+               bool supported = false;
+               ret = system_info_get_platform_bool(systemKey.get(), &supported);
+               SysTryReturnResult(NID_SYS, ret == 0, E_OBJ_NOT_FOUND, "It is failed to get system information %ls from configration file.", key.GetPointer());
+               value = supported;
+       }
+
+       return E_SUCCESS;
+}
+} } // Tizen::System
diff --git a/src/system/FSys_SystemInfoService.h b/src/system/FSys_SystemInfoService.h
new file mode 100644 (file)
index 0000000..a3b5f62
--- /dev/null
@@ -0,0 +1,66 @@
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file               FSys_SystemInfo.h
+ * @brief              This is the header file for the _SystemInfo class.
+ */
+
+#ifndef _FSYS_SERVICE_SYS_INFO_SERVICE_H_
+#define _FSYS_SERVICE_SYS_INFO_SERVICE_H_
+
+#include <FApp.h>
+#include <FBaseResult.h>
+#include <FSysDeviceManager.h>
+#include <FBaseString.h>
+#include <FBaseColHashMap.h>
+#include <FBaseUuId.h>
+#include <FBaseColIList.h>
+#include <FSysSystemInfo.h>
+
+//#include <system_info.h>
+//#include <device.h>
+//#include <pthread.h>
+
+namespace Tizen { namespace System
+{
+
+class _SystemInfoService
+{
+private:
+       _SystemInfoService();
+       ~_SystemInfoService();
+       static void InitSingleton(void);
+       static void DestroySingleton(void);
+
+public:
+       static _SystemInfoService* GetInstance(void);
+
+public:
+       result CachingSystemInformation(void);
+
+       result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
+
+       result GetValue(const Tizen::Base::String& key, int& value);
+
+       result GetValue(const Tizen::Base::String& key, bool& value);
+private:
+       static _SystemInfoService*                      __pSystemInfoService;
+};
+
+} } // Tizen::System
+
+#endif  // _FSYS_SERVICE_SYS_INFO_SERVICE_H_