add missing boot event status getter
authorYoung Ik Cho <youngik.cho@samsung.com>
Thu, 18 Apr 2013 10:23:41 +0000 (19:23 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Thu, 18 Apr 2013 10:23:41 +0000 (19:23 +0900)
Change-Id: Id5df74809a74a54c3aa61d55a50c6d6185b85b21
Signed-off-by: Young Ik Cho <youngik.cho@samsung.com>
src/system/FSys_RuntimeInfoImpl.cpp

index cc6e1b4..5c2222b 100644 (file)
@@ -57,6 +57,10 @@ using namespace std;
 namespace Tizen { namespace System
 {
 
+#ifndef VCONFKEY_SERVICE_READY
+#define VCONFKEY_SERVICE_READY "memory/appservice/serviceready"
+#endif
+
 static const wchar_t* _ALLOCATED_MEMORY = L"AllocatedMemory";
 static const wchar_t* _MEMORY_ALLOCATED = L"http://tizen.org/runtime/memory.allocated";
 static const wchar_t* _MEMORY_ALLOCATED_SELF = L"http://tizen.org/runtime/memory.allocated.self";
@@ -94,6 +98,11 @@ static const wchar_t* _STORAGE_ALLOCATED_EXTERNAL_VIDEO = L"http://tizen.org/run
 static const wchar_t* _STORAGE_ALLOCATED_EXTERNAL_IMAGE = L"http://tizen.org/runtime/storage.allocated.external.image";
 static const wchar_t* _STORAGE_ALLOCATED_EXTERNAL_DOWNLOAD = L"http://tizen.org/runtime/storage.allocated.external.download";
 
+static const wchar_t _BOOT_STATUS_KEY[] = L"http://tizen.org/runtime/system.status";
+static const wchar_t _BOOT_STATUS_INITIALIZING[] = L"initializing";
+static const wchar_t _BOOT_STATUS_READY[]  = L"ready";
+
+
 static const int _RUNTIME_INFO_EVENT_TYPE_INT = 101;
 static const int _RUNTIME_INFO_EVENT_TYPE_LONGLONG = 102;
 
@@ -257,7 +266,23 @@ _RuntimeInfoImpl::~_RuntimeInfoImpl(void)
 result
 _RuntimeInfoImpl::GetValue(const String& key, String& value)
 {
-       return E_OBJ_NOT_FOUND;
+       if (key == _BOOT_STATUS_KEY)
+       {
+               int bootReady = -1;
+               const int errorCode = vconf_get_int(VCONFKEY_SERVICE_READY, &bootReady);
+               if (errorCode != 0)
+               {
+                       value = (bootReady == 1 ) ? _BOOT_STATUS_READY : _BOOT_STATUS_INITIALIZING;
+
+                       return E_SUCCESS;
+               }
+
+               return E_SYSTEM;
+       }
+       else
+       {
+               return E_OBJ_NOT_FOUND;
+       }
 }
 
 result