Exemplo n.º 1
0
Arquivo: proximity.c Projeto: g7/mce
const gchar *g_module_check_init(GModule *module)
{
	(void)module;

	/* Get initial state of datapipes */
	call_state = datapipe_get_gint(call_state_pipe);
	alarm_ui_state = datapipe_get_gint(alarm_ui_state_pipe);
	display_state = display_state_get();
	submode = datapipe_get_gint(submode_pipe);

	/* Append triggers/filters to datapipes */
	append_input_trigger_to_datapipe(&call_state_pipe,
					 call_state_trigger);
	append_input_trigger_to_datapipe(&alarm_ui_state_pipe,
					 alarm_ui_state_trigger);
	append_output_trigger_to_datapipe(&display_state_pipe,
					  display_state_trigger);
	append_output_trigger_to_datapipe(&submode_pipe,
					  submode_trigger);

	/* PS enabled setting */
	mce_gconf_notifier_add(MCE_GCONF_PROXIMITY_PATH,
			       MCE_GCONF_PROXIMITY_PS_ENABLED_PATH,
			       use_ps_conf_cb,
			       &use_ps_conf_id);

	mce_gconf_get_bool(MCE_GCONF_PROXIMITY_PS_ENABLED_PATH,
			   &use_ps_conf_value);

	/* enable/disable sensor based on initial conditions */
	update_proximity_monitor();

	return NULL;
}
Exemplo n.º 2
0
const gchar *g_module_check_init(GModule *module)
{
	(void)module;

	/* Append triggers/filters to datapipes */
	append_output_trigger_to_datapipe(&battery_level_pipe,
					  battery_level_trigger);
	append_output_trigger_to_datapipe(&charger_state_pipe,
					  charger_state_trigger);
	append_output_trigger_to_datapipe(&thermal_state_pipe,
					  thermal_state_trigger);

	/* Power saving mode setting */
	/* Since we've set a default, error handling is unnecessary */
	mce_gconf_notifier_add(MCE_GCONF_EM_PATH,
			       MCE_GCONF_PSM_PATH,
			       psm_gconf_cb,
			       &psm_gconf_cb_id);

	mce_gconf_get_bool(MCE_GCONF_PSM_PATH,
			   &power_saving_mode);

	/* Forced power saving mode setting */
	/* Since we've set a default, error handling is unnecessary */
	mce_gconf_notifier_add(MCE_GCONF_EM_PATH,
			       MCE_GCONF_FORCED_PSM_PATH,
			       psm_gconf_cb,
			       &force_psm_gconf_cb_id);

	mce_gconf_get_bool(MCE_GCONF_FORCED_PSM_PATH,
			   &force_psm);

	/* Power saving mode threshold */
	/* Since we've set a default, error handling is unnecessary */
	mce_gconf_notifier_add(MCE_GCONF_EM_PATH,
			       MCE_GCONF_PSM_THRESHOLD_PATH,
			       psm_gconf_cb,
			       &psm_threshold_gconf_cb_id);

	mce_gconf_get_int(MCE_GCONF_PSM_THRESHOLD_PATH,
			  &psm_threshold);

	/* Add dbus handlers */
	mce_psm_init_dbus();

	return NULL;
}
Exemplo n.º 3
0
const gchar *g_module_check_init(GModule *module)
{
	(void)module;

	/* Read lux ramps from configuration */
	als_filter_load_config(&lut_display);
	als_filter_load_config(&lut_led);
	als_filter_load_config(&lut_key);

	/* Get intial display state */
	display_state = datapipe_get_gint(display_state_pipe);

	/* Append triggers/filters to datapipes */
	append_filter_to_datapipe(&display_brightness_pipe,
				  display_brightness_filter);
	append_filter_to_datapipe(&led_brightness_pipe,
				  led_brightness_filter);
	append_filter_to_datapipe(&key_backlight_pipe,
				  key_backlight_filter);
	append_output_trigger_to_datapipe(&display_state_pipe,
					  display_state_trigger);

	/* Add dbus method call handlers */
	mce_dbus_handler_add(MCE_REQUEST_IF,
			     MCE_REQ_ALS_ENABLE,
			     NULL,
			     DBUS_MESSAGE_TYPE_METHOD_CALL,
			     als_enable_req_dbus_cb);

	mce_dbus_handler_add(MCE_REQUEST_IF,
			     MCE_REQ_ALS_DISABLE,
			     NULL,
			     DBUS_MESSAGE_TYPE_METHOD_CALL,
			     als_disable_req_dbus_cb);

	mce_dbus_handler_add(MCE_REQUEST_IF,
			     MCE_COLOR_PROFILE_GET,
			     NULL,
			     DBUS_MESSAGE_TYPE_METHOD_CALL,
			     color_profile_get_req_dbus_cb);

	mce_dbus_handler_add(MCE_REQUEST_IF,
			     MCE_COLOR_PROFILE_IDS_GET,
			     NULL,
			     DBUS_MESSAGE_TYPE_METHOD_CALL,
			     color_profile_ids_get_req_dbus_cb);

	mce_dbus_handler_add(MCE_REQUEST_IF,
			     MCE_COLOR_PROFILE_CHANGE_REQ,
			     NULL,
			     DBUS_MESSAGE_TYPE_METHOD_CALL,
			     color_profile_change_req_dbus_cb);

	/* ALS enabled setting */
	mce_gconf_notifier_add(MCE_GCONF_DISPLAY_PATH,
			       MCE_GCONF_DISPLAY_ALS_ENABLED_PATH,
			       use_als_gconf_cb,
			       &use_als_gconf_id);
	mce_gconf_get_bool(MCE_GCONF_DISPLAY_ALS_ENABLED_PATH,
			   &use_als_flag);

	/* Color profile setting */
	mce_gconf_notifier_add(MCE_GCONF_DISPLAY_PATH,
			       MCE_GCONF_DISPLAY_COLOR_PROFILE_PATH,
			       color_profile_gconf_cb,
			       &color_profile_gconf_id);
	if( init_color_profiles() )
		init_current_color_profile();

	rethink_als_status();

	return NULL;
}