From 63cc194d4e95a860ab3e9e5792aef37e96ace1d0 Mon Sep 17 00:00:00 2001 From: lokilee73 Date: Tue, 26 Jun 2018 17:16:38 +0900 Subject: [PATCH] Fix build warning Add DATAUSAGE_WARNING and DATAUSAGE_DISABLED to fix build warning. Change-Id: If8421e8a2bc429570f4daee811dc27b7f505e9cd Signed-off-by: lokilee73 --- src/launcher/launcher.c | 18 ++++++++++++++++++ src/launcher/launcher.h | 2 +- src/launcher/noti.c | 12 ++++++------ src/mmc/mmc-mobile.c | 2 +- src/overheat/overheat.c | 2 +- src/usb/usb-device.c | 2 +- system-cooperator/system-cooperator.c | 14 +++++++------- 7 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/launcher/launcher.c b/src/launcher/launcher.c index bb3d91f..28568f5 100755 --- a/src/launcher/launcher.c +++ b/src/launcher/launcher.c @@ -167,6 +167,19 @@ static DBusMessage *battery_critical_actnoti_chg_on(E_DBus_Object *obj, DBusMess return activate_notification_no_param(obj, msg, BATTERY_CRITICAL_CHG_ACT); } +/* Datausage */ +static DBusMessage *data_warning_noti_on(E_DBus_Object *obj, DBusMessage *msg) +{ + set_timer_to_terminate(); + return activate_notification_no_param(obj, msg, DATAUSAGE_WARNING); +} + +static DBusMessage *data_disabled_noti_on(E_DBus_Object *obj, DBusMessage *msg) +{ + set_timer_to_terminate(); + return activate_notification_no_param(obj, msg, DATAUSAGE_DISABLED); +} + /* Notification Off */ static DBusMessage *noti_off(E_DBus_Object *obj, DBusMessage *msg) { @@ -278,6 +291,11 @@ dbus_noti_methods[] = { { "TempCooldownNotiOff" , "i" , "i" , noti_off }, /* SD Card */ { "SDcardNoti" , "s" , "i" , sdcard_noti }, + /* Data Usage */ + { "DataWarningNotiOn" , NULL , "i" , data_warning_noti_on }, + { "DataWarningNotiOff" , "i" , "i" , noti_off }, + { "DataDisabledNotiOn" , NULL , "i" , data_disabled_noti_on }, + { "DataDisabledNotiOff" , "i" , "i" , noti_off }, /* Add notifications here */ }; diff --git a/src/launcher/launcher.h b/src/launcher/launcher.h index df4fff5..ab776dd 100755 --- a/src/launcher/launcher.h +++ b/src/launcher/launcher.h @@ -38,7 +38,7 @@ /* Setting ugs */ #define SETTING_ENCRYPTING_APP "org.tizen.setting.encrypting" #define SETTING_LIGHTOFF_APP "org.tizen.setting.turnofflight" -#define SETTING_DATAUSAGE_UG "setting-datausage-efl" +#define SETTING_DATAUSAGE_APP "org.tizen.setting-data" /* App to show Host devices list */ #define HOST_DEVICES "org.tizen.host-devices" diff --git a/src/launcher/noti.c b/src/launcher/noti.c index b49c119..80acf3b 100755 --- a/src/launcher/noti.c +++ b/src/launcher/noti.c @@ -239,7 +239,7 @@ static int launch_datausage_warning_notification(void) b = bundle_create(); if (b) - appsvc_set_pkgname(b, SETTING_DATAUSAGE_UG); + appsvc_set_pkgname(b, SETTING_DATAUSAGE_APP); ret = add_notification(NOTIFICATION_TYPE_NOTI, NOTIFICATION_LY_NOTI_EVENT_SINGLE, @@ -269,7 +269,7 @@ static int launch_datausage_disabled_notification(void) b = bundle_create(); if (b) - appsvc_set_pkgname(b, SETTING_DATAUSAGE_UG); + appsvc_set_pkgname(b, SETTING_DATAUSAGE_APP); ret = add_notification(NOTIFICATION_TYPE_ONGOING, NOTIFICATION_LY_ONGOING_EVENT, @@ -723,6 +723,10 @@ static int launch_battery_notification(int type) { int ret = -EINVAL; +#ifndef PROFILE_MOBILE // event noti should be supported in mobile profile only + return ret; +#endif + if (type == BATTERY_FULL) { ret = add_notification(NOTIFICATION_TYPE_ONGOING, NOTIFICATION_LY_ONGOING_EVENT, @@ -929,11 +933,7 @@ DBusMessage *activate_notification_no_param(E_DBus_Object *obj, DBusMessage *msg _D("Load notification"); // event noti should be supported in mobile profile only -#ifdef PROFILE_MOBILE priv_id = launch_notification_no_param_by_type(type); -#else - priv_id = -1; -#endif if (priv_id < 0) _E("FAIL: launch_noti_by_type()"); diff --git a/src/mmc/mmc-mobile.c b/src/mmc/mmc-mobile.c index dece299..4f22836 100755 --- a/src/mmc/mmc-mobile.c +++ b/src/mmc/mmc-mobile.c @@ -182,7 +182,7 @@ static void send_ode_mount_signal(const struct popup_ops *ops) static void ode_launch_settings(const struct popup_ops *ops) { unload_simple_popup(ops); - launch_app(SETTING_MMC_ENCRYPTION_UG); + launch_app(EXT_SETTING_MMC_UG); terminate_if_no_popup(); } diff --git a/src/overheat/overheat.c b/src/overheat/overheat.c index a1b0626..696b969 100755 --- a/src/overheat/overheat.c +++ b/src/overheat/overheat.c @@ -65,7 +65,7 @@ static char *items[] = { char* gl_text_get(int index) { - char *text = NULL, buffer[BUF_MAX] = {NULL}; + char *text = NULL, buffer[BUF_MAX] = {'\0',}; if (index == 2) { text = _(items[2]); diff --git a/src/usb/usb-device.c b/src/usb/usb-device.c index d254286..bd4f931 100755 --- a/src/usb/usb-device.c +++ b/src/usb/usb-device.c @@ -190,7 +190,7 @@ static int usbhost_show(bundle *b, const struct popup_ops *ops) Evas_Object *win; struct object_ops *obj; int ret; - char content[BUF_MAX] = {NULL}; + char content[BUF_MAX] = {'\0',}; ret = get_object_by_ops(ops, &obj); if (ret < 0) { diff --git a/system-cooperator/system-cooperator.c b/system-cooperator/system-cooperator.c index df4d77a..e4cef48 100755 --- a/system-cooperator/system-cooperator.c +++ b/system-cooperator/system-cooperator.c @@ -52,9 +52,9 @@ enum sound_status { static guint noti_timer; static GMainLoop *loop; -static int loop_type = LOOP_ERROR; +static int looptype = LOOP_ERROR; -static void quit_main_loop(ltype) +static void quit_main_loop(int ltype) { switch (ltype) { case LOOP_G_MAIN_LOOP: @@ -83,7 +83,7 @@ static int get_sound_state(void) static gboolean time_expired(gpointer data) { feedback_deinitialize(); - quit_main_loop(loop_type); + quit_main_loop(looptype); return FALSE; } @@ -193,9 +193,9 @@ int main(int argc, char *argv[]) return 0; type = atoi(argv[1]); - loop_type = get_main_loop_type(type); + looptype = get_main_loop_type(type); - ret = init_main_loop(loop_type); + ret = init_main_loop(looptype); if (ret < 0) { _E("Failed to init main loop (%d)", ret); return ret; @@ -207,14 +207,14 @@ int main(int argc, char *argv[]) goto out; } - start_main_loop(loop_type); + start_main_loop(looptype); out: ret = app_terminate(type); if (ret < 0) _E("Failed to release handlers(%d)", ret); - finalize_main_loop(loop_type); + finalize_main_loop(looptype); return 0; } -- 2.7.4