void MsgSettingRegVconfCB()
{
	// Set default values.
	MsgSettingGetBool(VCONFKEY_CISSAPPL_AUTO_REJECT_BOOL, &bAutoReject);
	MsgSettingGetBool(VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL, &bUnknownAutoReject);

	if (vconf_notify_key_changed(VCONFKEY_CISSAPPL_AUTO_REJECT_BOOL, MsgVconfCB, NULL) < 0) {
		MSG_DEBUG("Fail to regist vconf CB with [%s]", VCONFKEY_CISSAPPL_AUTO_REJECT_BOOL);
	}

	if (vconf_notify_key_changed(VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL, MsgVconfCB, NULL) < 0) {
		MSG_DEBUG("Fail to regist vconf CB with [%s]", VCONFKEY_CISSAPPL_AUTO_REJECT_UNKNOWN_BOOL);
	}
}
static void lockd_init_vconf(struct lockd_data *lockd)
{
	int val = -1;

	if (vconf_notify_key_changed
	    (VCONFKEY_PM_STATE, _lockd_notify_pm_state_cb, lockd) != 0) {
		LOCKD_ERR("Fail vconf_notify_key_changed : VCONFKEY_PM_STATE");
	}

	if (vconf_notify_key_changed
	    (VCONFKEY_IDLE_LOCK_STATE,
	     _lockd_notify_lock_state_cb,
	     lockd) != 0) {
		LOCKD_ERR
		    ("[Error] vconf notify : lock state");
	}
}
void MsgSettingRegVconfCBCommon(const char *pKey, _vconf_change_cb pCb)
{
	if (vconf_notify_key_changed(pKey, pCb, NULL) < 0) {
		MSG_DEBUG("Fail to regist vconf CB with [%s]", pKey);
	} else {
		MSG_DEBUG("Success to regist vconf CB with [%s]", pKey);
	}
}
static int register_battery_module(void *data)
{
	int r = 0, ret = -1;

	retif(data == NULL, FAIL, "Invalid parameter!");

	/* DO NOT change order of below fuctions */
	indicator_battery_level_init();
	indicator_battery_update_display(data);
	indicator_battery_check_charging(data);
	indicator_battery_check_percentage_option(data);

	ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_BATTERY_CAPACITY,
				       indicator_battery_change_cb, data);
	if (ret != OK) {
		ERR("Failed to register callback!");
		r = ret;
	}

	ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_BATTERY_STATUS_LOW,
				       indicator_battery_change_cb, data);
	if (ret != OK) {
		ERR("Failed to register callback!");
		r = r | ret;
	}

	ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_BATTERY_CHARGE_NOW,
				       indicator_battery_charging_cb, data);
	if (ret != OK) {
		ERR("Failed to register callback!");
		r = r | ret;
	}

	ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_BATTERY_PERCENTAGE_BOOL,
			       indicator_battery_percentage_option_cb, data);
	if (ret != OK) {
		ERR("Failed to register callback!");
		r = r | ret;
	}

	return r;
}
/**
 * @brief Negative test case of ug_init vconf_notify_key_changed()
 */
static void utc_ApplicationFW_vconf_notify_key_changed_func_02(void)
{
	int r = 0;

   	r = vconf_notify_key_changed(KEY_DB, NULL, NULL);
	if (!r) {
		tet_infoline("vconf_notify_key_changed() failed in negative test case");
		tet_result(TET_FAIL);
		return;
	}
	tet_result(TET_PASS);
}
static int register_fm_radio_module(void *data)
{
	int ret;

	retif(data == NULL, FAIL, "Invalid parameter!");

	ret = vconf_notify_key_changed(VCONFKEY_RADIO_STATE,
				       indicator_fm_radio_change_cb, data);
	if (ret != OK)
		ERR("Failed to register callback!");
	indicator_fm_radio_change_cb(NULL, data);

	return ret;
}
static int register_mmc_module(void *data)
{
	int ret;

	retif(data == NULL, FAIL, "Invalid parameter!");

	ret = vconf_notify_key_changed(VCONFKEY_FILEMANAGER_DB_STATUS,
				       indicator_mmc_change_cb, data);
	if (ret != OK)
		ERR("Failed to register mmcback!");

	indicator_mmc_change_cb(NULL, data);

	return ret;
}
/**
 * @brief Positive test case of vconf_notify_key_changed()
 */
static void utc_ApplicationFW_vconf_notify_key_changed_func_01(void)
{
	pthread_t test_thread;
	int r = 0;

   	r = vconf_notify_key_changed(KEY_DB, test_cb, NULL);
	if (r) {
		tet_infoline("vconf_notify_key_changed() failed in positive test case");
		tet_result(TET_FAIL);
		return;
	}
	pthread_create(&test_thread, NULL, test_thread1, NULL);
	pthread_detach(test_thread);

	g_main_loop_run(event_loop);
}
Ejemplo n.º 9
0
static int __add_vconf(struct appcore *ac)
{
	int i;
	int r;

	for (i = 0; i < sizeof(evtops) / sizeof(evtops[0]); i++) {
		struct evt_ops *eo = &evtops[i];

		switch (eo->type) {
		case _CB_VCONF:
			r = vconf_notify_key_changed(eo->key.vkey, __vconf_cb,
						     ac);
			break;
		default:
			/* do nothing */
			break;
		}
	}

	return 0;
}
Ejemplo n.º 10
0
bool
mp_app_noti_init(void *data)
{
	startfunc;
	struct appdata *ad = data;
	bool res = TRUE;
	if (vconf_notify_key_changed(VCONFKEY_FILEMANAGER_DB_STATUS, _mp_app_noti_changed_cb, ad) < 0)
	{
		ERROR_TRACE("Error when register callback\n");
		res = FALSE;
	}
	if (vconf_notify_key_changed(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, _mp_app_noti_changed_cb, ad) < 0)
	{
		ERROR_TRACE("Fail to register VCONFKEY_MUSIC_MENU_CHANGE key callback");
		res = FALSE;
	}
	if (vconf_notify_key_changed(MP_VCONFKEY_PLAYING_PID, _mp_app_noti_changed_cb, ad) < 0)
	{
		ERROR_TRACE("Fail to register MP_VCONFKEY_PLAYING_PID key callback");
		res = FALSE;
	}
#if 1	//Minjin
	if (vconf_notify_key_changed(MP_LIVE_PLAY_STATE, _mp_app_noti_changed_cb, ad) < 0)
	{
		ERROR_TRACE("Fail to register MP_LIVE_PLAY_STATE key callback");
		res = FALSE;
	}
#endif

	gNotiPipe = ecore_pipe_add(_mp_app_noti_pipe_handler, ad);
#ifdef MP_FEATURE_AVRCP_13
	if(!mp_avrcp_target_initialize(_mp_avrcp_connection_state_changed_cb, ad))
	{
		_mp_app_set_avrcp_mode(ad);
		if(ad->current_track_info)
		{
			mp_track_info_t *info = ad->current_track_info;
			mp_avrcp_noti_track(info->title, info->artist, info->album, info->genre, info->duration);
		}
	}

	mp_avrcp_set_mode_change_cb(_mp_app_avrcp_shuffle_changed_cb,
		_mp_app_repeat_changed_cb, _mp_app_avrcp_eq_changed_cb, ad);
#endif

	DEBUG_TRACE("Enter sound_manager_set_available_route_changed_cb");
	int ret = sound_manager_set_available_route_changed_cb(_mp_add_available_route_changed_cb, ad);
	if (ret != SOUND_MANAGER_ERROR_NONE) {
		ERROR_TRACE("sound_manager_set_available_route_changed_cb().. [0x%x]", ret);
		res = FALSE;
	}
	DEBUG_TRACE("Leave sound_manager_set_available_route_changed_cb");

	DEBUG_TRACE("Enter sound_manager_set_active_device_changed_cb");
	ret = sound_manager_set_active_device_changed_cb(_mp_app_active_device_chaged_cb, ad);
	if (ret != SOUND_MANAGER_ERROR_NONE) {
		ERROR_TRACE("sound_manager_set_active_device_changed_cb().. [0x%x]", ret);
		res = FALSE;
	}
	DEBUG_TRACE("Leave sound_manager_set_active_device_changed_cb");

	return res;
}
Ejemplo n.º 11
0
StyleMonitor::StyleMonitor(Integration::PlatformAbstraction& platformAbstraction)
: mPlatformAbstraction(platformAbstraction)
{
  vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, DefaultFontSizeChangeNotification, this );
}
int main(int argc, char **argv)
{
   int operation;

   g_type_init();
   ecore_init();
   if(argc < 2) {
      fprintf(stderr, "1:set(db), 2:set(file), 3:set(memory), 4:set(gconf_d), 5:set(gconf_l) \n");
      fprintf(stderr, "6:get(db), 7:get(file), 8:get(memory), 9:get(gconf_d), 10:get(gconf_l) \n");
      fprintf(stderr, "11:unset(db), 12:unset(file), 13:unset(memory), 14:unset(gconf_d), 15:unset(gconf_l) \n");
      return -1;
   }

   operation = atoi(argv[1]);
   switch(operation)
   {
      case 1:
         set_operation(0);
         break;
      case 2:
         set_operation(1);
         break;
      case 3:
         set_operation(2);
         break;
      case 4:
         set_operation(3);
         break;
      case 5:
         set_operation(4);
         break;
      case 6:
         get_operation(0, "db/timetest");
         break;
      case 7:
         get_operation(1, "file/timetest");
         break;
      case 8:
         get_operation(2, "memory/timetest");
         break;
      case 9:
         get_operation(3, "gconf_l/timetest");
         break;
      case 10:
         get_operation(4, "gconf_d/timetest");
         break;
      case 11:
         unset_operation(0);
         break;
      case 12:
         unset_operation(1);
         break;
      case 13:
         unset_operation(2);
         break;
      case 14:
         unset_operation(3);
         break;
      case 15:
         unset_operation(4);
         break;
      case 16:
         vconf_notify_key_changed(vconfkeys[0][1], test_cb2, NULL);
         vconf_notify_key_changed(vconfkeys[1][1], test_cb2, NULL);
         vconf_notify_key_changed(vconfkeys[2][1], test_cb2, NULL);
         vconf_notify_key_changed(vconfkeys[3][1], test_cb2, NULL);
         vconf_notify_key_changed(vconfkeys[4][1], test_cb2, NULL);

         //ecore_main_loop_begin();
         GMainLoop *event_loop;
         event_loop = g_main_loop_new(NULL, FALSE);
         g_main_loop_run(event_loop);
         break;
   }

   return 0;
}