The prefix DEVICE_NOTIFIER has been replaced with DEVICE'D'_NOTIFIER.
Change-Id: Ie2600c7846ca9ac898b3b20f69e36bc8c45f9b3e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
#[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
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;
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);
}
}
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);
}
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 {
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 */
/* 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);
/* 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)
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);
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;
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);
}
}
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);
}
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;
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);
}
}
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);
}
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;
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;
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;
}
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)
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 = {
_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)
/* 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);
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();
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)) {
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);
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);
}
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
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,
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);
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);
_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);
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
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;
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);
}
}
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);
}
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);
}
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);
}
_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);
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)
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 = {
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)
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;
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;
}
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);
{
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)
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);
_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);
}
}
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)
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);
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();
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);
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);
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");
}
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;
}
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)
{
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;
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;
}
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;
/* 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)
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);
_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;
}
_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);
#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);
}
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);
}
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 = {
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)");
{
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);
}
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.");
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 = {
_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;
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 = {
_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);
}
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;
}
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);
}
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:
}
set_app_state(pid, APPLICATION_TERMINATED);
- syscommon_notifier_emit_notify(DEVICE_NOTIFIER_APPLICATION_TERMINATED, &pid);
+ syscommon_notifier_emit_notify(DEVICED_NOTIFIER_APPLICATION_TERMINATED, &pid);
}
/*
_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)
_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 */
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)
/* 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);
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();
}
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;
}
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)
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)) {
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();
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();
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();
return;
}
- syscommon_notifier_subscribe_notify(DEVICE_NOTIFIER_POWEROFF, pmlock_detector_poweroff_cb);
+ syscommon_notifier_subscribe_notify(DEVICED_NOTIFIER_POWEROFF, pmlock_detector_poweroff_cb);
}
{
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)
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 = {
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)
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;
{
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)
}
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;
}
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);
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)
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);
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)
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);
{
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;
}
}
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.
/* 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);
}
}
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()
- 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);
_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();
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)
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)
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);
}
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();
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)
#define __DEVICE_NOTIFIER_H__
#include <libsyscommon/notifier.h>
-
-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 <system/syscommon-plugin-deviced-common-interface.h>
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;
_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;
}
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);
}
{
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.");
{
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.");
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 = {
}
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;
}
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 = {
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 = {
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)
{
_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();
}
_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)
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);
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);
}
_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)
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);
}
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;
}
_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) {