Changes for Signal NeedCleanup 91/182591/4
authorkamaljeet <kamal.jc@samsung.com>
Tue, 26 Jun 2018 10:11:50 +0000 (15:41 +0530)
committerkamaljeet <kamal.jc@samsung.com>
Tue, 10 Jul 2018 06:54:20 +0000 (12:24 +0530)
Change-Id: If1110fc89432c73b51a5f0ce5412c57d8e0643ba
Signed-off-by: kamaljeet <kamal.jc@samsung.com>
framework/storage-handler/MsgStorageMessage.cpp
plugin/sms_cdma_plugin/SmsCdmaPluginMain.cpp
plugin/sms_cdma_plugin/SmsCdmaPluginStorage.cpp
plugin/sms_plugin/SmsPluginMain.cpp
plugin/sms_plugin/SmsPluginStorage.cpp

index e5e9ce4..c3dcf2b 100755 (executable)
@@ -1055,6 +1055,11 @@ msg_error_t MsgStoDeleteMessage(msg_message_id_t msgId, bool bCheckIndication)
                        MSG_DEBUG("Set Memory Status");
 
                        plg->setMemoryStatus(simIndex, MSG_SUCCESS);
+               } else if (MsgStoCheckMsgCntFull(dbHandle, &msgType, folderId) == MSG_ERR_MESSAGE_COUNT_FULL) {
+                       MSG_DEBUG("Set Memory Status");
+                       plg->setMemoryStatus(simIndex, MSG_ERR_MESSAGE_COUNT_FULL);
+               } else {
+                       MSG_DEBUG("Storage event error :Failed to get space info ");
                }
        }
 
@@ -3236,8 +3241,8 @@ msg_error_t MsgStoUpdateIMSI(int sim_idx)
 msg_error_t MsgStoAllowTcsMessage(msg_message_id_t msgId)
 {
        MSG_BEGIN();
-       MSG_MESSAGE_INFO_S msgInfo = {0,};
-       MSG_SENDINGOPT_INFO_S sendOptInfo = {0,};
+       MSG_MESSAGE_INFO_S msgInfo = {0, };
+       MSG_SENDINGOPT_INFO_S sendOptInfo = {0, };
        msg_error_t err = MSG_SUCCESS;
 
        err = MsgStoGetMessage(msgId, &msgInfo, &sendOptInfo);
index 030f3b1..a2f7adb 100755 (executable)
@@ -29,6 +29,8 @@
 #include "SmsCdmaPluginSetting.h"
 #include "SmsCdmaPluginMain.h"
 #include <gio/gio.h>
+#include <tzplatform_config.h>
+
 
 extern "C"
 {
@@ -42,7 +44,10 @@ extern "C"
 #define BUS_NAME "org.tizen.system.storage"
 #define PATH_NAME "/Org/Tizen/System/Storage/Lowmem"
 #define INTERFACE_NAME BUS_NAME".lowmem"
-#define MEMBER_NAME "Full"
+#define MEMBER_NAME "NeedCleanup"
+#define SIGNAL_VAL "Full"
+
+
 
 struct tapi_handle *pTapiHandle = NULL;
 bool isMemAvailable = true;
@@ -322,11 +327,13 @@ static void on_change_received(GDBusConnection *connection, const gchar *sender_
        MSG_DEBUG("signal_name = [%s]", signal_name);
 
        if (g_strcmp0(signal_name, MEMBER_NAME) == 0) {
-               gint memStatus;
-               g_variant_get(parameters, "(i)", &memStatus);
-               MSG_DEBUG("memStatus = [%d]", memStatus);
-               if (memStatus == 0) {
-                       SmsPlgSetMemoryStatus(MSG_SUCCESS);
+               gchar *str_val = NULL;
+               gint path;
+               g_variant_get(parameters, "(is)", &path, &str_val);
+               MSG_DEBUG("path = [%i]  and str_val = [%s]", path , str_val);
+               if (path == TZ_SYS_USER && g_strcmp0(str_val, SIGNAL_VAL) == 0)
+               {
+                       SmsPlgSetMemoryStatus(MSG_ERR_SIM_STORAGE_FULL);
                }
        }
 }
index c573434..7f1d9ee 100755 (executable)
@@ -470,6 +470,11 @@ msg_error_t SmsPluginStorage::deleteSmsMessage(msg_message_id_t msgId)
                if (MsgStoCheckMsgCntFull(dbHandle, &msgType, folderId) == MSG_SUCCESS) {
                        MSG_DEBUG("Set Memory Status");
                        SmsPlgSetMemoryStatus(MSG_SUCCESS);
+               } else if (MsgStoCheckMsgCntFull(dbHandle, &msgType, folderId) == MSG_ERR_MESSAGE_COUNT_FULL) {
+                       MSG_DEBUG("Set Memory Status");
+                       SmsPlgSetMemoryStatus(MSG_ERR_MESSAGE_COUNT_FULL);
+               } else {
+                       MSG_DEBUG("Storage event error :Failed to get space info ");
                }
        }
 
index 5b09f72..768f90f 100755 (executable)
@@ -31,6 +31,8 @@
 #include "SmsPluginMain.h"
 #include "SmsPluginDSHandler.h"
 #include <gio/gio.h>
+#include <tzplatform_config.h>
+
 
 extern "C" {
        #include <tapi_common.h>
@@ -43,7 +45,9 @@ extern "C" {
 #define BUS_NAME "org.tizen.system.storage"
 #define PATH_NAME "/Org/Tizen/System/Storage/Lowmem"
 #define INTERFACE_NAME BUS_NAME".lowmem"
-#define MEMBER_NAME "Full"
+#define MEMBER_NAME "NeedCleanup"
+#define SIGNAL_VAL "Full"
+
 
 GDBusConnection *gdbus_conn = NULL;
 GDBusProxy *gdbus_proxy = NULL;
@@ -459,14 +463,16 @@ static void on_change_received(GDBusConnection *connection, const gchar *sender_
        MSG_DEBUG("signal_name = [%s]", signal_name);
 
        if (g_strcmp0(signal_name, MEMBER_NAME) == 0) {
-               gint memStatus;
-               g_variant_get(parameters, "(i)", &memStatus);
-               MSG_DEBUG("memStatus = [%d]", memStatus);
-               if (memStatus == 0) {
+               gchar *str_val = NULL;
+               gint path;
+               g_variant_get(parameters, "(is)", &path, &str_val);
+               MSG_DEBUG("path = [%i]  and str_val = [%s]", path , str_val);
+               if (path == TZ_SYS_USER && g_strcmp0(str_val, SIGNAL_VAL) == 0)
+               {
                        int sim_count = SmsPluginDSHandler::instance()->getTelHandleCount();
 
                        for (int i = 0; i < sim_count; i++) {
-                               SmsPlgSetMemoryStatus(i, MSG_SUCCESS);
+                               SmsPlgSetMemoryStatus(i, MSG_ERR_SIM_STORAGE_FULL);
                        }
                }
        }
index 466f4ed..9fc7fb5 100755 (executable)
@@ -665,6 +665,11 @@ msg_error_t SmsPluginStorage::deleteSmsMessage(msg_message_id_t msgId)
                if (MsgStoCheckMsgCntFull(dbHandle, &msgType, folderId) == MSG_SUCCESS) {
                        MSG_DEBUG("Set Memory Status");
                        SmsPlgSetMemoryStatus(simIndex, MSG_SUCCESS);
+               } else if (MsgStoCheckMsgCntFull(dbHandle, &msgType, folderId) == MSG_ERR_MESSAGE_COUNT_FULL) {
+                       MSG_DEBUG("Set Memory Status");
+                       SmsPlgSetMemoryStatus(simIndex, MSG_ERR_MESSAGE_COUNT_FULL);
+               } else {
+                       MSG_DEBUG("Storage event error :Failed to get space info ");
                }
        }