sound_manager_test: Remove symbols deprecated Since tizen 4.0 42/275942/1 accepted/tizen/unified/20220620.030226 submit/tizen/20220608.074213 submit/tizen/20220616.080711
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 7 Jun 2022 03:45:43 +0000 (12:45 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Tue, 7 Jun 2022 05:50:22 +0000 (14:50 +0900)
These are related to API below.
 - sound_manager_get_device_state()
 - sound_manager_add_device_state_changed_cb()
 - sound_manager_remove_device_state_changed_cb()

It is also fixed to return without any operation for those functions.

[Version] 0.6.50
[Issue Type] Clean-up

Change-Id: I3a6358827cb3fec19aab820ab03193bdaa6dbdac
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-sound-manager.spec
src/sound_manager.c
test/sound_manager_test.c

index 5340083425381485a92650b6843f165a1586ca10..9502bab7e30d47e9abbafb76489816e27108c0dc 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-sound-manager
 Summary:    Sound Manager library
-Version:    0.6.49
+Version:    0.6.50
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index e64e94b4059f58a7af614936c3a48a6b988ac225..89f3046480f9e6ce50ad1573b70be91ed5f6c4fa 100644 (file)
@@ -991,19 +991,13 @@ int sound_manager_is_device_running(sound_device_h device, bool *is_running)
 
 int sound_manager_get_device_state(sound_device_h device, sound_device_state_e *state)
 {
-       int ret = MM_ERROR_NONE;
-
        SM_ARG_CHECK(device);
        SM_ARG_CHECK(state);
 
-       LOGI("device[%p]", device);
-
        LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release.", __func__);
-       ret = mm_sound_get_device_state(device, (mm_sound_device_state_e*)state);
-
-       LOGI("state[%d]", *state);
+       *state = SOUND_DEVICE_STATE_DEACTIVATED;
 
-       return _convert_sound_manager_error_code(__func__, ret);
+       return SOUND_MANAGER_ERROR_NONE;
 }
 
 int sound_manager_get_supported_sample_formats(sound_device_h device, sound_sample_format_e **formats, unsigned int *num_of_elems)
@@ -1264,33 +1258,20 @@ int sound_manager_remove_device_running_changed_cb(int id)
 
 int sound_manager_add_device_state_changed_cb(int device_mask, sound_device_state_changed_cb callback, void *user_data, int *id)
 {
-       int ret = MM_ERROR_NONE;
-
        LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release.", __func__);
        SM_ARG_CHECK(callback);
        SM_ARG_CHECK(id);
 
-       LOGI("device_mask[0x%x] callback[%p] user_data[%p]", device_mask, callback, user_data);
-
-       ret = mm_sound_add_device_state_changed_callback(device_mask, (mm_sound_device_state_changed_cb)callback, user_data, (unsigned int*)id);
+       *id = -1;
 
-       LOGI("id[%d]", *id);
-
-       return _convert_sound_manager_error_code(__func__, ret);
+       return SOUND_MANAGER_ERROR_NONE;
 }
 
 int sound_manager_remove_device_state_changed_cb(int id)
 {
-       int ret = MM_ERROR_NONE;
-
        LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed from next release.", __func__);
-       SM_ARG_CHECK(id >= 0);
 
-       LOGI("id[%d]", id);
-
-       ret = mm_sound_remove_device_state_changed_callback((unsigned int)id);
-
-       return _convert_sound_manager_error_code(__func__, ret);
+       return SOUND_MANAGER_ERROR_NONE;
 }
 
 int sound_manager_create_stream_ducking(sound_stream_type_e target_stream, sound_stream_ducking_state_changed_cb callback, void *user_data, sound_stream_ducking_h *stream_ducking)
index 14eb9a5a19c1d2c16f8e53a97b716356947e9c76..005647ece52ea6bd808772bb270631a89a942369 100644 (file)
@@ -559,7 +559,7 @@ static void displaymenu()
        else if (g_menu_state == CURRENT_STATUS_REMOVE_VOLUME_CHANGED_CB_INTERNAL)
                g_print("*** press enter to remove volume changed cb for internal\n");
        else if (g_menu_state == CURRENT_STATUS_SET_DEVICE_MASK)
-               g_print("*** input device mask (0:ALL, 1:INTERNAL, 2:EXTERNAL, 3:INPUT, 4:OUTPUT, 5:BOTH, 6:ACTIVATED, 7:DEACTIVATED, b:back to the menu)\n");
+               g_print("*** input device mask (0:ALL, 1:INTERNAL, 2:EXTERNAL, 3:INPUT, 4:OUTPUT, 5:BOTH, b:back to the menu)\n");
        else if (g_menu_state == CURRENT_STATUS_GET_DEVICE_MASK)
                g_print("*** press enter to get device mask\n");
        else if (g_menu_state == CURRENT_STATUS_GET_DEVICE_LIST)
@@ -800,12 +800,11 @@ void _volume_changed_cb_internal(sound_type_internal_e type, unsigned int volume
 
 /* If failed to get some property, just give some default value */
 void _get_device_props_simple(sound_device_h device, int *id, const char **type, char **name,
-               const char **direction, bool *is_activated, int *vendor_id, int *product_id, bool *is_running)
+               const char **direction, int *vendor_id, int *product_id, bool *is_running)
 {
        int ret;
        sound_device_type_e _type;
        sound_device_io_direction_e _direc;
-       sound_device_state_e _state;
        bool running;
 
        *id = -1;
@@ -839,13 +838,6 @@ void _get_device_props_simple(sound_device_h device, int *id, const char **type,
                *direction = g_device_direction_str[_direc];
        }
 
-       if ((ret = sound_manager_get_device_state(device, &_state))) {
-               g_print("failed to get device state, ret[0x%x]\n", ret);
-               *is_activated = false;
-       } else {
-               *is_activated = (bool)_state;
-       }
-
        if ((ret = sound_manager_is_device_running(device, &running))) {
                g_print("failed to get 'is running', ret[0x%x]\n", ret);
                *is_running = false;
@@ -861,14 +853,13 @@ void _device_connected_cb(sound_device_h device, bool is_connected, void *user_d
        int product_id = 0;
        char *name;
        const char *type, *direction;
-       bool is_activated = false;
        bool is_running = false;
 
-       _get_device_props_simple(device, &id, &type, &name, &direction, &is_activated, &vendor_id, &product_id, &is_running);
+       _get_device_props_simple(device, &id, &type, &name, &direction, &vendor_id, &product_id, &is_running);
 
        g_print("\n[ Device #%d %-20s ] %15s : ", id, type, is_connected ? "Connected" : "Disconnected");
-       g_print("Direction[%-4s] Activated[%d] Running[%d] Vendor/Product ID[%04x/%04x] Name[%s]\n",
-            direction, is_activated, is_running, vendor_id, product_id, name);
+       g_print("Direction[%-4s] Running[%d] Vendor/Product ID[%04x/%04x] Name[%s]\n",
+            direction, is_running, vendor_id, product_id, name);
 }
 
 void _device_running_changed_cb(sound_device_h device, bool is_running, void *user_data)
@@ -878,14 +869,13 @@ void _device_running_changed_cb(sound_device_h device, bool is_running, void *us
        int product_id = 0;
        char *name;
        const char *type, *direction;
-       bool is_activated = false;
        bool _is_running = false;
 
-       _get_device_props_simple(device, &id, &type, &name, &direction, &is_activated, &vendor_id, &product_id, &_is_running);
+       _get_device_props_simple(device, &id, &type, &name, &direction, &vendor_id, &product_id, &_is_running);
 
        g_print("\n[ Device #%d %-20s ] running changed to [%d] : ", id, type, is_running);
-       g_print("Direction [%-4s] Activated[%d] Running[%d] Vendor/Product ID[%04x/%04x] Name[%s]\n",
-            direction, is_activated, _is_running, vendor_id, product_id, name);
+       g_print("Direction [%-4s] Running[%d] Vendor/Product ID[%04x/%04x] Name[%s]\n",
+            direction, is_running, vendor_id, product_id, name);
 }
 
 void reset_menu_state(void)
@@ -1118,18 +1108,6 @@ static void interpret(char *cmd)
                        else
                                g_device_mask |= SOUND_DEVICE_IO_DIRECTION_BOTH_MASK;
                        g_print("add IO_DIRECTION_BOTH MASK\n");
-               } else if (strncmp(cmd, "6", 1) == 0) {
-                       if (g_device_mask == SOUND_DEVICE_ALL_MASK)
-                               g_device_mask = SOUND_DEVICE_STATE_ACTIVATED_MASK;
-                       else
-                               g_device_mask |= SOUND_DEVICE_STATE_ACTIVATED_MASK;
-                       g_print("add STATE_ACTIVATED MASK\n");
-               } else if (strncmp(cmd, "7", 1) == 0) {
-                       if (g_device_mask == SOUND_DEVICE_ALL_MASK)
-                               g_device_mask = SOUND_DEVICE_STATE_DEACTIVATED_MASK;
-                       else
-                               g_device_mask |= SOUND_DEVICE_STATE_DEACTIVATED_MASK;
-                       g_print("add STATE_DEACTIVATED MASK\n");
                } else if (strncmp(cmd, "b", 1) == 0) {
                        g_print("device mask[0x%x]\n", g_device_mask);
                        reset_menu_state();
@@ -1162,7 +1140,6 @@ static void interpret(char *cmd)
                char *name;
                const char *type;
                const char *direction;
-               bool is_activated;
                bool is_running;
                unsigned int num;
                sound_sample_format_e *formats;
@@ -1171,10 +1148,10 @@ static void interpret(char *cmd)
                if (!(ret = sound_manager_get_device_list(g_device_mask, &device_list))) {
                        g_print("success to get current device list\n");
                        while (!sound_manager_get_next_device(device_list, &device)) {
-                               _get_device_props_simple(device, &id, &type, &name, &direction, &is_activated, &vendor_id, &product_id, &is_running);
+                               _get_device_props_simple(device, &id, &type, &name, &direction, &vendor_id, &product_id, &is_running);
                                g_print("[ Device #%d %-20s ] : ", id, type);
-                               g_print("Direction[%-4s] Activated[%d] Running[%d] Vendor/Product ID[%04x/%04x] Name[%s] \n",
-                                               direction, is_activated, is_running, vendor_id, product_id, name);
+                               g_print("Direction[%-4s] Running[%d] Vendor/Product ID[%04x/%04x] Name[%s] \n",
+                                               direction, is_running, vendor_id, product_id, name);
 
                                if (!(ret = sound_manager_get_supported_sample_formats(device, &formats, &num))) {
                                        g_print(" => [ ");