static void indicator_battery_check_percentage_option(void *data)
{
	int ret = FAIL;
	int status = 0;

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

	/* Check Display Percentage option(Text) */
	ret = vconf_get_bool(VCONFKEY_SETAPPL_BATTERY_PERCENTAGE_BOOL, &status);
	if (ret != OK)
		ERR("Fail to get [%s: %d]",
			VCONFKEY_SETAPPL_BATTERY_PERCENTAGE_BOOL, ret);

	indicator_util_icon_hide(&battery);
	/* Hide Battery Icon and change Padding between all icons */
	if (status) {
		battery_percentage_on = EINA_TRUE;
		battery.txt_obj.width = BATTERY_TEXTWIDTH;
		battery.img_obj.width = BATTERY_IMAGEWIDTH;
		battery.type = INDICATOR_TXT_WITH_IMG_ICON;
		if (_level.current_capa < 0)
			indicator_battery_text_set(data, 0);
		else
			indicator_battery_text_set(data, _level.current_capa);
	} else {
		battery_percentage_on = EINA_FALSE;
		battery.img_obj.width = BATTERY_IMAGEWIDTH;
		battery.type = INDICATOR_IMG_ICON;
	}
	indicator_util_icon_show(&battery);
}
BT_EXPORT_API gboolean bluetooth_obex_server_is_activated(void)
{
	gboolean exist = FALSE;
	DBusGConnection *conn = NULL;
	DBusGProxy *obex_proxy = NULL;
	GError *error = NULL;
	int value = 0;

	DBG("+");

	if (vconf_get_bool(BT_VCONF_OPP_SERVER_INIT, &value) == 0) {
		if (value == TRUE) {
			/* Nativate Obex server is activated */
			return FALSE;
		}
	}

	conn = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
	if (conn == NULL)
		return FALSE;

	obex_proxy = dbus_g_proxy_new_for_name(conn,
					OBEX_SERVER_SERVICE,
					"/", OBEX_SERVER_MANAGER);

	if (obex_proxy == NULL) {
		DBG("obex_proxy is NULL \n");
		dbus_g_connection_unref(conn);
		return FALSE;
	}

	dbus_g_proxy_call(obex_proxy, "RegisterAgent", &error,
			  DBUS_TYPE_G_OBJECT_PATH, BT_INVALID_PATH,
			  G_TYPE_INVALID, G_TYPE_INVALID);
	if (error != NULL) {
		DBG("Error: %s\n", error->message);

		if (!strcmp(error->message, "Agent already exists"))
			exist = TRUE;

		g_error_free(error);
	}

	dbus_g_proxy_call(obex_proxy, "UnregisterAgent", NULL,
			  DBUS_TYPE_G_OBJECT_PATH, BT_INVALID_PATH,
			  G_TYPE_INVALID, G_TYPE_INVALID);

	g_object_unref(obex_proxy);
	dbus_g_connection_unref(conn);

	DBG("-");

	return exist;
}
int MsgSettingGetBool(const char *pKey, bool *pVal)
{
	if (pKey == NULL)
	{
		MSG_DEBUG("IN Parameter is NULL");
		return -1;
	}

	int retVal = 0, param = 0;

#ifdef USE_GCONF
	*pVal = gconf_client_get_bool((GConfClient*)pClient, pKey, NULL);
#else
	if (vconf_get_bool(pKey, &param) < 0)
		return -1;
#endif

 	*pVal = (bool)param;

	return retVal;
}
void get_operation(int i, const char* parent_dir)
{
   keylist_t *kl=NULL;
   keynode_t *temp_node;
   int get_int;
   double get_dbl;
   char *get_str;

   vconf_get_dbl(vconfkeys[i][0], &get_dbl);
   vconf_get_bool(vconfkeys[i][1], &get_int);
   get_str=vconf_get_str(vconfkeys[i][2]);
   free(get_str);
   vconf_get_int(vconfkeys[i][3], &get_int);

   kl = vconf_keylist_new();
   vconf_get(kl, parent_dir, 0);
   while((temp_node = vconf_keylist_nextnode(kl))) {
      switch(vconf_keynode_get_type(temp_node)) {
         case VCONF_TYPE_INT:
            printf("key = %s, value = %d\n",
                  vconf_keynode_get_name(temp_node), vconf_keynode_get_int(temp_node));
            break;
         case VCONF_TYPE_BOOL:
            printf("key = %s, value = %d\n",
                  vconf_keynode_get_name(temp_node), vconf_keynode_get_bool(temp_node));
            break;
         case VCONF_TYPE_DOUBLE:
            printf("key = %s, value = %f\n",
                  vconf_keynode_get_name(temp_node), vconf_keynode_get_dbl(temp_node));
            break;
         case VCONF_TYPE_STRING:
            printf("key = %s, value = %s\n",
                  vconf_keynode_get_name(temp_node), vconf_keynode_get_str(temp_node));
            break;
         default:
            printf("Unknown Type\n");
      }
   }
   vconf_keylist_free(kl);
}
Beispiel #5
0
void
_mp_app_noti_changed_cb(keynode_t * node, void *data)
{
	struct appdata *ad = (struct appdata *)data;

	char *keyname = vconf_keynode_get_name(node);

	DEBUG_TRACE("key changed: %s", keyname);

	if (strcmp(keyname, VCONFKEY_FILEMANAGER_DB_STATUS) == 0)
	{
		int db_state = vconf_keynode_get_int(node);
		if(db_state == VCONFKEY_FILEMANAGER_DB_UPDATED)
		{
			if (mp_playlist_mgr_get_current(ad->playlist_mgr)
			    && !ecore_file_exists(mp_playlist_mgr_get_current(ad->playlist_mgr)->uri))
				mp_play_stop_and_updateview(ad, TRUE);
#ifndef MP_SOUND_PLAYER
			else
				mp_library_update_view(ad);
#endif

#ifdef MP_ENABLE_INOTIFY
			_mp_add_inofity_refresh_watch(ad);
#endif
		}
	}
	else if (strcmp(keyname, VCONFKEY_SETAPPL_SOUND_STATUS_BOOL) == 0)
	{
		bool profile = vconf_keynode_get_bool(node);
		DEBUG_TRACE("profile changed: %d", profile);
		if (profile == false) {
			mp_player_mgr_pause(ad);
		}
	}
	else if (strcmp(keyname, MP_VCONFKEY_PLAYING_PID) == 0)
	{
		int playing_pid = vconf_keynode_get_int(node);
		if (playing_pid != getpid())
		{
			DEBUG_TRACE("other player activated : [pid:%d]", playing_pid);
			if (ad->player_state == PLAY_STATE_PLAYING) {
				ad->paused_by_other_player = TRUE;
				mp_play_control_play_pause(ad, false);
			}

			//mp_minicontroller_destroy(ad);
		}
	}
#if 1	//Minjin
	else if (strcmp(keyname, MP_LIVE_PLAY_STATE) == 0)
	{
		//bool profile = vconf_keynode_get_bool(node);
		int profile;
		vconf_get_bool("memory/private/org.tizen.music-player/player_state", &profile);
		
		DEBUG_TRACE("profile changed: %d(%s)", profile, MP_LIVE_PLAY_STATE);

		mp_play_control_play_pause(ad, profile);

		/*
		if (profile == false) 
		{
			//TODO: phase and push vconf
			if (ad->player_state == PLAY_STATE_PLAYING)
			{
				if(mp_player_mgr_pause(ad))
				{
					ad->paused_by_user = TRUE;
				}
			}
			else if (ad->player_state == PLAY_STATE_PREPARING)
			{
				WARN_TRACE("player_state is prepareing. set paused_by_user!!!");
				ad->paused_by_user = TRUE;
			}
		}
		else
		{
			//TODO: get vconf and resume/play music
			//mp_player_mgr_resume(ad);
			ad->paused_by_user = FALSE;

			if (ad->player_state == PLAY_STATE_PAUSED)
			{
				if(mp_player_mgr_resume(ad))
				{
					vconf_set_int(MP_VCONFKEY_PLAYING_PID, getpid());
					if (ad->player_state == PLAY_STATE_PAUSED)
						mp_play_resume(ad);
					ad->player_state = PLAY_STATE_PLAYING;
				}
			}
			else if (ad->player_state == PLAY_STATE_READY)
			{
				mp_play_current_file(ad);
			}
			else if (ad->player_state == PLAY_STATE_PLAYING)
			{
				DEBUG_TRACE("player_state is already playing. Skip event");
			}
			else if (ad->player_state == PLAY_STATE_PREPARING)
			{
				WARN_TRACE("player_state is preparing. Skip event");
			}
			else
			{
				//silentmode -> go to listview -> click one track -> silent mode play no -> go to playing view -> click play icon
				mp_play_new_file(ad, TRUE);
			}
		}	
		*/
	}
#endif
}
net_nfc_error_e net_nfc_app_util_process_ndef(data_s *data)
{
	net_nfc_error_e result = NET_NFC_UNKNOWN_ERROR;
	ndef_message_s *msg = NULL;
	char operation[2048] = {0, };
	char mime[2048] = {0, };
	char text[2048] = {0, };
	int ret = 0;
	int disable = 0;

	if (data == NULL || data->buffer == NULL || data->length == 0)
	{
		DEBUG_ERR_MSG("net_nfc_app_util_process_ndef NET_NFC_NULL_PARAMETER");
		return NET_NFC_NULL_PARAMETER;
	}

	/* create file */
	if ((result = net_nfc_app_util_store_ndef_message(data)) != NET_NFC_OK)
	{
		DEBUG_ERR_MSG("net_nfc_app_util_store_ndef_message failed [%d]", result);
		return result;
	}

	/* check state of launch popup */
	if (vconf_get_bool(NET_NFC_DISABLE_LAUNCH_POPUP_KEY, &disable) == 0 && disable == FALSE)
	{
		DEBUG_MSG("skip launch popup");
		result = NET_NFC_OK;
		return result;
	}

	if(net_nfc_util_create_ndef_message (&msg) != NET_NFC_OK)
	{
		DEBUG_ERR_MSG ("memory alloc fail..");
		return NET_NFC_ALLOC_FAIL;
	}

	/* parse ndef message and fill appsvc data */
	if ((result = net_nfc_util_convert_rawdata_to_ndef_message(data, msg)) != NET_NFC_OK)
	{
		DEBUG_ERR_MSG("net_nfc_app_util_store_ndef_message failed [%d]", result);
		goto ERROR;
	}

	if (_net_nfc_app_util_get_operation_from_record(msg->records, operation, sizeof(operation)) == FALSE)
	{
		DEBUG_ERR_MSG("_net_nfc_app_util_get_operation_from_record failed [%d]", result);
		result = NET_NFC_UNKNOWN_ERROR;
		goto ERROR;
	}

	DEBUG_MSG("operation : %s", operation);

	if (_net_nfc_app_util_get_mime_from_record(msg->records, mime, sizeof(mime)) == FALSE)
	{
		DEBUG_ERR_MSG("_net_nfc_app_util_get_mime_from_record failed [%d]", result);
		result = NET_NFC_UNKNOWN_ERROR;
		goto ERROR;
	}

	DEBUG_MSG("mime : %s", mime);

	/* launch appsvc */
	if (_net_nfc_app_util_get_data_from_record(msg->records, text, sizeof(text)) == TRUE)
	{
		ret = net_nfc_app_util_appsvc_launch(operation, NULL, mime, text);
	}
	else
	{
		ret = net_nfc_app_util_appsvc_launch(operation, NULL, mime, NULL);
	}

	DEBUG_MSG("net_nfc_app_util_appsvc_launch return %d", ret);

	result = NET_NFC_OK;

ERROR :
	net_nfc_util_free_ndef_message(msg);

	return result;
}