Fix bug maclient info gets appended, not replaced on pkgmgr event 46/229046/1
authorJi-hoon Lee <dalton.lee@samsng.com>
Fri, 27 Mar 2020 08:44:24 +0000 (17:44 +0900)
committerJi-hoon Lee <dalton.lee@samsng.com>
Fri, 27 Mar 2020 08:49:27 +0000 (17:49 +0900)
When a packge manager event on dependent modules is detected
(such as wakeup engine package), the multi-assistant-service
tries to reload wakeup manager plugin and also reload the
assistant info files.
But the previous implementation appends assistant information
whenever this reload process is requested, not replacing the
original assistant information struct, causing the struct
to contain duplicated entries and also retains entries for
outdated assistant information.
For this reason, make sure the assistant information struct
is cleared before reading assistant info files.

Change-Id: I9ba1c4d7f4fd8c1070f9e1dd5d9d63fc002dd380

src/multi_assistant_service.c

index 1375661467ecfa738925d6bb2f0ed5672a16de71..c8604fb5536408f62d6a86a85a33eaf4885ce7d6 100644 (file)
@@ -742,6 +742,11 @@ static int init_plugin(void)
                return -1;
        }
 
+       memset(&g_maclient_info, 0x00, sizeof(g_maclient_info));
+       g_current_maclient_info = -1;
+       g_current_preprocessing_maclient_info = -1;
+       g_wakeup_maclient_appid = NULL;
+
        if (0 == mas_config_get_assistant_info(__mas_assistant_info_cb, NULL)) {
                for (int loop = 0; loop < MAX_MACLIENT_INFO_NUM; loop++) {
                        int inner_loop;