wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Notification / NotificationManager.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 74606fc..a0121cd
@@ -47,7 +47,7 @@ static bool notification_package_equal(notification_h handle)
                return false;   
        }
 
-       LogDebug("handle package=" << handle_package);
+       LoggerD("handle package=" << handle_package);
        
         if (app_get_package(&package))
         {
@@ -72,7 +72,7 @@ static bool notification_package_equal(notification_h handle)
                 cmdline[ret] = 0;
                 close(fd);
 
-               LogDebug("package=" << package);
+               LoggerD("package=" << package);
                
                 if (strlen(cmdline) == strlen(handle_package))
                 {
@@ -84,7 +84,7 @@ static bool notification_package_equal(notification_h handle)
         }
         else
         {
-               LogDebug("package=" << package);
+               LoggerD("package=" << package);
                        
                 if (strlen(package) == strlen(handle_package))
                 {
@@ -112,10 +112,10 @@ int NotificationManager::post(StatusNotification *notification)
 
        if ( notification )
        {
-               LogInfo(" notification id = " << notification->getID());
+               LoggerI(" notification id = " << notification->getID());
                notification_h handle = (notification_h)notification->getNotificationHandle();
 
-               LogInfo("notification hanel :" << handle);
+               LoggerI("notification hanel :" << handle);
 
                if ( handle )
                {
@@ -135,13 +135,13 @@ int NotificationManager::post(StatusNotification *notification)
                                {
                                        if (notification->getLaunchFlag())
                                        {
-                                               LogInfo("Notification Launch Flag True");
+                                               LoggerI("Notification Launch Flag True");
                                                notification_set_property(handle, 0);
                                                notification_set_execute_option(handle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data);
                                        }
                                        else
                                        {
-                                               LogInfo("Notification Launch Flag False");
+                                               LoggerI("Notification Launch Flag False");
                                                notification_set_property(handle, NOTIFICATION_PROP_DISABLE_APP_LAUNCH);
                                        }
                                        
@@ -180,9 +180,9 @@ int NotificationManager::post(StatusNotification *notification)
                                }
                        }
  
-                       LogDebug(" Layout type = " << noti_layout);
+                       LoggerD(" Layout type = " << noti_layout);
                        ret = notification_set_layout(handle, noti_layout);
-                       LogDebug("set Layout result= " << ret);
+                       LoggerD("set Layout result= " << ret);
 
                        int privID = -1;
                        
@@ -190,7 +190,7 @@ int NotificationManager::post(StatusNotification *notification)
                        if (NOTIFICATION_ERROR_NONE == ret)
                        {
                                id = privID;
-                               LogDebug("private ID : " << privID);
+                               LoggerD("private ID : " << privID);
                                notification->setUpdatedFlag(false);
                        }
                        else
@@ -207,21 +207,21 @@ int NotificationManager::post(StatusNotification *notification)
                                {
                                        throw UnknownException("get notification size error");
                                }
-                               LogInfo("get Size : " << value);
+                               LoggerI("get Size : " << value);
                                notification_update_size(handle, NOTIFICATION_PRIV_ID_NONE, value);
                                
                                if (notification_get_progress(handle, &value) != NOTIFICATION_ERROR_NONE)
                                {
                                        throw UnknownException("get notification percentage error");
                                }
-                               LogInfo("get Percentage : " << value);
+                               LoggerI("get Percentage : " << value);
                                notification_update_progress(handle, NOTIFICATION_PRIV_ID_NONE, value);
                        }
 
                }
                else
                {
-                       LogDebug("it has not notification handle.");
+                       LoggerD("it has not notification handle.");
                        throw UnknownException("It is Empty Notification.");
                }
        }
@@ -236,33 +236,33 @@ void NotificationManager::update(StatusNotification *notification)
 {
        if (notification)
        {
-               LogDebug(" notification id = " << notification->getID());
+               LoggerD(" notification id = " << notification->getID());
                notification_h handle = (notification_h)notification->getNotificationHandle();
                
-               LogDebug("handle = " << handle);
+               LoggerD("handle = " << handle);
                
                if (handle)
                {
-                       LogDebug(" noti type = " << notification->getNotiType());
+                       LoggerD(" noti type = " << notification->getNotiType());
                        if ( notification->getNotiType() == NOTI_TYPE_PROGRESS)
                        {
                                int ret = 0;
-                               LogDebug(" progress type = " << notification->getProgressType());
-                               LogDebug(" noti id = " << notification->getID());
-                               LogDebug(" noti progress value = " << notification->getProgressValue());
+                               LoggerD(" progress type = " << notification->getProgressType());
+                               LoggerD(" noti id = " << notification->getID());
+                               LoggerD(" noti progress value = " << notification->getProgressValue());
 
                                if (  NOTI_PROGRESS_TYPE_PERCENTAGE == notification->getProgressType() )
                                {
-                                       LogDebug( " Percentage ");
+                                       LoggerD( " Percentage ");
                                        ret = notification_update_progress(handle, NOTIFICATION_PRIV_ID_NONE, notification->getProgressValue());
                                }
                                else if ( NOTI_PROGRESS_TYPE_SIZE == notification->getProgressType())
                                {
-                                       LogDebug( " size ");
+                                       LoggerD( " size ");
                                        ret = notification_update_size(handle, NOTIFICATION_PRIV_ID_NONE, notification->getProgressValue());
                                }
                                                        
-                               LogDebug(" notification_update_progress = " << ret);
+                               LoggerD(" notification_update_progress = " << ret);
 
                                if (NOTIFICATION_ERROR_NONE != ret)
                                {
@@ -278,7 +278,7 @@ void NotificationManager::update(StatusNotification *notification)
                
                        }
                        
-                       LogDebug(" updated Flag = " << notification->getUpdatedFlag());
+                       LoggerD(" updated Flag = " << notification->getUpdatedFlag());
                        
                        if ( notification->getUpdatedFlag())
                        {
@@ -313,9 +313,9 @@ void NotificationManager::update(StatusNotification *notification)
                                        }
                                }
         
-                               LogDebug(" Layout type = " << noti_layout);
+                               LoggerD(" Layout type = " << noti_layout);
                                int ret = notification_set_layout(handle, noti_layout);
-                               LogDebug("set Layout result= " << ret);
+                               LoggerD("set Layout result= " << ret);
 
                                
                                bundle *service_data = NULL;
@@ -331,13 +331,13 @@ void NotificationManager::update(StatusNotification *notification)
                                        {
                                                if (notification->getLaunchFlag())
                                                {
-                                                       LogInfo("Notification Launch Flag True");
+                                                       LoggerI("Notification Launch Flag True");
                                                        notification_set_property(handle, 0);
                                                        notification_set_execute_option(handle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data);
                                                }
                                                else
                                                {
-                                                       LogInfo("Notification Launch Flag False");
+                                                       LoggerI("Notification Launch Flag False");
                                                        notification_set_property(handle, NOTIFICATION_PROP_DISABLE_APP_LAUNCH);
                                                }
                                                
@@ -346,9 +346,9 @@ void NotificationManager::update(StatusNotification *notification)
 
                                notification->setLaunchFlag(false);
                                                        
-                               LogDebug(" get Title = " << notification->getTitle());
+                               LoggerD(" get Title = " << notification->getTitle());
                                ret = notification_update(handle);
-                               LogDebug(" notification_update = " << ret);
+                               LoggerD(" notification_update = " << ret);
                                notification->setUpdatedFlag(false);    //init
                                
                                if (ret != NOTIFICATION_ERROR_NONE)
@@ -356,18 +356,18 @@ void NotificationManager::update(StatusNotification *notification)
                                        throw UnknownException("Notification Object update fail, Error Code : ");
                                }
                                
-                               LogDebug(" get Title = " << notification->getTitle());
+                               LoggerD(" get Title = " << notification->getTitle());
                        }
                }
                else
                {
-                       LogDebug("it has not notification handle.");
+                       LoggerD("it has not notification handle.");
                        throw UnknownException("It is Empty Notification.");
                }
        }
        else
        {       
-               LogDebug(" INotification is NULL");
+               LoggerD(" INotification is NULL");
                throw UnknownException("Notificaton Error.");
        }
    
@@ -378,7 +378,7 @@ void NotificationManager::remove(std::string id)
        int ret = 0;
        bool existFalg = false;
        
-       LogDebug("id : " << id);
+       LoggerD("id : " << id);
        std::istringstream stream(id);
        if (stream.fail())
        {
@@ -393,7 +393,7 @@ void NotificationManager::remove(std::string id)
        
        if (notification_get_grouping_list( NOTIFICATION_TYPE_NONE , -1, &noti_list))
        {
-               LogDebug(" get notification list failed...");
+               LoggerD(" get notification list failed...");
                throw UnknownException("Can't get noti list");
        }
 
@@ -406,7 +406,7 @@ void NotificationManager::remove(std::string id)
                {
                        int noti_priv = -1;
                        notification_get_id(noti, NULL, &noti_priv);
-                       LogDebug(" notification id = " << noti_priv);
+                       LoggerD(" notification id = " << noti_priv);
                        if (noti_priv == privID)
                                existFalg = true;
                }
@@ -416,13 +416,13 @@ void NotificationManager::remove(std::string id)
        if (noti_list)
                notification_free_list(noti_list);      
        
-       LogDebug(" notification ID : "<< privID);
+       LoggerD(" notification ID : "<< privID);
 
        if ( !existFalg )
                throw NotFoundException("not exist id");
        
        ret = notification_delete_by_priv_id(NULL, NOTIFICATION_TYPE_NONE, privID);
-       LogDebug("ret = " << ret);
+       LoggerD("ret = " << ret);
        if (ret != NOTIFICATION_ERROR_NONE)
        {
                if (ret == NOTIFICATION_ERROR_NOT_EXIST_ID)
@@ -450,7 +450,7 @@ StatusNotification* NotificationManager::get(std::string id)
 {
        int privID = 0;
 
-       LogDebug("id : " << id);
+       LoggerD("id : " << id);
        std::istringstream stream(id);
        if (stream.fail())
        {
@@ -463,7 +463,7 @@ StatusNotification* NotificationManager::get(std::string id)
 }
 std::vector<StatusNotification*> NotificationManager::getAll()
 {
-       LogDebug("OK");
+       LoggerD("OK");
        std::vector<StatusNotification*> data;
 
         notification_h noti = NULL;
@@ -472,7 +472,7 @@ std::vector<StatusNotification*> NotificationManager::getAll()
 
        if (notification_get_grouping_list( NOTIFICATION_TYPE_NONE , -1, &noti_list))
        {
-               LogDebug(" get notification list failed...");
+               LoggerD(" get notification list failed...");
                throw UnknownException("Can't get noti list");
        }
 
@@ -485,12 +485,12 @@ std::vector<StatusNotification*> NotificationManager::getAll()
                {
                        int noti_priv = -1;
                        notification_get_id(noti, NULL, &noti_priv);
-                       LogDebug(" notification id = " << noti_priv);
+                       LoggerD(" notification id = " << noti_priv);
                        
                        StatusNotification* notification = new StatusNotification(noti_priv);
 
                        notification_get_id((notification_h)notification->getNotificationHandle(), NULL, &noti_priv);
-                       LogDebug("loaded notification id = " << noti_priv);
+                       LoggerD("loaded notification id = " << noti_priv);
                        
                        data.push_back(notification);                           
                        
@@ -510,12 +510,12 @@ std::vector<StatusNotification*> NotificationManager::getAll()
                {
                        int noti_priv = -1;
                        notification_get_id(noti, NULL, &noti_priv);
-                       LogDebug(" notification id = " << noti_priv);
+                       LoggerD(" notification id = " << noti_priv);
                        
                        StatusNotification* notification = new StatusNotification(noti_priv);
 
                        notification_get_id((notification_h)notification->getNotificationHandle(), NULL, &noti_priv);
-                       LogDebug("loaded notification id = " << noti_priv);
+                       LoggerD("loaded notification id = " << noti_priv);
                        
                        data.push_back(notification);