From f5f1a46d25c50e338ea9d5831a818353ac6ec8c8 Mon Sep 17 00:00:00 2001 From: hj kim Date: Fri, 24 Jul 2020 09:08:13 +0900 Subject: [PATCH] Use functions instead of setting value directly. And apply tizen coding rule Change-Id: If60290b803bbb74961127b4510833f386cd0def2 --- src/scanner-v2/include/media-scanner-common-v2.h | 2 +- src/scanner-v2/media-scanner-common-v2.c | 5 ++++- src/scanner-v2/media-scanner-v2.c | 6 ++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/scanner-v2/include/media-scanner-common-v2.h b/src/scanner-v2/include/media-scanner-common-v2.h index e5160f7..3471259 100755 --- a/src/scanner-v2/include/media-scanner-common-v2.h +++ b/src/scanner-v2/include/media-scanner-common-v2.h @@ -27,7 +27,7 @@ #define SCAN_SLEEP_TIME 10000 -void msc_set_power_status(bool status); +void _msc_set_power_status(bool status); void msc_get_power_status(bool *status); #endif /*_MEDIA_SCANNER_COMMON_V2_H_*/ diff --git a/src/scanner-v2/media-scanner-common-v2.c b/src/scanner-v2/media-scanner-common-v2.c index b3347bf..ca266f2 100755 --- a/src/scanner-v2/media-scanner-common-v2.c +++ b/src/scanner-v2/media-scanner-common-v2.c @@ -20,12 +20,15 @@ */ #include "media-scanner-common-v2.h" +#include "media-common-dbg.h" bool power_off2; -void msc_set_power_status(bool status) +void _msc_set_power_status(bool status) { power_off2 = status; + + MS_DBG_WARN("media_scanner_v2 set power_off2 to %s", (status) ? "true" : "false"); } void msc_get_power_status(bool *status) diff --git a/src/scanner-v2/media-scanner-v2.c b/src/scanner-v2/media-scanner-v2.c index 34f55db..419fdb5 100644 --- a/src/scanner-v2/media-scanner-v2.c +++ b/src/scanner-v2/media-scanner-v2.c @@ -51,7 +51,6 @@ extern GAsyncQueue *folder_extract_queue; extern GMutex scan_req_mutex2; extern int g_directory_scan_processing2; extern bool g_directory_extract_processing; -bool power_off2; /*If this is true, poweroff notification received*/ static GMainLoop *scanner_mainloop2 = NULL; static guint scanner_source_id2; @@ -75,7 +74,7 @@ static void __power_off_cb(void) MS_DBG_ERR("POWER OFF CB Begin"); //display_lock_state(POWER_STATE_STANDBY, 0); - power_off2 = true; + _msc_set_power_status(true); __push_power_off(scan_queue2); __push_power_off(reg_queue2); @@ -151,8 +150,7 @@ int main(int argc, char **argv) scanner_source_id2 = g_io_add_watch(channel, G_IO_IN, msc_receive_request, NULL); g_io_channel_unref(channel); - MS_DBG_WARN("media_scanner_v2 set power_off2 to false..."); - power_off2 = false; + _msc_set_power_status(false); /*create each threads*/ storage_scan_thread = g_thread_new("storage_scan_thread", msc_storage_scan_thread, NULL); -- 2.7.4