From: inhyeok Date: Tue, 28 Apr 2015 11:41:05 +0000 (+0900) Subject: remove call session mode, and remove internal tag for sound type call, ringtone and... X-Git-Tag: submit/tizen/20150715.092047~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F41097%2F2;p=platform%2Fcore%2Fapi%2Fsound-manager.git remove call session mode, and remove internal tag for sound type call, ringtone and voip Change-Id: Ib9890cfdc4dfc7989011476d46eb3fff64a7d5bc Signed-off-by: inhyeok --- diff --git a/include/sound_manager.h b/include/sound_manager.h index bfa0a3d..710d9c6 100644 --- a/include/sound_manager.h +++ b/include/sound_manager.h @@ -67,10 +67,10 @@ typedef enum SOUND_TYPE_SYSTEM, /**< Sound type for system */ SOUND_TYPE_NOTIFICATION, /**< Sound type for notifications */ SOUND_TYPE_ALARM, /**< Sound type for alarm */ - SOUND_TYPE_RINGTONE, /**< @internal Sound type for ringtones */ + SOUND_TYPE_RINGTONE, /**< Sound type for ringtones */ SOUND_TYPE_MEDIA, /**< Sound type for media */ - SOUND_TYPE_CALL, /**< @internal Sound type for call */ - SOUND_TYPE_VOIP, /**< @internal Sound type for voip */ + SOUND_TYPE_CALL, /**< Sound type for call */ + SOUND_TYPE_VOIP, /**< Sound type for voip */ SOUND_TYPE_VOICE, /**< Sound type for voice */ } sound_type_e; @@ -189,7 +189,6 @@ typedef enum { SOUND_SESSION_TYPE_NOTIFICATION, /**< Notification type */ SOUND_SESSION_TYPE_EMERGENCY, /**< Emergency type */ SOUND_SESSION_TYPE_VOIP, /**< VOIP type */ - SOUND_SESSION_TYPE_CALL, /**< @internal Call type */ } sound_session_type_e; /** @@ -235,19 +234,6 @@ typedef enum { SOUND_SESSION_VOIP_MODE_VOICE_WITH_BLUETOOTH, /**< voip mode for during call with bluetooth */ } sound_session_voip_mode_e; -/** - * @internal - * @brief Enumeration for call session mode. - * @since_tizen 2.3.1 - */ -typedef enum { - SOUND_SESSION_CALL_MODE_RINGTONE = 0, /**< call mode for ringtone */ - SOUND_SESSION_CALL_MODE_VOICE_WITH_BUILTIN_RECEIVER, /**< call mode for during call with built-in receiver */ - SOUND_SESSION_CALL_MODE_VOICE_WITH_BUILTIN_SPEAKER, /**< call mode for during call with built-in speaker */ - SOUND_SESSION_CALL_MODE_VOICE_WITH_AUDIO_JACK, /**< call mode for during call with audio jack */ - SOUND_SESSION_CALL_MODE_VOICE_WITH_BLUETOOTH, /**< call mode for during call with bluetooth */ -} sound_session_call_mode_e; - /** * @deprecated Deprecated since 2.4. Use sound_stream_focus_state_changed_cb instead. * @brief Enumeration for sound session interrupted type. @@ -896,44 +882,6 @@ int sound_manager_set_voip_session_mode (sound_session_voip_mode_e mode); */ int sound_manager_get_voip_session_mode (sound_session_voip_mode_e *mode); -/** - * @internal - * @brief Sets the mode of the call sound session. - * @since_tizen 2.3.1 - * @param[in] mode The call session mode - * @return @c 0 on success, - * otherwise a negative error value - * @retval #SOUND_MANAGER_ERROR_NONE Success - * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported - * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system - * @retval #SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy - * @pre Call sound_manager_set_session_type(SOUND_SESSION_TYPE_CALL) before calling this function. - * @see sound_manager_set_session_type() - * @see sound_manager_get_session_type() - * @see sound_manager_get_call_session_mode() -*/ -int sound_manager_set_call_session_mode (sound_session_call_mode_e mode); - -/** - * @internal - * @brief Gets the mode of the call sound session. - * @since_tizen 2.3.1 - * @param[out] mode The call session mode - * @return @c 0 on success, - * otherwise a negative error value - * @retval #SOUND_MANAGER_ERROR_NONE Success - * @retval #SOUND_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #SOUND_MANAGER_ERROR_NOT_SUPPORTED Not supported - * @retval #SOUND_MANAGER_ERROR_INTERNAL Internal error inside the sound system - * @retval #SOUND_MANAGER_ERROR_POLICY Noncompliance with the sound system policy - * @pre Call sound_manager_set_session_type(SOUND_SESSION_TYPE_call) before calling this function. - * @see sound_manager_set_session_type() - * @see sound_manager_get_session_type() - * @see sound_manager_set_call_session_mode() -*/ -int sound_manager_get_call_session_mode (sound_session_call_mode_e *mode); - /** * @deprecated Deprecated since 2.4. Use sound_manager_create_stream_information() instead. * @brief Registers a callback function to be invoked when the sound session being played was interrupted. diff --git a/include/sound_manager_internal.h b/include/sound_manager_internal.h index 568d8df..1122da9 100644 --- a/include/sound_manager_internal.h +++ b/include/sound_manager_internal.h @@ -117,6 +117,7 @@ int sound_manager_create_stream_information_internal (sound_stream_type_internal int sound_manager_add_option_for_stream_routing (sound_stream_info_h stream_info, const char *option); /** + * @internal * @brief Removes the option to the stream information for the stream routing. * @since_tizen 2.4 * @param[in] stream_info The handle of stream information @@ -137,6 +138,7 @@ int sound_manager_add_option_for_stream_routing (sound_stream_info_h stream_info int sound_manager_remove_option_for_stream_routing (sound_stream_info_h stream_info, const char *option); /** + * @internal * @brief Applies the stream routing options. * @since_tizen 2.4 * @param[in] stream_info The handle of stream information diff --git a/packaging/capi-media-sound-manager.spec b/packaging/capi-media-sound-manager.spec index 5fa71c0..3c76382 100755 --- a/packaging/capi-media-sound-manager.spec +++ b/packaging/capi-media-sound-manager.spec @@ -1,6 +1,6 @@ Name: capi-media-sound-manager Summary: Sound Manager library -Version: 0.3.1 +Version: 0.3.2 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/src/sound_manager.c b/src/sound_manager.c index 90b4052..7dea08a 100644 --- a/src/sound_manager.c +++ b/src/sound_manager.c @@ -487,7 +487,7 @@ int sound_manager_set_session_type (sound_session_type_e type) LOGI(">> enter : type=%d", type); - if(type < SOUND_SESSION_TYPE_MEDIA || type > SOUND_SESSION_TYPE_CALL) + if(type < SOUND_SESSION_TYPE_MEDIA || type > SOUND_SESSION_TYPE_VOIP) return __convert_sound_manager_error_code(__func__, MM_ERROR_INVALID_ARGUMENT); switch(type) { @@ -506,9 +506,6 @@ int sound_manager_set_session_type (sound_session_type_e type) case SOUND_SESSION_TYPE_VOIP: new_session = MM_SESSION_TYPE_VOIP; break; - case SOUND_SESSION_TYPE_CALL: - new_session = MM_SESSION_TYPE_CALL; - break; } /* valid session check */ @@ -568,8 +565,7 @@ int sound_manager_get_session_type (sound_session_type_e *type) if (ret != 0) cur_session = SOUND_SESSION_TYPE_DEFAULT; if ((cur_session > MM_SESSION_TYPE_EMERGENCY) && - (cur_session != MM_SESSION_TYPE_VOIP) && - (cur_session != MM_SESSION_TYPE_CALL)) { + (cur_session != MM_SESSION_TYPE_VOIP)) { if( g_cached_session != -1 ) cur_session = g_cached_session; else //will be never reach here. just prevent code @@ -593,9 +589,6 @@ int sound_manager_get_session_type (sound_session_type_e *type) case MM_SESSION_TYPE_VOIP: *type = SOUND_SESSION_TYPE_VOIP; break; - case MM_SESSION_TYPE_CALL: - *type = SOUND_SESSION_TYPE_CALL; - break; default: *type = cur_session; break; @@ -870,57 +863,6 @@ int sound_manager_get_voip_session_mode (sound_session_voip_mode_e *mode) return __convert_sound_manager_error_code(__func__, ret); } -int sound_manager_set_call_session_mode (sound_session_call_mode_e mode) -{ - int ret = MM_ERROR_NONE; - int session = 0; - int session_options = 0; - - LOGI(">> enter : mode=%d", mode); - - ret = mm_session_get_current_information(&session, &session_options); - if( ret != MM_ERROR_NONE ) { - return __convert_sound_manager_error_code(__func__, ret); - } else if (session != MM_SESSION_TYPE_CALL ) { - return __convert_sound_manager_error_code(__func__, MM_ERROR_POLICY_INTERNAL); - } - if(mode < SOUND_SESSION_CALL_MODE_RINGTONE || mode > SOUND_SESSION_CALL_MODE_VOICE_WITH_BLUETOOTH) { - ret = MM_ERROR_INVALID_ARGUMENT; - return __convert_sound_manager_error_code(__func__, ret); - } - ret = __set_session_mode ((_session_mode_e)mode); - - LOGI("<< leave : session=%p, mode=%d, ret=%p", session, mode, ret); - - return __convert_sound_manager_error_code(__func__, ret); -} - -int sound_manager_get_call_session_mode (sound_session_call_mode_e *mode) -{ - int ret = MM_ERROR_NONE; - int session = 0; - int session_options = 0; - _session_mode_e _mode = 0; - - if(mode == NULL) { - return __convert_sound_manager_error_code(__func__, MM_ERROR_INVALID_ARGUMENT); - } - - ret = mm_session_get_current_information(&session, &session_options); - if( ret != MM_ERROR_NONE ) { - return __convert_sound_manager_error_code(__func__, ret); - } else if (session != MM_SESSION_TYPE_CALL ) { - return __convert_sound_manager_error_code(__func__, MM_ERROR_POLICY_INTERNAL); - } - ret = __get_session_mode(&_mode); - if (ret == MM_ERROR_NONE) - *mode = (sound_session_call_mode_e)_mode; - - LOGI("returns : session=%p, mode=%d, ret=%p", session, *mode, ret); - - return __convert_sound_manager_error_code(__func__, ret); -} - int sound_manager_set_session_interrupted_cb (sound_session_interrupted_cb callback, void *user_data) { int ret = MM_ERROR_NONE; diff --git a/test/sound_manager_test.c b/test/sound_manager_test.c index ebdfed0..7b33831 100644 --- a/test/sound_manager_test.c +++ b/test/sound_manager_test.c @@ -343,8 +343,6 @@ void display_sub_basic() g_print("gr. Get Media Session Resumption Option \n"); g_print("so. Set Voip Session Mode \t"); g_print("go. Get Voip Session Mode \n"); - g_print("sl. Set Call Session Mode \t"); - g_print("gc. Get Call Session Mode \n"); g_print("sc. Set Session Interruped CB \t"); g_print("us. Unset Session Interrupted CB \n"); g_print("-----------------------------------------------------------------------------------------\n"); @@ -427,7 +425,7 @@ static void displaymenu() } else if (g_menu_state == CURRENT_STATUS_SET_SESSION_TYPE) { - g_print("*** input session type(0:MEDIA, 1:ALARM, 2:NOTIFICATION, 3:EMERGENCY, 4:VOIP, 5:CALL)\n"); + g_print("*** input session type(0:MEDIA, 1:ALARM, 2:NOTIFICATION, 3:EMERGENCY, 4:VOIP)\n"); } else if (g_menu_state == CURRENT_STATUS_GET_SESSION_TYPE) { @@ -644,7 +642,7 @@ int convert_sound_type(sound_type_e *type, char *cmd) int convert_session_type(sound_session_type_e *type, char *cmd) { int session_type_n = atoi(cmd); - if (SOUND_SESSION_TYPE_MEDIA > session_type_n || session_type_n > SOUND_SESSION_TYPE_CALL) + if (SOUND_SESSION_TYPE_MEDIA > session_type_n || session_type_n > SOUND_SESSION_TYPE_VOIP) { g_print("not supported session type(%d)\n", session_type_n); return 0; @@ -668,9 +666,6 @@ int convert_session_type(sound_session_type_e *type, char *cmd) case 4: *type = SOUND_SESSION_TYPE_VOIP; break; - case 5: - *type = SOUND_SESSION_TYPE_CALL; - break; } } return 1; @@ -1002,32 +997,6 @@ static void interpret (char *cmd) reset_menu_state(); } break; - case CURRENT_STATUS_SET_CALL_SESSION_MODE: - { - int ret = SOUND_MANAGER_ERROR_NONE; - sound_session_call_mode_e mode; - mode = (sound_session_call_mode_e)atoi(cmd); - ret = sound_manager_set_call_session_mode(mode); - if (ret) { - g_print("failed to set call session mode(%d), ret[0x%x]\n", mode, ret); - } else { - g_print("success to set call session mode\n"); - } - reset_menu_state(); - } - break; - case CURRENT_STATUS_GET_CALL_SESSION_MODE: - { - int ret = SOUND_MANAGER_ERROR_NONE; - sound_session_call_mode_e mode; - ret = sound_manager_get_call_session_mode(&mode); - if(ret) - g_print("fail to get call session mode, ret[0x%x]\n", ret); - else - g_print("success to get call session mode, mode[%d]\n", mode); - reset_menu_state(); - } - break; case CURRENT_STATUS_SET_SESSION_INTERRUPTED_CB: { if(sound_manager_set_session_interrupted_cb(_set_session_interrupted_cb, NULL) != 0)