Update ground state in table while updating data usage. 59/155759/1 accepted/tizen/unified/20171018.062540 submit/tizen/20171016.080431 submit/tizen/20171017.050741 submit/tizen/20171017.075711
authorNishant Chaprana <n.chaprana@samsung.com>
Tue, 3 Oct 2017 09:02:45 +0000 (14:32 +0530)
committerhyunuktak <hyunuk.tak@samsung.com>
Mon, 16 Oct 2017 05:35:20 +0000 (14:35 +0900)
Change-Id: I3288285af6febf4ce196d9fe8d965699b01bc22e
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
src/monitor/stc-monitor.c

index 1cc0b5e..2fde42c 100755 (executable)
@@ -890,7 +890,15 @@ static gboolean __update_app_statistics(gpointer key, gpointer value,
        stat.snd_count = app_value->counter.out_bytes;
        stat.rcv_count = app_value->counter.in_bytes;
        stat.is_roaming = default_connection->roaming;
-       stat.ground = STC_APP_STATE_UNKNOWN;
+
+       if (strstr(stat.app_id, "_BACKGROUND")) {
+               stat.ground = STC_APP_STATE_BACKGROUND;
+       } else {
+               if (strstr(stat.app_id, "TOTAL_"))
+                       stat.ground = STC_APP_STATE_UNKNOWN;
+               else
+                       stat.ground = STC_APP_STATE_FOREGROUND;
+       }
 
        table_statistics_insert(&stat_key, &stat, *touch_time);