Merge "Remove logic to place pids to background cgroup procs" into tizen accepted/tizen/unified/20180910.172047 submit/tizen/20180910.023124
authorJaehyun Kim <jeik01.kim@samsung.com>
Mon, 10 Sep 2018 02:30:07 +0000 (02:30 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 10 Sep 2018 02:30:07 +0000 (02:30 +0000)
packaging/stc-manager.spec
src/helper/helper-cgroup.c [changed mode: 0644->0755]
src/monitor/stc-monitor.c

index ab1c360..b8ab1cf 100644 (file)
@@ -1,6 +1,6 @@
 Name:       stc-manager
 Summary:    STC(Smart Traffic Control) manager
-Version:    0.0.77
+Version:    0.0.78
 Release:    0
 Group:      Network & Connectivity/Other
 License:    Apache-2.0
old mode 100644 (file)
new mode 100755 (executable)
index fa54c12..ee7c282
@@ -231,9 +231,6 @@ void cgroup_init(void)
        cgroup_make_subdir(STC_CGROUP_NETWORK, STC_BACKGROUND_CGROUP_NAME,
                           NULL);
 
-       cgroup_write_node_uint32(BACKGROUND_CGROUP_NETWORK,
-               CLASSID_FILE_NAME, STC_BACKGROUND_APP_CLASSID);
-
        /* create foreground cgroup directory */
        cgroup_make_subdir(STC_CGROUP_NETWORK, STC_FOREGROUND_CGROUP_NAME,
                           NULL);
index ca7f6bf..4f1129c 100755 (executable)
@@ -2432,16 +2432,6 @@ static void __add_application_by_interface(const char *app_id)
        FREE(app_key.app_id);
 }
 
-static guint __get_background_state(void)
-{
-       return g_system->background_state;;
-}
-
-static void __set_background_state(guint state)
-{
-       g_system->background_state = state;
-}
-
 static gboolean __processes_tree_foreach_background(gpointer key,
                                                    gpointer value,
                                                    gpointer data)
@@ -2449,10 +2439,7 @@ static gboolean __processes_tree_foreach_background(gpointer key,
        stc_process_key_s *proc_key = (stc_process_key_s *)key;
        stc_app_key_s *app_key = (stc_app_key_s *)data;
 
-       if (g_system->background_state)
-               place_pids_to_net_cgroup(proc_key->pid, STC_BACKGROUND_APP_ID);
-       else
-               place_pids_to_net_cgroup(proc_key->pid, app_key->app_id);
+       place_pids_to_net_cgroup(proc_key->pid, app_key->app_id);
 
        return FALSE;
 }
@@ -2771,10 +2758,7 @@ API stc_error_e stc_monitor_process_update_ground(const stc_app_key_s app_key,
        if (proc_lookup->ground != ground)
                proc_lookup->ground = ground;
 
-       if (ground == STC_APP_STATE_BACKGROUND && __get_background_state())
-               place_pids_to_net_cgroup(proc_key.pid, STC_BACKGROUND_APP_ID);
-       else
-               place_pids_to_net_cgroup(proc_key.pid, app_key.app_id);
+       place_pids_to_net_cgroup(proc_key.pid, app_key.app_id);
 
        return ret;
 }
@@ -2856,8 +2840,8 @@ stc_error_e stc_monitor_rstns_tree_add(const table_restrictions_info *info)
                value.classid = STC_UNKNOWN_CLASSID;
 
        if (value.classid == STC_BACKGROUND_APP_CLASSID) {
-               __set_background_state(TRUE); //LCOV_EXCL_LINE
-               __vconf_set_int(VCONFKEY_STC_BACKGROUND_STATE, g_system->background_state); //LCOV_EXCL_LINE
+               g_system->background_state = TRUE; //LCOV_EXCL_LINE
+               __vconf_set_int(VCONFKEY_STC_BACKGROUND_STATE, TRUE); //LCOV_EXCL_LINE
                __process_update_background(); //LCOV_EXCL_LINE
        }
 
@@ -2892,8 +2876,8 @@ stc_error_e stc_monitor_rstns_tree_remove(const table_restrictions_info *info)
        };
 
        if (!strcmp(key.app_id, STC_BACKGROUND_APP_ID)) {
-               __set_background_state(FALSE); //LCOV_EXCL_LINE
-               __vconf_set_int(VCONFKEY_STC_BACKGROUND_STATE, g_system->background_state); //LCOV_EXCL_LINE
+               g_system->background_state = FALSE; //LCOV_EXCL_LINE
+               __vconf_set_int(VCONFKEY_STC_BACKGROUND_STATE, FALSE); //LCOV_EXCL_LINE
                __process_update_background(); //LCOV_EXCL_LINE
        }