remove call session mode, and remove internal tag for sound type call, ringtone and... 97/41097/2
authorinhyeok <i_bc.kim@samsung.com>
Tue, 28 Apr 2015 11:41:05 +0000 (20:41 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Wed, 8 Jul 2015 05:37:50 +0000 (14:37 +0900)
Change-Id: Ib9890cfdc4dfc7989011476d46eb3fff64a7d5bc
Signed-off-by: inhyeok <i_bc.kim@samsung.com>
include/sound_manager.h
include/sound_manager_internal.h
packaging/capi-media-sound-manager.spec
src/sound_manager.c
test/sound_manager_test.c

index bfa0a3d1b970e929a98a50cfcba55a5250cabb06..710d9c6c71d94670b68a9e48c0f01aa7f225b1df 100644 (file)
@@ -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.
index 568d8df7c01b076cc08ad5665479158d0d2df451..1122da92dbebf29b16158231fae6f06253efbae8 100644 (file)
@@ -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
index 5fa71c066298834e6c9e81cbc38dbc7a339b5e46..3c76382b8ad06b25de411711426e0669e425c279 100755 (executable)
@@ -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
index 90b40522095c0cedac44af04990097b332d3b76f..7dea08acabbf88a5a2716564fa798464a44913e3 100644 (file)
@@ -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;
index ebdfed01f23b67841711074bb0409be77408c2ee..7b338315792192c6017f7f71049e5b1e8e56befc 100644 (file)
@@ -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)