From: Youngjae Cho Date: Thu, 17 Aug 2023 05:48:27 +0000 (+0900) Subject: shared: Replace device_notifier_type with the libsyscommon X-Git-Tag: accepted/tizen/unified/20230821.162310~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=450d67d8b15c99b946b4ab5a075d50ee7fa6aede;p=platform%2Fcore%2Fsystem%2Fdeviced.git shared: Replace device_notifier_type with the libsyscommon The prefix DEVICE_NOTIFIER has been replaced with DEVICE'D'_NOTIFIER. Change-Id: Ie2600c7846ca9ac898b3b20f69e36bc8c45f9b3e Signed-off-by: Youngjae Cho --- diff --git a/conf/battery.conf b/conf/battery.conf index 381d99e..5014c41 100644 --- a/conf/battery.conf +++ b/conf/battery.conf @@ -21,13 +21,13 @@ ChargerWakeLockEnabled=yes #[EventAction] #Name=CHARGER_CONNECTED #Enum=2001 -#DeviceNotifier=DEVICE_NOTIFIER_BATTERY_CHARGER_CONNECTED +#DeviceNotifier=DEVICED_NOTIFIER_BATTERY_CHARGER_CONNECTED #ActionBroadcast=yes #WakeLockDurationSec=5 #[EventAction] #Name=CHARGER_DISCONNECTED #Enum=2002 -#DeviceNotifier=DEVICE_NOTIFIER_BATTERY_CHARGER_DISCONNECTED +#DeviceNotifier=DEVICED_NOTIFIER_BATTERY_CHARGER_DISCONNECTED #ActionBroadcast=yes #WakeLockDurationSec=5 diff --git a/plugins/iot-headed/display/key-filter.c b/plugins/iot-headed/display/key-filter.c index c5a1d8f..4baa6c3 100644 --- a/plugins/iot-headed/display/key-filter.c +++ b/plugins/iot-headed/display/key-filter.c @@ -168,7 +168,7 @@ static void longkey_pressed(void) static gboolean longkey_restore_cb(void *data) { - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LONGKEY_RESTORE, (void *)NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LONGKEY_RESTORE, (void *)NULL); longkey_restore_id = 0; return G_SOURCE_REMOVE; @@ -574,7 +574,7 @@ static void update_vital_state(struct input_event *pinput) pinput->value == KEY_RELEASED && pinput->code == KEY_MENU)) { /* Enable all services upon receiving user input, else maintain same state */ type = VITAL_EXIT; - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_VITAL_STATE, &type); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_VITAL_STATE, &type); } } @@ -787,8 +787,8 @@ static void __CONSTRUCTOR__ initialize(void) display_add_actor(&display_powerkey_actor); display_add_actor(&display_menukey_actor); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_BEZEL_WAKEUP, bezel_wakeup_cb); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_BEZEL_WAKEUP, bezel_wakeup_cb); input_register_event_callback(check_key_filter, NULL, NULL, NULL); } diff --git a/plugins/iot-headless/input/input-config.c b/plugins/iot-headless/input/input-config.c index 2848af7..9e6f15c 100644 --- a/plugins/iot-headless/input/input-config.c +++ b/plugins/iot-headless/input/input-config.c @@ -149,7 +149,7 @@ static void parse_change_state(struct input_event_unit *ieu, const char *action) char next[16] = { 0, }; if (sscanf(action, "%15[^,],%15s", curr, next) == 2) { - ieu->notifier = DEVICE_NOTIFIER_REQUEST_TRANSITION_STATE; + ieu->notifier = DEVICED_NOTIFIER_REQUEST_TRANSITION_STATE; /* append transition info to ieu->user_data */ add_action_transition_info(ieu, curr, next); } else { diff --git a/plugins/iot-headless/input/input-config.h b/plugins/iot-headless/input/input-config.h index 4f03f30..0c62b8c 100644 --- a/plugins/iot-headless/input/input-config.h +++ b/plugins/iot-headless/input/input-config.h @@ -57,7 +57,7 @@ struct input_event_unit { int broadcast; /* which action to do on receiving an event */ - enum device_notifier_type notifier; + enum deviced_notifier notifier; void *user_data; /* hold wakelock for a duration on detecting the event */ diff --git a/plugins/iot-headless/input/input-handler.c b/plugins/iot-headless/input/input-handler.c index 5249314..8e5b803 100644 --- a/plugins/iot-headless/input/input-handler.c +++ b/plugins/iot-headless/input/input-handler.c @@ -138,7 +138,7 @@ static void input_handler_process_key(struct timeval time, unsigned short type, /* acquire tmplock on pressing key */ if (keyvalue == KEY_PRESSED) - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_KEY_PRESS, (void *)(intptr_t) keycode); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_KEY_PRESS, (void *)(intptr_t) keycode); /* process all registered event to the keycode */ ic = find_input_config(keycode); @@ -149,7 +149,7 @@ static void input_handler_process_key(struct timeval time, unsigned short type, /* release tmplock on releasing key */ if (keyvalue == KEY_RELEASED) - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_KEY_RELEASE, (void *)(intptr_t) keycode); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_KEY_RELEASE, (void *)(intptr_t) keycode); } static int input_handler_init(void *data) diff --git a/plugins/mobile/battery/battery-notification.c b/plugins/mobile/battery/battery-notification.c index f9856f7..ddf2462 100644 --- a/plugins/mobile/battery/battery-notification.c +++ b/plugins/mobile/battery/battery-notification.c @@ -333,7 +333,7 @@ static gboolean health_timer_cb(void *data) return G_SOURCE_REMOVE; CRITICAL_LOG("Popup: Battery health status is not good, %s.", battery->health_s); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_BATTERY_HEALTH, (void *)&battery->health); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_HEALTH, (void *)&battery->health); battery_pm_change_internal(DEVICED_EVENT_MISC_POPUP, LCD_DIM); display_lock_request_unlock_with_option(DEVICED_EVENT_MISC_POPUP, LCD_OFF, PM_SLEEP_MARGIN); display_lock_request_lock_with_option(DEVICED_EVENT_MISC_POPUP, LCD_DIM, STAY_CUR_STATE, 0); diff --git a/plugins/mobile/display/key-filter.c b/plugins/mobile/display/key-filter.c index cb38e6a..0a4d1df 100644 --- a/plugins/mobile/display/key-filter.c +++ b/plugins/mobile/display/key-filter.c @@ -158,7 +158,7 @@ static void longkey_pressed(void) static gboolean longkey_restore_cb(void *data) { - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LONGKEY_RESTORE, (void *)NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LONGKEY_RESTORE, (void *)NULL); longkey_restore_id = 0; return G_SOURCE_REMOVE; @@ -606,7 +606,7 @@ static void update_vital_state(struct input_event *pinput) pinput->value == KEY_RELEASED && pinput->code == KEY_MENU)) { /* Enable all services upon receiving user input, else maintain same state */ type = VITAL_EXIT; - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_VITAL_STATE, &type); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_VITAL_STATE, &type); } } @@ -811,8 +811,8 @@ static void __CONSTRUCTOR__ initialize(void) display_add_actor(&display_powerkey_actor); display_add_actor(&display_menukey_actor); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_BEZEL_WAKEUP, bezel_wakeup_cb); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_BEZEL_WAKEUP, bezel_wakeup_cb); input_register_event_callback(check_key_filter, NULL, NULL, NULL); } diff --git a/plugins/tv/display/key-filter.c b/plugins/tv/display/key-filter.c index ec5c859..becd49e 100644 --- a/plugins/tv/display/key-filter.c +++ b/plugins/tv/display/key-filter.c @@ -167,7 +167,7 @@ static void longkey_pressed(void) static gboolean longkey_restore_cb(void *data) { - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LONGKEY_RESTORE, (void *)NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LONGKEY_RESTORE, (void *)NULL); longkey_restore_id = 0; return G_SOURCE_REMOVE; @@ -573,7 +573,7 @@ static void update_vital_state(struct input_event *pinput) pinput->value == KEY_RELEASED && pinput->code == KEY_MENU)) { /* Enable all services upon receiving user input, else maintain same state */ type = VITAL_EXIT; - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_VITAL_STATE, &type); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_VITAL_STATE, &type); } } @@ -778,8 +778,8 @@ static void __CONSTRUCTOR__ initialize(void) display_add_actor(&display_powerkey_actor); display_add_actor(&display_menukey_actor); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_BEZEL_WAKEUP, bezel_wakeup_cb); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_BEZEL_WAKEUP, bezel_wakeup_cb); input_register_event_callback(check_key_filter, NULL, NULL, NULL); } diff --git a/plugins/wearable/display/auto-brightness-sensorhub.c b/plugins/wearable/display/auto-brightness-sensorhub.c index d61cabc..2e867c2 100644 --- a/plugins/wearable/display/auto-brightness-sensorhub.c +++ b/plugins/wearable/display/auto-brightness-sensorhub.c @@ -243,7 +243,7 @@ int auto_brightness_control(enum brightness_request_e request, int set_brightnes lbm_set_state(false); change_flag(&lbm, 0); - /* called by DEVICE_NOTIFIER_LCD_OFF_COMPLETE, no need to change brightness */ + /* called by DEVICED_NOTIFIER_LCD_OFF_COMPLETE, no need to change brightness */ if (get_pm_cur_state() != DEVICED_DISPLAY_STATE_ON) return 0; @@ -269,7 +269,7 @@ int auto_brightness_control(enum brightness_request_e request, int set_brightnes if (!lbm && hold_brt) { change_flag(&hold_brt, 0); - /* called by DEVICE_NOTIFIER_LCD_OFF_COMPLETE, no need to change brightness */ + /* called by DEVICED_NOTIFIER_LCD_OFF_COMPLETE, no need to change brightness */ if (get_pm_cur_state() != DEVICED_DISPLAY_STATE_ON) return 0; @@ -358,8 +358,8 @@ int prepare_level_handler(void) vconf_notify_key_changed(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, set_automatic_state_cb, NULL); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LCD_OFF, display_off_changed); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LCD_OFF_COMPLETE, display_off_complete_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD_OFF, display_off_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD_OFF_COMPLETE, display_off_complete_changed); return 0; } @@ -370,8 +370,8 @@ void exit_level_handler(void) set_automatic_state_cb); set_default_brightness(); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_LCD_OFF, display_off_changed); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_LCD_OFF_COMPLETE, display_off_complete_changed); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_LCD_OFF, display_off_changed); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_LCD_OFF_COMPLETE, display_off_complete_changed); } static void __CONSTRUCTOR__ initialize(void) diff --git a/plugins/wearable/display/auto-brightness.c b/plugins/wearable/display/auto-brightness.c index 9006673..855212b 100644 --- a/plugins/wearable/display/auto-brightness.c +++ b/plugins/wearable/display/auto-brightness.c @@ -664,16 +664,16 @@ static void auto_brightness_init(void *data) g_display_plugin.set_autobrightness_min = set_autobrightness_min; g_display_plugin.reset_autobrightness_min = reset_autobrightness_min; - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LCD, lcd_changed_cb); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD, lcd_changed_cb); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); } static void auto_brightness_exit(void *data) { exit_lsensor(); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_LCD, lcd_changed_cb); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_LCD, lcd_changed_cb); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); } static const struct display_ops display_autobrightness_ops = { diff --git a/plugins/wearable/display/bezel.c b/plugins/wearable/display/bezel.c index 2868f07..b1a6ac4 100644 --- a/plugins/wearable/display/bezel.c +++ b/plugins/wearable/display/bezel.c @@ -63,7 +63,7 @@ static void bezel_changed_cb(keynode_t *key_nodes, void *data) _I("Bezel wakeup condition: %d", bezel_wakeup); display_state_transition_request_state_transition_with_option(DEVICED_EVENT_INPUT_BEZEL, LCD_NORMAL); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_BEZEL_WAKEUP, (void *)((intptr_t)bezel_wakeup)); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BEZEL_WAKEUP, (void *)((intptr_t)bezel_wakeup)); } static void theater_changed_cb(keynode_t *key_nodes, void *data) diff --git a/plugins/wearable/display/core.c b/plugins/wearable/display/core.c index ce097f9..30d2d57 100644 --- a/plugins/wearable/display/core.c +++ b/plugins/wearable/display/core.c @@ -294,7 +294,7 @@ static void lcd_off_procedure(enum device_flags flag) /* notification */ - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LCD_OFF, NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LCD_OFF, NULL); if (lcdon_broadcast) { broadcast_lcd_off(SIGNAL_PRE, flags); @@ -327,7 +327,7 @@ static void lcd_off_procedure(enum device_flags flag) broadcast_lcd_off_late(flags); } else { broadcast_lcd_off(SIGNAL_POST, flags); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LCD_OFF_COMPLETE, NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LCD_OFF_COMPLETE, NULL); } enter_doze(); @@ -701,7 +701,7 @@ static int default_action(int timeout) power_get_wakeup_reason(), NULL); set_setting_pmstate(get_pm_cur_state()); pm_cur_state = get_pm_cur_state(); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LCD, (void *)&pm_cur_state); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LCD, (void *)&pm_cur_state); } if ((get_pm_old_state() == DEVICED_DISPLAY_STATE_ON) && (get_pm_cur_state() != DEVICED_DISPLAY_STATE_ON)) { @@ -978,7 +978,7 @@ static void display_init(void *data) register_kernel_uevent_control(&sec_dsim_uevent_ops); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LCD_AUTOBRT_SENSING, display_auto_brightness_sensing); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD_AUTOBRT_SENSING, display_auto_brightness_sensing); init_setting(update_setting); init_sysfs(flags); diff --git a/plugins/wearable/display/device-interface.c b/plugins/wearable/display/device-interface.c index ef892bf..f7e5cf9 100644 --- a/plugins/wearable/display/device-interface.c +++ b/plugins/wearable/display/device-interface.c @@ -102,7 +102,7 @@ static int set_brightness(int val) update_bds_brightness_record(val); _I("set brightness %d (default:%d)", val, default_brightness); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_DISPLAY_BRIGHTNESS, (void *)&val); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_DISPLAY_BRIGHTNESS, (void *)&val); return hal_device_display_set_brightness(val); } diff --git a/plugins/wearable/display/display-handler.c b/plugins/wearable/display/display-handler.c index bad8407..4a5ddc5 100644 --- a/plugins/wearable/display/display-handler.c +++ b/plugins/wearable/display/display-handler.c @@ -95,7 +95,7 @@ static GVariant *dbus_autobrightnesschanged(GDBusConnection *conn, autobrt_timer = 0; } - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LCD_AUTOBRT_SENSING, NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LCD_AUTOBRT_SENSING, NULL); /* When display state changes from AOD to LCDON, brightness change * effect seems sluggish because of heavy load of jobs for turning on @@ -194,7 +194,7 @@ static void display_handler_init(void *data) int ret; prepare_level_handler(); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LCD, display_state_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD, display_state_changed); aod_clock_displayed = false; ret = gdbus_signal_subscribe(NULL, diff --git a/plugins/wearable/display/enhance.c b/plugins/wearable/display/enhance.c index b6682ad..598c5a6 100644 --- a/plugins/wearable/display/enhance.c +++ b/plugins/wearable/display/enhance.c @@ -112,7 +112,7 @@ static void enhance_init(void *data) int state; /* register notifier */ - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LCD, enhance_lcd_state_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD, enhance_lcd_state_changed); ret = vconf_notify_key_changed(VCONF_HIGH_CONTRAST, enhance_high_contrast_cb, NULL); @@ -154,7 +154,7 @@ static void enhance_init(void *data) static void enhance_exit(void *data) { /* unregister notifier */ - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_LCD, enhance_lcd_state_changed); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_LCD, enhance_lcd_state_changed); vconf_ignore_key_changed(VCONF_HIGH_CONTRAST, enhance_high_contrast_cb); vconf_ignore_key_changed(VCONF_GREYSCALE, enhance_greyscale_cb); diff --git a/plugins/wearable/display/hbm.c b/plugins/wearable/display/hbm.c index 243159e..d62d74d 100644 --- a/plugins/wearable/display/hbm.c +++ b/plugins/wearable/display/hbm.c @@ -405,7 +405,7 @@ static void hbm_init(void *data) _E("Failed to register dbus object."); /* register notifier */ - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LCD, display_state_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD, display_state_changed); /* double check to guarantee HBMOFF before DPMS OFF */ display_panel_register_dpms_checklist(DPMS_OFF, dpms_check_hbm_off); @@ -414,7 +414,7 @@ static void hbm_init(void *data) static void hbm_exit(void *data) { /* unregister notifier */ - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_LCD, display_state_changed); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_LCD, display_state_changed); /* * set default brightness diff --git a/plugins/wearable/display/key-filter.c b/plugins/wearable/display/key-filter.c index 7484c22..d9dc9e8 100644 --- a/plugins/wearable/display/key-filter.c +++ b/plugins/wearable/display/key-filter.c @@ -139,7 +139,7 @@ static void longkey_pressed(void) static gboolean longkey_restore_cb(void *data) { - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LONGKEY_RESTORE, (void *)NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LONGKEY_RESTORE, (void *)NULL); longkey_restore_id = 0; return G_SOURCE_REMOVE; @@ -517,7 +517,7 @@ static void update_vital_state(struct input_event *pinput) pinput->value == KEY_RELEASED && pinput->code == KEY_MENU)) { /* Enable all services upon receiving user input, else maintain same state */ type = VITAL_EXIT; - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_VITAL_STATE, &type); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_VITAL_STATE, &type); } } @@ -711,8 +711,8 @@ static void __CONSTRUCTOR__ initialize(void) display_add_actor(&display_powerkey_actor); display_add_actor(&display_menukey_actor); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_BEZEL_WAKEUP, bezel_wakeup_cb); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_BEZEL_WAKEUP, bezel_wakeup_cb); input_register_event_callback(check_key_filter, NULL, NULL, NULL); } diff --git a/plugins/wearable/display/lbm.c b/plugins/wearable/display/lbm.c index bb47be1..8f2f4d9 100644 --- a/plugins/wearable/display/lbm.c +++ b/plugins/wearable/display/lbm.c @@ -128,7 +128,7 @@ static int lbm_set_brightness(int val) system_brightness = val; _I("Set brightness(LBM on) system=%d, real=%d.", val, brt); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_DISPLAY_BRIGHTNESS, (void *)&val); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_DISPLAY_BRIGHTNESS, (void *)&val); return hal_device_display_set_brightness(brt); } diff --git a/plugins/wearable/display/powersaver.c b/plugins/wearable/display/powersaver.c index 0e117ac..95cdcb1 100644 --- a/plugins/wearable/display/powersaver.c +++ b/plugins/wearable/display/powersaver.c @@ -43,7 +43,7 @@ static int set_powersaver_mode(int mode) if (mode == POWERSAVER_ENHANCED) pmqos = true; _D("Powersaver mode %d pmqos %d.", mode, pmqos); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_ULTRAPOWERSAVING, (void *)&pmqos); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_ULTRAPOWERSAVING, (void *)&pmqos); display_backlight_set_force_brightness(0); set_force_lcdtimeout(0); @@ -127,7 +127,7 @@ static int delayed_init_done(void *data) } _D("Powersaver mode on, %d.", mode); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_PMQOS_ULTRAPOWERSAVING, (void *)&pmqos); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_PMQOS_ULTRAPOWERSAVING, (void *)&pmqos); ret = set_powersaver_mode(mode); if (ret < 0) _E("Failed to update powersaver state, %d.", ret); @@ -137,7 +137,7 @@ out: static void powersaver_init(void *data) { - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); } static void powersaver_exit(void *data) diff --git a/plugins/wearable/display/swim.c b/plugins/wearable/display/swim.c index 5d73c22..9f1962e 100644 --- a/plugins/wearable/display/swim.c +++ b/plugins/wearable/display/swim.c @@ -130,7 +130,7 @@ static void swim_init(void *data) if (ret <= 0) _E("Failed to register signal handler: %d", ret); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LONGKEY_RESTORE, swim_restore_cb); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LONGKEY_RESTORE, swim_restore_cb); } static const struct device_ops swim_device_ops = { diff --git a/src/battery/battery-parser.c b/src/battery/battery-parser.c index e0370d5..dc6e840 100644 --- a/src/battery/battery-parser.c +++ b/src/battery/battery-parser.c @@ -37,10 +37,10 @@ static void parse_device_notifier(struct battery_config_charger_event_handler *handler, const char *notifier) { - if (MATCH(notifier, "DEVICE_NOTIFIER_BATTERY_CHARGER_CONNECTED")) - handler->notifier = DEVICE_NOTIFIER_BATTERY_CHARGER_CONNECTED; - else if (MATCH(notifier, "DEVICE_NOTIFIER_BATTERY_CHARGER_DISCONNECTED")) - handler->notifier = DEVICE_NOTIFIER_BATTERY_CHARGER_DISCONNECTED; + if (MATCH(notifier, "DEVICED_NOTIFIER_BATTERY_CHARGER_CONNECTED")) + handler->notifier = DEVICED_NOTIFIER_BATTERY_CHARGER_CONNECTED; + else if (MATCH(notifier, "DEVICED_NOTIFIER_BATTERY_CHARGER_DISCONNECTED")) + handler->notifier = DEVICED_NOTIFIER_BATTERY_CHARGER_DISCONNECTED; } static void parse_event_action_property(gpointer data, gpointer user_data) diff --git a/src/battery/battery.h b/src/battery/battery.h index 2a6caa1..90110f9 100644 --- a/src/battery/battery.h +++ b/src/battery/battery.h @@ -42,7 +42,7 @@ enum battery_option_type { struct battery_config_charger_event_handler { char *name; int id; - enum device_notifier_type notifier; + enum deviced_notifier notifier; /* broadcast upon occuring this event */ int broadcast; diff --git a/src/battery/lowbat-handler.c b/src/battery/lowbat-handler.c index 8a75bc4..5ea5bc1 100644 --- a/src/battery/lowbat-handler.c +++ b/src/battery/lowbat-handler.c @@ -547,7 +547,7 @@ static int lowbat_process(int bat_percent, void *ad) low_bat = true; if (low_bat_old != low_bat) { - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LOWBAT, (void *)&low_bat); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LOWBAT, (void *)&low_bat); low_bat_old = low_bat; } @@ -613,7 +613,7 @@ static int lowbat_monitor_init(void *data) lowbat_initialized(&status); /* it's called just this once. */ - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_POWER_SUPPLY, lowbat_monitor_init); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_POWER_SUPPLY, lowbat_monitor_init); /* load battery configuration file */ battery_parser_load_config(&battery_info); @@ -687,8 +687,8 @@ static void lowbat_init(void *data) { int ret; - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_POWER_SUPPLY, lowbat_monitor_init); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_POWER_SUPPLY, lowbat_monitor_init); ret = gdbus_add_object(NULL, DEVICED_PATH_BATTERY, &dbus_interface); if (ret < 0) diff --git a/src/battery/power-supply.c b/src/battery/power-supply.c index d5f0b79..433e3a2 100644 --- a/src/battery/power-supply.c +++ b/src/battery/power-supply.c @@ -361,7 +361,7 @@ static void noti_batt_full(void) power_supply_noti(DEVICE_NOTI_BATT_FULL, DEVICE_NOTI_OFF); bat_full_noti = 0; /* off the full charge state */ - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_FULLBAT, (void *)&bat_full_noti); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_FULLBAT, (void *)&bat_full_noti); } if (battery.charge_full && bat_full_noti == 0) { power_supply_noti(DEVICE_NOTI_BATT_FULL, DEVICE_NOTI_ON); @@ -373,7 +373,7 @@ static void noti_batt_full(void) _I("Block LCD."); /* on the full charge state */ - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_FULLBAT, (void *)&bat_full_noti); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_FULLBAT, (void *)&bat_full_noti); } } @@ -415,11 +415,11 @@ static void update_present(enum battery_noti_status status) old_battery.present = battery.present; if (status == DEVICE_NOTI_ON) { battery_pm_change_internal(DEVICED_EVENT_MISC_POPUP, LCD_DIM); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_BATTERY_PRESENT, (void *)&battery.present); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_PRESENT, (void *)&battery.present); display_lock_request_lock_with_option(DEVICED_EVENT_MISC_POPUP, LCD_DIM, STAY_CUR_STATE, 0); } else { battery_pm_change_internal(DEVICED_EVENT_MISC_POPUP, LCD_NORMAL); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_BATTERY_PRESENT, (void *)&battery.present); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_PRESENT, (void *)&battery.present); display_lock_request_unlock_with_option(DEVICED_EVENT_MISC_POPUP, LCD_DIM, PM_SLEEP_MARGIN); } if (battery_plgn->changed_battery_cf) @@ -433,7 +433,7 @@ static void launch_health_popup(void) launching_health_popup = true; - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_BATTERY_HEALTH, (void *)&battery.health); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_HEALTH, (void *)&battery.health); battery_pm_change_internal(DEVICED_EVENT_MISC_POPUP, LCD_NORMAL); battery_pm_change_internal(DEVICED_EVENT_MISC_POPUP, LCD_DIM); display_lock_request_unlock_with_option(DEVICED_EVENT_MISC_POPUP, LCD_OFF, PM_SLEEP_MARGIN); @@ -467,7 +467,7 @@ static void update_health(enum battery_noti_status status) abnormal_health_popup_timer = g_timeout_add_seconds(ABNORMAL_CHECK_TIMER_INTERVAL, health_popup_cb, NULL); } else { battery_pm_change_internal(DEVICED_EVENT_MISC_POPUP, LCD_NORMAL); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_BATTERY_HEALTH, (void *)&battery.health); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_HEALTH, (void *)&battery.health); display_lock_request_unlock_with_option(DEVICED_EVENT_MISC_POPUP, LCD_DIM, PM_SLEEP_MARGIN); display_lock_request_unlock_with_option(DEVICED_EVENT_MISC_POPUP, LCD_OFF, PM_SLEEP_MARGIN); health_status_broadcast(); @@ -529,7 +529,7 @@ static void check_abnormal_status(void) return; notify_status = DEVICE_NOTI_ON; - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_BATTERY_OVP, (void *)&battery.health); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_OVP, (void *)&battery.health); if (battery_plgn->update_ovp) battery_plgn->update_ovp(DEVICE_NOTI_ON); @@ -543,7 +543,7 @@ static void check_abnormal_status(void) return; notify_status = DEVICE_NOTI_OFF; - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_BATTERY_OVP, (void *)&battery.health); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_OVP, (void *)&battery.health); if (battery_plgn->update_ovp) battery_plgn->update_ovp(DEVICE_NOTI_OFF); @@ -722,13 +722,13 @@ static void process_power_supply(void *data) if (battery.charger_connected == 0) { CRITICAL_LOG("Battery charger disconnected"); event_system_send(SYS_EVENT_BATTERY_CHARGER_STATUS, EVT_KEY_BATTERY_CHARGER_STATUS, EVT_VAL_BATTERY_CHARGER_CONNECTED); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_BATTERY_CHARGER_DISCONNECTED, NULL); - notify_charger_event(DEVICE_NOTIFIER_BATTERY_CHARGER_DISCONNECTED); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_CHARGER_DISCONNECTED, NULL); + notify_charger_event(DEVICED_NOTIFIER_BATTERY_CHARGER_DISCONNECTED); } else if (battery.charger_connected == 1) { CRITICAL_LOG("Battery charger connected"); event_system_send(SYS_EVENT_BATTERY_CHARGER_STATUS, EVT_KEY_BATTERY_CHARGER_STATUS, EVT_VAL_BATTERY_CHARGER_DISCONNECTED); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_BATTERY_CHARGER_CONNECTED, NULL); - notify_charger_event(DEVICE_NOTIFIER_BATTERY_CHARGER_CONNECTED); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_CHARGER_CONNECTED, NULL); + notify_charger_event(DEVICED_NOTIFIER_BATTERY_CHARGER_CONNECTED); } else { _E("Invalid charger connected"); } @@ -782,9 +782,9 @@ static void process_power_supply(void *data) check_abnormal_status(); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_POWER_SUPPLY, NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_POWER_SUPPLY, NULL); if (old_battery.charge_now != battery.charge_now) { - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_BATTERY_CHARGING, &battery.charge_now); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_BATTERY_CHARGING, &battery.charge_now); old_battery.charge_now = battery.charge_now; } @@ -1201,7 +1201,7 @@ static GVariant *dbus_get_battery_info(GDBusConnection *conn, const char *str; struct battery_info info = {0, }; - if (old_state == DEVICE_NOTIFIER_STATE_STOP) + if (old_state == DEVICED_NOTIFIER_STATE_STOP) goto out; if (battery_initialized) @@ -1295,7 +1295,7 @@ static int delayed_init_done(void *data) { static int done; int retval; - device_notifier_state_e state = DEVICE_NOTIFIER_STATE_START; + device_notifier_state_e state = DEVICED_NOTIFIER_STATE_START; if (data == NULL) return done; @@ -1327,7 +1327,7 @@ static int delayed_init_done(void *data) CHARGE_MISC_EVENT_SIGNAL, battery.misc, CHARGE_HEALTH_SIGNAL, battery.health, battery.health_s); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); return done; } @@ -1482,9 +1482,9 @@ static int event_handler_state_changed(void *data) old_state = state; - if (state == DEVICE_NOTIFIER_STATE_START) + if (state == DEVICED_NOTIFIER_STATE_START) add_power_supply_handler(); - else if (state == DEVICE_NOTIFIER_STATE_STOP) + else if (state == DEVICED_NOTIFIER_STATE_STOP) remove_power_supply_handler(); return 0; @@ -1505,9 +1505,9 @@ static void power_supply_init(void *data) /* process check battery timer until booting done */ power_supply_timer_start(); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_EVENT_HANDLER, event_handler_state_changed); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LCD, handle_display_state_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_EVENT_HANDLER, event_handler_state_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD, handle_display_state_changed); ret = gdbus_add_object(NULL, DEVICED_PATH_BATTERY, &dbus_interface); if (ret < 0) @@ -1520,10 +1520,10 @@ static void power_supply_init(void *data) static void power_supply_exit(void *data) { - device_notifier_state_e state = DEVICE_NOTIFIER_STATE_STOP; + device_notifier_state_e state = DEVICED_NOTIFIER_STATE_STOP; - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_EVENT_HANDLER, event_handler_state_changed); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_EVENT_HANDLER, event_handler_state_changed); event_handler_state_changed((void *)&state); diff --git a/src/core/delayed-init-notifier.c b/src/core/delayed-init-notifier.c index 92f5470..6f0754b 100644 --- a/src/core/delayed-init-notifier.c +++ b/src/core/delayed-init-notifier.c @@ -67,7 +67,7 @@ static gboolean delayed_init_timer_cb(void *data) _I("delayed init"); done = 1; - syscommon_notifier_emit_notify_once(DEVICE_NOTIFIER_DELAYED_INIT, (void *)&done); + syscommon_notifier_emit_notify_once(DEVICED_NOTIFIER_DELAYED_INIT, (void *)&done); return G_SOURCE_REMOVE; } @@ -81,7 +81,7 @@ static void delayed_init_done_notifier_init(void *data) _I("restart booting done"); return; } - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); delayed_init_timer = g_timeout_add_seconds(DELAYED_INIT_WAIT_TIME, delayed_init_timer_cb, NULL); diff --git a/src/core/event-handler.c b/src/core/event-handler.c index cdd6bfc..21095ea 100644 --- a/src/core/event-handler.c +++ b/src/core/event-handler.c @@ -26,16 +26,16 @@ #include "shared/device-notifier.h" #include "log.h" -static device_notifier_state_e state = DEVICE_NOTIFIER_STATE_STOP; +static device_notifier_state_e state = DEVICED_NOTIFIER_STATE_STOP; static GVariant *dbus_start_event_handler(GDBusConnection *conn, const gchar *sender, const gchar *path, const gchar *iface, const gchar *name, GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data) { - if (state != DEVICE_NOTIFIER_STATE_START) { + if (state != DEVICED_NOTIFIER_STATE_START) { _D("Start event-handler."); - state = DEVICE_NOTIFIER_STATE_START; - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_EVENT_HANDLER, (void *)&state); + state = DEVICED_NOTIFIER_STATE_START; + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_EVENT_HANDLER, (void *)&state); } return g_variant_new("(i)", 0); } @@ -44,10 +44,10 @@ static GVariant *dbus_stop_event_handler(GDBusConnection *conn, const gchar *sender, const gchar *path, const gchar *iface, const gchar *name, GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data) { - if (state != DEVICE_NOTIFIER_STATE_STOP) { + if (state != DEVICED_NOTIFIER_STATE_STOP) { _D("Stop event-handler."); - state = DEVICE_NOTIFIER_STATE_STOP; - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_EVENT_HANDLER, (void *)&state); + state = DEVICED_NOTIFIER_STATE_STOP; + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_EVENT_HANDLER, (void *)&state); } return g_variant_new("(i)", 0); } @@ -95,7 +95,7 @@ static void event_handler_init(void *data) if (ret < 0) _E("Failed to init dbus method: %d", ret); - state = DEVICE_NOTIFIER_STATE_START; + state = DEVICED_NOTIFIER_STATE_START; } static const struct device_ops event_handler_device_ops = { diff --git a/src/core/main.c b/src/core/main.c index 7c560ad..d040c23 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -89,7 +89,7 @@ static void deviced_dbus_name_acquired(GDBusConnection *connection, const gchar if (ret == 1) { /* Restarted: deviced was terminated */ _I("Notify relaunch."); - syscommon_notifier_emit_notify_once(DEVICE_NOTIFIER_DELAYED_INIT, &ret); + syscommon_notifier_emit_notify_once(DEVICED_NOTIFIER_DELAYED_INIT, &ret); } _I("sd_notify(READY=1)"); diff --git a/src/core/udev.c b/src/core/udev.c index 81f3da8..a9661e6 100644 --- a/src/core/udev.c +++ b/src/core/udev.c @@ -266,10 +266,10 @@ static int device_event_handler(void *data) { device_notifier_state_e state = *(device_notifier_state_e *)data; - if (state == DEVICE_NOTIFIER_STATE_START) { + if (state == DEVICED_NOTIFIER_STATE_START) { uevent_control_start(KERNEL, &kevent); uevent_control_start(UDEV, &uevent); - } else if (state == DEVICE_NOTIFIER_STATE_STOP) { + } else if (state == DEVICED_NOTIFIER_STATE_STOP) { uevent_control_stop(&kevent); uevent_control_stop(&uevent); } @@ -286,8 +286,8 @@ static int device_change_poweroff(void *data) static void udev_init(void *data) { - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_POWEROFF, device_change_poweroff); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_EVENT_HANDLER, device_event_handler); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_POWEROFF, device_change_poweroff); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_EVENT_HANDLER, device_event_handler); if (uevent_control_start(KERNEL, &kevent) != 0) _E("Failed to init uevent kernel control."); @@ -298,8 +298,8 @@ static void udev_init(void *data) static void udev_exit(void *data) { - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_EVENT_HANDLER, device_event_handler); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_POWEROFF, device_change_poweroff); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_EVENT_HANDLER, device_event_handler); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_POWEROFF, device_change_poweroff); } static const struct device_ops udev_device_ops = { diff --git a/src/cpu/pmqos.c b/src/cpu/pmqos.c index c832ce7..7182b04 100644 --- a/src/cpu/pmqos.c +++ b/src/cpu/pmqos.c @@ -217,8 +217,8 @@ static int delayed_init_done(void *data) _I("Booting done."); /* register notifier for each event */ - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_CPU_BOOST_LOWBAT, pmqos_lowbat); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_CPU_BOOST_POWEROFF, pmqos_poweroff); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_CPU_BOOST_LOWBAT, pmqos_lowbat); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_CPU_BOOST_POWEROFF, pmqos_poweroff); out: return done; @@ -238,15 +238,15 @@ static void pmqos_init(void *data) if (ret < 0) _E("Failed to init dbus method: %d", ret); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); } static void pmqos_exit(void *data) { /* unregister notifier for each event */ - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_CPU_BOOST_LOWBAT, pmqos_lowbat); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_CPU_BOOST_POWEROFF, pmqos_poweroff); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_CPU_BOOST_LOWBAT, pmqos_lowbat); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_CPU_BOOST_POWEROFF, pmqos_poweroff); } static const struct device_ops pmqos_device_ops = { diff --git a/src/display/ambient-mode.c b/src/display/ambient-mode.c index b5cbfe2..6722048 100644 --- a/src/display/ambient-mode.c +++ b/src/display/ambient-mode.c @@ -99,7 +99,7 @@ static void ambient_set_condition(keynode_t *key_nodes, void *data) _I("Ambient mode condition is %d.", ambient_condition); state = (ambient_condition == 0 ? 0 : 1); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_DISPLAY_AMBIENT_CONDITION, (void *)&state); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_DISPLAY_AMBIENT_CONDITION, (void *)&state); display_plugin_set_dim_state(state); } @@ -129,7 +129,7 @@ int ambient_set_state(int on) ambient_state = on; - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_DISPLAY_AMBIENT_STATE, (void *)&ambient_state); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_DISPLAY_AMBIENT_STATE, (void *)&ambient_state); return 0; } diff --git a/src/display/display-backlight.c b/src/display/display-backlight.c index 6aeb355..7e29b59 100644 --- a/src/display/display-backlight.c +++ b/src/display/display-backlight.c @@ -143,7 +143,7 @@ int display_backlight_set_brightness(int brightness) brightness = brightness * max_brightness / 100; _I("set brightness %d (default:%d)", brightness, default_brightness); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_DISPLAY_BRIGHTNESS, (void *)&brightness); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_DISPLAY_BRIGHTNESS, (void *)&brightness); return hal_device_display_set_brightness(brightness); } diff --git a/src/display/display-dbus.c b/src/display/display-dbus.c index bfeb6fc..c8ca11a 100644 --- a/src/display/display-dbus.c +++ b/src/display/display-dbus.c @@ -1483,11 +1483,11 @@ static void changestate_signal_handler(GDBusConnection *conn, if (!strcmp(state, "bg")) { _D("process(%d) was going background.", pid); set_app_state(pid, APPLICATION_BACKGROUND); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_APPLICATION_BACKGROUND, &pid); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_APPLICATION_BACKGROUND, &pid); } else if (!strcmp(state, "fg")) { _D("process(%d) was going foreground.", pid); set_app_state(pid, APPLICATION_FOREGROUND); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_APPLICATION_FOREGROUND, &pid); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_APPLICATION_FOREGROUND, &pid); } out: @@ -1511,7 +1511,7 @@ static void app_terminate_signal_handler(GDBusConnection *conn, } set_app_state(pid, APPLICATION_TERMINATED); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_APPLICATION_TERMINATED, &pid); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_APPLICATION_TERMINATED, &pid); } /* diff --git a/src/display/display-lock.c b/src/display/display-lock.c index 77189f1..bb12c2d 100644 --- a/src/display/display-lock.c +++ b/src/display/display-lock.c @@ -652,7 +652,7 @@ static void proc_condition_lock(PMMsg *data) _SD("be requested LOCK info pname(%s), flags(%d)", pname, flags); set_lock_time(pid, pname, state); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_DISPLAY_LOCK, (void *)&value); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_DISPLAY_LOCK, (void *)&value); } static void proc_condition_unlock(PMMsg *data) @@ -705,7 +705,7 @@ static void proc_condition_unlock(PMMsg *data) _SD("be requested UNLOCK info pname(%s) flag(%d)", pname, flags); set_unlock_time(pid, state); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_DISPLAY_LOCK, (void *)&value); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_DISPLAY_LOCK, (void *)&value); } /* FIXME: This function will be refactored or divided according to role */ diff --git a/src/display/display-misc.c b/src/display/display-misc.c index 3e8971f..e96165e 100644 --- a/src/display/display-misc.c +++ b/src/display/display-misc.c @@ -133,12 +133,12 @@ static int changed_battery_health(void *data) void display_misc_register_battery_health_notifier(void) { - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_BATTERY_HEALTH, changed_battery_health); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_BATTERY_HEALTH, changed_battery_health); } void display_misc_unregister_battery_health_notifier(void) { - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_BATTERY_HEALTH, changed_battery_health); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_BATTERY_HEALTH, changed_battery_health); } static void print_info(int fd) diff --git a/src/display/display-panel.c b/src/display/display-panel.c index d79b6e9..3492c45 100644 --- a/src/display/display-panel.c +++ b/src/display/display-panel.c @@ -309,7 +309,7 @@ void display_panel_lcd_off_procedure(enum device_flags flag) /* notification */ - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LCD_OFF, NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LCD_OFF, NULL); if (lcd_on_broadcasted) { broadcast_lcd_off(SIGNAL_PRE, flags); @@ -327,7 +327,7 @@ void display_panel_lcd_off_procedure(enum device_flags flag) display_stop_dependent_device(flags); broadcast_lcd_off(SIGNAL_POST, flags); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LCD_OFF_COMPLETE, NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LCD_OFF_COMPLETE, NULL); enter_doze(); } diff --git a/src/display/display-signal.c b/src/display/display-signal.c index 33502dc..c863365 100644 --- a/src/display/display-signal.c +++ b/src/display/display-signal.c @@ -102,7 +102,7 @@ void broadcast_lcd_off_late(enum device_flags flags) if (flags & LCD_OFF_LATE_MODE) { broadcast_lcd_off(SIGNAL_POST, late_flags); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LCD_OFF_COMPLETE, NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LCD_OFF_COMPLETE, NULL); } else { late_flags = flags; } @@ -144,12 +144,12 @@ static int broadcast_brightness_changed(void *data) void display_signal_register_display_brightness_notifier(void) { - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DISPLAY_BRIGHTNESS, broadcast_brightness_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DISPLAY_BRIGHTNESS, broadcast_brightness_changed); } void display_signal_unregister_display_brightness_notifier(void) { - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_DISPLAY_BRIGHTNESS, broadcast_brightness_changed); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_DISPLAY_BRIGHTNESS, broadcast_brightness_changed); } static void __CONSTRUCTOR__ initialize(void) diff --git a/src/display/display-state-transition.c b/src/display/display-state-transition.c index ca65769..c58b2cb 100644 --- a/src/display/display-state-transition.c +++ b/src/display/display-state-transition.c @@ -727,7 +727,7 @@ static int display_state_transition_do_state_action(int timeout) set_setting_pmstate(current); pm_cur_state = current; - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_LCD, (void *)&pm_cur_state); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_LCD, (void *)&pm_cur_state); } if ((previous == DEVICED_DISPLAY_STATE_ON) && (current != DEVICED_DISPLAY_STATE_ON)) { diff --git a/src/display/display.c b/src/display/display.c index 3874e8b..9d514dc 100644 --- a/src/display/display.c +++ b/src/display/display.c @@ -525,14 +525,14 @@ static void display_init(void *data) register_kernel_uevent_control(&lcd_uevent_ops); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_APPLICATION_BACKGROUND, display_app_background); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_APPLICATION_FOREGROUND, display_app_foreground); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_APPLICATION_TERMINATED, display_app_terminated); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_APPLICATION_BACKGROUND, display_app_background); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_APPLICATION_FOREGROUND, display_app_foreground); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_APPLICATION_TERMINATED, display_app_terminated); display_signal_register_display_brightness_notifier(); display_misc_register_battery_health_notifier(); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_POWER_RESUME_FROM_ECHO_MEM, power_resume_from_echomem_callback); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_POWEROFF_TRIGGERED, poweroff_triggered_callback); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_POWER_RESUME_FROM_ECHO_MEM, power_resume_from_echomem_callback); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_POWEROFF_TRIGGERED, poweroff_triggered_callback); init_save_userlock(); @@ -544,7 +544,7 @@ static void display_init(void *data) if (timeout_enable) display_initialize_display_state_timeout_from_setting(); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_VITAL_STATE, vital_state_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_VITAL_STATE, vital_state_changed); _I("input init"); ret = input_init_handler(); @@ -671,15 +671,15 @@ static void display_exit(void *data) if (!check_default(ops)) ops->start(NORMAL_MODE); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_VITAL_STATE, vital_state_changed); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_APPLICATION_BACKGROUND, display_app_background); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_APPLICATION_FOREGROUND, display_app_foreground); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_APPLICATION_TERMINATED, display_app_terminated); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_VITAL_STATE, vital_state_changed); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_APPLICATION_BACKGROUND, display_app_background); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_APPLICATION_FOREGROUND, display_app_foreground); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_APPLICATION_TERMINATED, display_app_terminated); display_misc_unregister_battery_health_notifier(); display_signal_unregister_display_brightness_notifier(); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_POWER_RESUME_FROM_ECHO_MEM, power_resume_from_echomem_callback); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_POWEROFF_TRIGGERED, poweroff_triggered_callback); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_POWER_RESUME_FROM_ECHO_MEM, power_resume_from_echomem_callback); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_POWEROFF_TRIGGERED, poweroff_triggered_callback); display_unregister_dependent_device(); free_lock_info_list(); diff --git a/src/display/lock-detector.c b/src/display/lock-detector.c index 64fc6d0..0194654 100644 --- a/src/display/lock-detector.c +++ b/src/display/lock-detector.c @@ -371,5 +371,5 @@ void pm_lock_detector_init(void) return; } - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_POWEROFF, pmlock_detector_poweroff_cb); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_POWEROFF, pmlock_detector_poweroff_cb); } diff --git a/src/extcon/cradle.c b/src/extcon/cradle.c index 57f9c70..76bce47 100644 --- a/src/extcon/cradle.c +++ b/src/extcon/cradle.c @@ -124,7 +124,7 @@ static void cradle_init(void *data) { int ret; - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LCD, display_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD, display_changed); ret = gdbus_add_object(NULL, DEVICED_PATH_SYSNOTI, &dbus_interface); if (ret < 0) @@ -133,7 +133,7 @@ static void cradle_init(void *data) static void cradle_exit(void *data) { - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_LCD, display_changed); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_LCD, display_changed); } static struct extcon_ops cradle_extcon_ops = { diff --git a/src/extcon/extcon.c b/src/extcon/extcon.c index e3e8aac..1c10fcf 100644 --- a/src/extcon/extcon.c +++ b/src/extcon/extcon.c @@ -456,7 +456,7 @@ static void remove_extcon_event_handler(void) static int event_handler_state_changed(void *data) { - static device_notifier_state_e old = DEVICE_NOTIFIER_STATE_STOP; + static device_notifier_state_e old = DEVICED_NOTIFIER_STATE_STOP; device_notifier_state_e state = *(device_notifier_state_e *)data; if (old == state) @@ -464,9 +464,9 @@ static int event_handler_state_changed(void *data) old = state; - if (state == DEVICE_NOTIFIER_STATE_START) + if (state == DEVICED_NOTIFIER_STATE_START) add_extcon_event_handler(); - else if (state == DEVICE_NOTIFIER_STATE_STOP) + else if (state == DEVICED_NOTIFIER_STATE_STOP) remove_extcon_event_handler(); return 0; @@ -480,7 +480,7 @@ static void extcon_deferred_init(void) { GList *l; struct extcon_ops *dev; - device_notifier_state_e state = DEVICE_NOTIFIER_STATE_START; + device_notifier_state_e state = DEVICED_NOTIFIER_STATE_START; static int initialized = false; if (initialized) @@ -500,7 +500,7 @@ static void extcon_deferred_init(void) } event_handler_state_changed((void *)&state); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_EVENT_HANDLER, event_handler_state_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_EVENT_HANDLER, event_handler_state_changed); initialized = true; } @@ -531,16 +531,16 @@ static void extcon_init(void *data) if (retval < 0) _E("Failed to init dbus method: %d", retval); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); } static void extcon_exit(void *data) { GList *l; struct extcon_ops *dev; - device_notifier_state_e state = DEVICE_NOTIFIER_STATE_STOP; + device_notifier_state_e state = DEVICED_NOTIFIER_STATE_STOP; - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_EVENT_HANDLER, event_handler_state_changed); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_EVENT_HANDLER, event_handler_state_changed); event_handler_state_changed((void *)&state); diff --git a/src/led/touch-key.c b/src/led/touch-key.c index 34acea4..e8df615 100644 --- a/src/led/touch-key.c +++ b/src/led/touch-key.c @@ -258,7 +258,7 @@ static void touchled_init(void *data) vconf_notify_key_changed(VCONFKEY_SETAPPL_TOUCHKEY_LIGHT_DURATION, hardkey_duration_cb, NULL); /* register notifier */ - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LCD, hardkey_lcd_changed_cb); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD, hardkey_lcd_changed_cb); /* update touchkey light duration right now */ if (hardkey_duration == KEYBACKLIGHT_TIME_ALWAYS_ON) @@ -268,7 +268,7 @@ static void touchled_init(void *data) static void touchled_exit(void *data) { /* unregister notifier */ - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_LCD, hardkey_lcd_changed_cb); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_LCD, hardkey_lcd_changed_cb); vconf_ignore_key_changed(VCONFKEY_SETAPPL_TOUCHKEY_LIGHT_DURATION, hardkey_duration_cb); diff --git a/src/power/power-boot.c b/src/power/power-boot.c index aa10f20..6bbceab 100644 --- a/src/power/power-boot.c +++ b/src/power/power-boot.c @@ -81,7 +81,7 @@ static void delayed_init_done_received(GDBusConnection *conn, return; } CRITICAL_LOG("System session is ready."); - syscommon_notifier_emit_notify_once(DEVICE_NOTIFIER_DELAYED_INIT, &system_done); + syscommon_notifier_emit_notify_once(DEVICED_NOTIFIER_DELAYED_INIT, &system_done); } else if (strcmp(name, SYSTEMD_DBUS_SIGNAL_USER_STARTUP_FINISHED) == 0) { if (user_done) diff --git a/src/power/power-doze.c b/src/power/power-doze.c index 6bfea4f..b7375ae 100644 --- a/src/power/power-doze.c +++ b/src/power/power-doze.c @@ -173,7 +173,7 @@ int doze_init(void) doze_level = DOZE_LEVEL_0; - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LCD, display_changed_cb); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD, display_changed_cb); doze_initialized = true; _D("Doze mode initialized. doze_mode: %d.", doze_mode); @@ -185,7 +185,7 @@ int doze_exit(void) { doze_initialized = false; - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_LCD, display_changed_cb); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_LCD, display_changed_cb); return 0; } diff --git a/src/power/power-event-lock.c b/src/power/power-event-lock.c index 8da70cb..37fdb6d 100644 --- a/src/power/power-event-lock.c +++ b/src/power/power-event-lock.c @@ -117,8 +117,8 @@ static int power_event_unlock_callback(void *data, void *udata) } static void register_power_event_lock_controller(enum eventlock_type type, - enum device_notifier_type lock_notify, - enum device_notifier_type unlock_notify) + enum deviced_notifier lock_notify, + enum deviced_notifier unlock_notify) { /* Acquiring lock must be followed by all the other notifiers, therefore * give a large enough number as priority to make it be at the head of notifier list. @@ -154,18 +154,18 @@ void power_event_lock_init(void) /* general events, mostly defined by configuration file */ register_power_event_lock_controller(EL_EVENT_ACTION, - DEVICE_NOTIFIER_EVENT_ACQUIRE_WAKELOCK, - DEVICE_NOTIFIER_EVENT_RELEASE_WAKELOCK); + DEVICED_NOTIFIER_EVENT_ACQUIRE_WAKELOCK, + DEVICED_NOTIFIER_EVENT_RELEASE_WAKELOCK); /* key input event */ register_power_event_lock_controller(EL_KEY, - DEVICE_NOTIFIER_KEY_PRESS, - DEVICE_NOTIFIER_KEY_RELEASE); + DEVICED_NOTIFIER_KEY_PRESS, + DEVICED_NOTIFIER_KEY_RELEASE); /* charger event */ if (charger_wakelock) { register_power_event_lock_controller(EL_CHARGER, - DEVICE_NOTIFIER_BATTERY_CHARGER_CONNECTED, - DEVICE_NOTIFIER_BATTERY_CHARGER_DISCONNECTED); + DEVICED_NOTIFIER_BATTERY_CHARGER_CONNECTED, + DEVICED_NOTIFIER_BATTERY_CHARGER_DISCONNECTED); } } diff --git a/src/power/power-off.c b/src/power/power-off.c index 355fb03..17bb60f 100644 --- a/src/power/power-off.c +++ b/src/power/power-off.c @@ -253,7 +253,7 @@ static gboolean __poweroff_main(gpointer data) poweroff_delay_for_seconds(); disable_display(); - /* Below functions follow after notifying DEVICE_NOTIFIER_POWEROFF + /* Below functions follow after notifying DEVICED_NOTIFIER_POWEROFF 1. pmlock - pmlock_detector_poweroff_cb() - cleanup_pmlock_statistics() @@ -266,7 +266,7 @@ static gboolean __poweroff_main(gpointer data) - device_change_poweroff() - uevent_control_stop() */ - syscommon_notifier_emit_notify_once(DEVICE_NOTIFIER_POWEROFF, data); + syscommon_notifier_emit_notify_once(DEVICED_NOTIFIER_POWEROFF, data); poweroff_request_shutdown(state); @@ -313,7 +313,7 @@ void poweroff_prepare(uint64_t state) _W("Failed to set vconf value for power off status: %d", vconf_get_ext_errno()); power_exit_autosleep(); - syscommon_notifier_emit_notify_once(DEVICE_NOTIFIER_POWEROFF_TRIGGERED, (void *)(intptr_t) vconf); + syscommon_notifier_emit_notify_once(DEVICED_NOTIFIER_POWEROFF_TRIGGERED, (void *)(intptr_t) vconf); /* Poweroff event broadcasting */ system_shutdown_send_system_event(); @@ -480,7 +480,7 @@ void power_off_init(void) add_delayed_init_done_handler(NULL); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); ret_val = config_parse(POWER_CONF_FILE, load_config, NULL); if (ret_val < 0) diff --git a/src/power/power-suspend.c b/src/power/power-suspend.c index 410c0fb..c4d8e76 100644 --- a/src/power/power-suspend.c +++ b/src/power/power-suspend.c @@ -408,7 +408,7 @@ static void suspend_echo_mem(void) static void resume_echo_mem(void) { - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_POWER_RESUME_FROM_ECHO_MEM, NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_POWER_RESUME_FROM_ECHO_MEM, NULL); } static void suspend_autosleep(void) diff --git a/src/power/power.c b/src/power/power.c index 29e719c..b854035 100644 --- a/src/power/power.c +++ b/src/power/power.c @@ -308,7 +308,7 @@ static void post_action_sleep(const void *udata) static void pre_action_poweroff(const void *data) { // do not transition anymore after poweroff - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_REQUEST_TRANSITION_STATE, transition_request_callback); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_REQUEST_TRANSITION_STATE, transition_request_callback); poweroff_prepare(current); } @@ -813,8 +813,8 @@ void power_state_init(void *data) if (ret < 0) _W("Failed to load '%s'(%d)", POWER_CONF_FILE, ret); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_callback); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_REQUEST_TRANSITION_STATE, transition_request_callback); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_callback); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_REQUEST_TRANSITION_STATE, transition_request_callback); power_dbus_init(); power_off_init(); diff --git a/src/power/power.h b/src/power/power.h index 0bd5ab0..1c11d8b 100644 --- a/src/power/power.h +++ b/src/power/power.h @@ -102,7 +102,7 @@ static inline void power_request_change_state_strict(uint64_t curr, uint64_t nex struct trans_info ti = { curr, next, reason, udata }; GList l = { &ti, NULL, NULL }; - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_REQUEST_TRANSITION_STATE, &l); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_REQUEST_TRANSITION_STATE, &l); } static inline void power_request_change_state(uint64_t next, int reason) diff --git a/src/shared/device-notifier.h b/src/shared/device-notifier.h index 66a31c0..380a442 100644 --- a/src/shared/device-notifier.h +++ b/src/shared/device-notifier.h @@ -21,65 +21,12 @@ #define __DEVICE_NOTIFIER_H__ #include - -enum device_notifier_type { - DEVICE_NOTIFIER_MIN, - DEVICE_NOTIFIER_DAEMON_RESTARTED = DEVICE_NOTIFIER_MIN, - DEVICE_NOTIFIER_DELAYED_INIT, - DEVICE_NOTIFIER_LCD, - DEVICE_NOTIFIER_LCD_OFF, - DEVICE_NOTIFIER_LCD_OFF_COMPLETE, - DEVICE_NOTIFIER_LCD_AUTOBRT_SENSING, - DEVICE_NOTIFIER_LOWBAT, - DEVICE_NOTIFIER_FULLBAT, - DEVICE_NOTIFIER_POWER_SUPPLY, - DEVICE_NOTIFIER_BATTERY_HEALTH, - DEVICE_NOTIFIER_BATTERY_PRESENT, - DEVICE_NOTIFIER_BATTERY_OVP, - DEVICE_NOTIFIER_BATTERY_CHARGING, - DEVICE_NOTIFIER_BATTERY_CHARGER_CONNECTED, - DEVICE_NOTIFIER_BATTERY_CHARGER_DISCONNECTED, - DEVICE_NOTIFIER_DISPLAY_AMBIENT_CONDITION, - DEVICE_NOTIFIER_DISPLAY_AMBIENT_STATE, - DEVICE_NOTIFIER_DISPLAY_LOCK, - DEVICE_NOTIFIER_POWER_RESUME_FROM_ECHO_MEM, - DEVICE_NOTIFIER_POWEROFF_TRIGGERED, - DEVICE_NOTIFIER_POWEROFF, - DEVICE_NOTIFIER_APPLICATION_BACKGROUND, - DEVICE_NOTIFIER_APPLICATION_FOREGROUND, - DEVICE_NOTIFIER_APPLICATION_TERMINATED, - DEVICE_NOTIFIER_USB_DEBUG_MODE, - DEVICE_NOTIFIER_USB_TETHERING_MODE, - DEVICE_NOTIFIER_EVENT_HANDLER, - DEVICE_NOTIFIER_CPU_BOOST_LOWBAT, - DEVICE_NOTIFIER_CPU_BOOST_POWEROFF, - /* Experimental for Specific device - contact to deviced owner */ - DEVICE_NOTIFIER_PMQOS, - DEVICE_NOTIFIER_PMQOS_ULTRAPOWERSAVING, - DEVICE_NOTIFIER_PMQOS_POWERSAVING, - DEVICE_NOTIFIER_COOL_DOWN, - DEVICE_NOTIFIER_VITAL_STATE, - DEVICE_NOTIFIER_LONGKEY_RESTORE, - DEVICE_NOTIFIER_UPSM, - DEVICE_NOTIFIER_UPSM_OFF, - DEVICE_NOTIFIER_BEZEL_WAKEUP, - DEVICE_NOTIFIER_DISPLAY_BRIGHTNESS, - DEVICE_NOTIFIER_ULTRAPOWERSAVING, - DEVICE_NOTIFIER_KEY_PRESS, - DEVICE_NOTIFIER_KEY_RELEASE, - DEVICE_NOTIFIER_EVENT_ACQUIRE_WAKELOCK, - DEVICE_NOTIFIER_EVENT_RELEASE_WAKELOCK, - - /* Purpose of calling methods of different modules - * Use prefix DEVICE_NOTIFIER_REQUEST */ - DEVICE_NOTIFIER_REQUEST_TRANSITION_STATE, - DEVICE_NOTIFIER_MAX, -}; +#include typedef enum _device_notifier_state { - DEVICE_NOTIFIER_STATE_STOP, - DEVICE_NOTIFIER_STATE_START, - DEVICE_NOTIFIER_STATE_CHANGED, + DEVICED_NOTIFIER_STATE_STOP, + DEVICED_NOTIFIER_STATE_START, + DEVICED_NOTIFIER_STATE_CHANGED, /* add more states here */ } device_notifier_state_e; diff --git a/src/shared/event.c b/src/shared/event.c index 0eb03d3..f0d64ad 100644 --- a/src/shared/event.c +++ b/src/shared/event.c @@ -33,7 +33,7 @@ static gboolean event_release_wakelock(gpointer data) _D("Decreased counter=%d, eventid=%d", wakelock_counter, eventid); if (wakelock_counter == 0) - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_EVENT_RELEASE_WAKELOCK, NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_EVENT_RELEASE_WAKELOCK, NULL); return G_SOURCE_REMOVE; } @@ -49,5 +49,5 @@ void event_acquire_wakelock(int eventid, int timeout) g_timeout_add_seconds(timeout, event_release_wakelock, (gpointer)(intptr_t) eventid); if (wakelock_counter == 1) - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_EVENT_ACQUIRE_WAKELOCK, NULL); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_EVENT_ACQUIRE_WAKELOCK, NULL); } diff --git a/src/thermal/thermal.c b/src/thermal/thermal.c index 7c3313c..01c3196 100644 --- a/src/thermal/thermal.c +++ b/src/thermal/thermal.c @@ -85,7 +85,7 @@ static void thermal_init(void *data) { int ret; - ret = syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + ret = syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); if (ret < 0) _E("Failed to register booting done notifier."); @@ -98,7 +98,7 @@ static void thermal_exit(void *data) { int ret; - ret = syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + ret = syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); if (ret < 0) _E("Failed to unregister booting done notifier."); diff --git a/src/time/time-handler.c b/src/time/time-handler.c index 69ce017..1fc256d 100644 --- a/src/time/time-handler.c +++ b/src/time/time-handler.c @@ -391,7 +391,7 @@ static void time_init(void *data) if (timerfd_check_start() == -1) _E("Failed system time change detector init."); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_LCD, time_lcd_changed_cb); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_LCD, time_lcd_changed_cb); } static const struct device_ops time_device_ops = { diff --git a/src/touchscreen/sensitivity.c b/src/touchscreen/sensitivity.c index 2d72637..c703d96 100644 --- a/src/touchscreen/sensitivity.c +++ b/src/touchscreen/sensitivity.c @@ -158,7 +158,7 @@ static int delayed_init_done(void *data) } ret = hal_device_touchscreen_glove_mode_set_state(TOUCHSENSITIVITY_GLOVE_MODE_ON); _I("Change auto touch sensitivity enable: %s", ret ? "fail" : "set"); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); out: return done; } @@ -195,7 +195,7 @@ static void sensitivity_init(void *data) if (ret <= 0) _E("Failed to register signal handler: %d", ret); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); } static const struct device_ops sensitivity_device_ops = { diff --git a/src/touchscreen/touchscreen.c b/src/touchscreen/touchscreen.c index 1d645fa..3ea40e4 100644 --- a/src/touchscreen/touchscreen.c +++ b/src/touchscreen/touchscreen.c @@ -333,7 +333,7 @@ static void touchscreen_init(void *data) if (ret < 0) _E("Failed to init dbus method. (%d)", ret); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); } static const struct device_ops touchscreen_device_ops = { diff --git a/src/tzip/tzip.c b/src/tzip/tzip.c index 51aeb0a..5035280 100644 --- a/src/tzip/tzip.c +++ b/src/tzip/tzip.c @@ -1166,8 +1166,8 @@ static void tzip_init(void *data) tzip_lock_init(); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_POWEROFF, tzip_poweroff); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_POWEROFF, tzip_poweroff); ret = gdbus_add_object(NULL, DEVICED_PATH_TZIP, &dbus_interface); if (ret < 0) @@ -1182,8 +1182,8 @@ static void tzip_exit(void *data) { _D("tzip_exit"); tzip_server_exit(); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_POWEROFF, tzip_poweroff); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_POWEROFF, tzip_poweroff); tzip_lock_deinit(); } diff --git a/src/usb-gadget/usb-debug.c b/src/usb-gadget/usb-debug.c index 6611fdf..be4d702 100644 --- a/src/usb-gadget/usb-debug.c +++ b/src/usb-gadget/usb-debug.c @@ -77,7 +77,7 @@ static void usb_debug_changed(keynode_t *key, void *data) _I("USB debug mode is changed to %s.", mode ? "ON" : "OFF"); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_USB_DEBUG_MODE, (void *)(intptr_t) mode); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_USB_DEBUG_MODE, (void *)(intptr_t) mode); } static int usb_debug_mode_changed(void *on) @@ -106,7 +106,7 @@ void add_usb_debug_handler(void) usb_debug_changed, NULL) != VCONF_OK) _E("Failed to add USB debug handler."); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_USB_DEBUG_MODE, usb_debug_mode_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_USB_DEBUG_MODE, usb_debug_mode_changed); if (vconf_get_bool(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, &state) == VCONF_OK) debug_state = (state == 0 ? false : true); @@ -117,5 +117,5 @@ void add_usb_debug_handler(void) void remove_usb_debug_handler(void) { vconf_ignore_key_changed(VCONFKEY_SETAPPL_USB_DEBUG_MODE_BOOL, usb_debug_changed); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_USB_DEBUG_MODE, usb_debug_mode_changed); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_USB_DEBUG_MODE, usb_debug_mode_changed); } diff --git a/src/usb-gadget/usb-tethering.c b/src/usb-gadget/usb-tethering.c index ce1b3cc..ca579a5 100644 --- a/src/usb-gadget/usb-tethering.c +++ b/src/usb-gadget/usb-tethering.c @@ -49,7 +49,7 @@ static void usb_tethering_changed(keynode_t *key, void *data) _I("USB tethering mode is changed to %s.", curr ? "ON" : "OFF"); - syscommon_notifier_emit_notify(DEVICE_NOTIFIER_USB_TETHERING_MODE, (void *)curr); + syscommon_notifier_emit_notify(DEVICED_NOTIFIER_USB_TETHERING_MODE, (void *)curr); } static int usb_tethering_mode_changed(void *on) @@ -99,12 +99,12 @@ void add_usb_tethering_handler(void) if (vconf_notify_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE, usb_tethering_changed, NULL) != VCONF_OK) _E("Failed to add USB tethering handler."); - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_USB_TETHERING_MODE, usb_tethering_mode_changed); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_USB_TETHERING_MODE, usb_tethering_mode_changed); } void remove_usb_tethering_handler(void) { vconf_ignore_key_changed(VCONFKEY_MOBILE_HOTSPOT_MODE, usb_tethering_changed); - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_USB_TETHERING_MODE, usb_tethering_mode_changed); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_USB_TETHERING_MODE, usb_tethering_mode_changed); } diff --git a/src/usb-host/usb-host.c b/src/usb-host/usb-host.c index 377d0d1..7dc2936 100644 --- a/src/usb-host/usb-host.c +++ b/src/usb-host/usb-host.c @@ -1124,7 +1124,7 @@ static int delayed_init_done(void *data) usbhost_init_from_udev_enumerate(); /* unregister booting done notifier */ - syscommon_notifier_unsubscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_unsubscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); return 0; } @@ -1147,7 +1147,7 @@ static void usbhost_init(void *data) _E("Failed to register dbus interface and method: %d", ret); /* register notifier */ - syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_DELAYED_INIT, delayed_init_done); + syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_DELAYED_INIT, delayed_init_done); ret = asprintf(&POLICY_FILEPATH, "%s/%s", ROOTPATH, POLICY_FILENAME); if (ret < 0) {