Removed Deprecated API's 51/107251/3
authorbhutani.92 <bhutani.92@samsung.com>
Wed, 21 Dec 2016 08:05:14 +0000 (13:35 +0530)
committerAkhil Bhutani <bhutani.92@samsung.com>
Tue, 21 Feb 2017 10:23:40 +0000 (02:23 -0800)
Change-Id: I9d182e0c0391eeb0671871c82f7f3253f391768c
Signed-off-by: bhutani.92 <bhutani.92@samsung.com>
music-chooser/src/mc-common.c
src/common/mp-app.c
src/common/mp-util.c
src/include/music.h
src/mp-main.c
src/view/mp-player-view.c
src/widget/mp-popup.c
widget/src/mp-widget-create.c

index ba48720..7e526f3 100644 (file)
@@ -185,8 +185,11 @@ void mc_post_status_message(const char *text)
 
 bool mc_is_call_connected(void)
 {
-       telephony_call_state_e state;
+       telephony_call_h *call_list_sim;
        telephony_handle_list_s tel_list;
+       telephony_error_e ret_sim;
+       unsigned int count_sim[2] = {0};
+
        int tel_valid = telephony_init(&tel_list);
        if (tel_valid != 0) {
                ERROR_TRACE("telephony is not initialized. ERROR Code is %d",
@@ -194,21 +197,29 @@ bool mc_is_call_connected(void)
                return false;
        }
 
-       telephony_h *newhandle = tel_list.handle;
+       for (int i=0;i<tel_list.count;i++) {
+               ret_sim =
+                               telephony_call_get_call_list(tel_list.handle[i], &count_sim[i],
+                                               &call_list_sim);
+               if (ret_sim != TELEPHONY_ERROR_NONE) {
+                       ERROR_TRACE("Cannot get call list information for primary sim");
+               }
 
-       int error = telephony_call_get_voice_call_state(*newhandle, &state);
+               telephony_call_release_call_list(count_sim[i], &call_list_sim);
+       }
 
        telephony_deinit(&tel_list);
 
-       if (error == TELEPHONY_ERROR_NONE) {
-               if (state == TELEPHONY_CALL_STATE_IDLE) {
-                       return false;           /*There exists no calls */
-               }
-               /* There exists at least one call that is dialing, alerting or incoming */
+       if (count_sim[0] > 0) {
+               DEBUG_TRACE("Call connected from SIM 1");
                return true;
-       } else {
-               ERROR_TRACE("ERROR: state error is %d", error);
        }
+
+       if (count_sim[1] > 0) {
+               DEBUG_TRACE("Call connected from SIM 2");
+               return true;
+       }
+
        return false;
 }
 
index 2712513..875754d 100644 (file)
@@ -481,8 +481,8 @@ bool mp_app_noti_init(void *data)
 
        WARN_TRACE("Enter sound_manager_set_active_device_changed_cb");
        ret =
-               sound_manager_set_device_information_changed_cb
-               (SOUND_DEVICE_ALL_MASK, _mp_app_active_device_chaged_cb, ad);
+               sound_manager_add_device_state_changed_cb
+               (SOUND_DEVICE_ALL_MASK, _mp_app_active_device_chaged_cb, ad, &ad->device_state_id);
        if (ret != SOUND_MANAGER_ERROR_NONE) {
                ERROR_TRACE
                ("sound_manager_set_active_device_changed_cb().. [0x%x]", ret);
index ebcaa57..c51b39f 100644 (file)
@@ -1113,10 +1113,10 @@ void mp_util_get_sound_path(mp_snd_path * snd_path)
        sound_device_list_h g_device_list = NULL;
        sound_device_mask_e g_device_mask = SOUND_DEVICE_IO_DIRECTION_OUT_MASK;
        WARN_TRACE("Enter sound_manager_get_active_device");
-       int ret;
+       int ret = SOUND_MANAGER_ERROR_NONE;
        if ((ret =
-                sound_manager_get_current_device_list(g_device_mask,
-                                                                                          &g_device_list))) {
+                       sound_manager_get_device_list(g_device_mask,
+                                       &g_device_list))) {
                ERROR_TRACE("sound_manager_get_active_device()... [0x%x]", ret);
        }
 
@@ -1890,8 +1890,11 @@ bool mp_util_system_volume_popup_show(void)
 
 bool mp_util_is_call_connected(void)
 {
-       telephony_call_state_e state;
+       telephony_call_h *call_list_sim;
        telephony_handle_list_s tel_list;
+       telephony_error_e ret_sim;
+       unsigned int count_sim[2] = {0};
+
        int tel_valid = telephony_init(&tel_list);
        if (tel_valid != 0) {
                ERROR_TRACE("telephony is not initialized. ERROR Code is %d",
@@ -1899,20 +1902,27 @@ bool mp_util_is_call_connected(void)
                return false;
        }
 
-       telephony_h *newhandle = tel_list.handle;
+       for (int i=0;i<tel_list.count;i++) {
+               ret_sim =
+                               telephony_call_get_call_list(tel_list.handle[i], &count_sim[i],
+                                               &call_list_sim);
+               if (ret_sim != TELEPHONY_ERROR_NONE) {
+                       ERROR_TRACE("Cannot get call list information for primary sim");
+               }
 
-       int error = telephony_call_get_voice_call_state(*newhandle, &state);
+               telephony_call_release_call_list(count_sim[i], &call_list_sim);
+       }
 
        telephony_deinit(&tel_list);
 
-       if (error == TELEPHONY_ERROR_NONE) {
-               if (state == TELEPHONY_CALL_STATE_IDLE) {
-                       return false;           /*There exists no calls */
-               }
-               /* There exists at least one call that is dialing, alerting or incoming */
+       if (count_sim[0] > 0) {
+               DEBUG_TRACE("Call connected from SIM 1");
+               return true;
+       }
+
+       if (count_sim[1] > 0) {
+               DEBUG_TRACE("Call connected from SIM 2");
                return true;
-       } else {
-               ERROR_TRACE("ERROR: state error is %d", error);
        }
 
        return false;
index 8ae7174..6a9c4b0 100644 (file)
@@ -239,6 +239,7 @@ struct appdata {
        Evas_Object *popup[MP_POPUP_MAX];
        int win_angle;
        int del_cb_invoked;
+       int device_state_id;
 
        /* App control parameters */
        bool exit_status;
index a442c2d..c3eab12 100644 (file)
@@ -1275,8 +1275,14 @@ static void mp_terminate(void *data)
                ERROR_TRACE("Unable to remove callback for recorder state");
        }
 
+       int error = SOUND_MANAGER_ERROR_NONE;
+       error = sound_manager_remove_device_state_changed_cb(ad->device_state_id);
+       if (error != SOUND_MANAGER_ERROR_NONE) {
+               ERROR_TRACE("Cannot remove device state changed callback");
+       }
+
        if (ad->stream_info) {
-               int error =
+               error =
                        sound_manager_destroy_stream_information(ad->stream_info);
                if (error != SOUND_MANAGER_ERROR_NONE) {
                        ERROR_TRACE("unable to destroy stream. error code [%x]",
index 15f4739..d19b1a4 100644 (file)
@@ -605,10 +605,10 @@ void mp_player_view_set_snd_path_sensitivity(void *data)
        sound_device_list_h g_device_list = NULL;
        sound_device_mask_e g_device_mask = SOUND_DEVICE_IO_DIRECTION_OUT_MASK;
        WARN_TRACE("Enter sound_manager_get_active_device");
-       int ret;
+       int ret = SOUND_MANAGER_ERROR_NONE;
        if ((ret =
-                sound_manager_get_current_device_list(g_device_mask,
-                                                                                          &g_device_list))) {
+                       sound_manager_get_device_list(g_device_mask,
+                                       &g_device_list))) {
                ERROR_TRACE("sound_manager_get_active_device()... [0x%x]", ret);
        }
 
index b7d29f5..97e2455 100644 (file)
@@ -293,10 +293,10 @@ static Evas_Object *_mp_popup_sound_path_create(Evas_Object * parent,
        sound_device_list_h g_device_list = NULL;
        sound_device_mask_e g_device_mask = SOUND_DEVICE_IO_DIRECTION_OUT_MASK;
        WARN_TRACE("Enter sound_manager_get_active_device");
-       int ret;
+       int ret = SOUND_MANAGER_ERROR_NONE;
        if ((ret =
-                sound_manager_get_current_device_list(g_device_mask,
-                                                                                          &g_device_list))) {
+                       sound_manager_get_device_list(g_device_mask,
+                                       &g_device_list))) {
                ERROR_TRACE("sound_manager_get_active_device()... [0x%x]", ret);
        }
 
index e6e7fb8..031c027 100644 (file)
@@ -559,11 +559,11 @@ static void mp_widget_click_on_track_image_cb(void *data,
 
 static bool telephony_is_call_connected(void)
 {
-       DEBUG_TRACE("start");
-       telephony_call_h *call_list_sim1, *call_list_sim2;
-       unsigned int count_sim1, count_sim2;
+       DEBUG_TRACE("Gathering Telephony Information");
+       telephony_call_h *call_list_sim;
        telephony_handle_list_s tel_list;
-       telephony_error_e ret_sim1, ret_sim2;
+       telephony_error_e ret_sim;
+       unsigned int count_sim[2];
 
        int tel_valid = telephony_init(&tel_list);
        if (tel_valid != 0) {
@@ -572,27 +572,26 @@ static bool telephony_is_call_connected(void)
                return false;
        }
 
-       ret_sim1 =
-               telephony_call_get_call_list(tel_list.handle[0], &count_sim1,
-                                                                        &call_list_sim1);
-       if (ret_sim1 != TELEPHONY_ERROR_NONE) {
-               ERROR_TRACE("Cannot get call list information for primary sim");
-       }
+       for (int i=0;i<tel_list.count;i++) {
+               ret_sim =
+                               telephony_call_get_call_list(tel_list.handle[i], &count_sim[i],
+                                               &call_list_sim);
+               if (ret_sim != TELEPHONY_ERROR_NONE) {
+                       ERROR_TRACE("Cannot get call list information for primary sim");
+               }
 
-       ret_sim2 =
-               telephony_call_get_call_list(tel_list.handle[1], &count_sim2,
-                                                                        &call_list_sim2);
-       if (ret_sim2 != TELEPHONY_ERROR_NONE) {
-               ERROR_TRACE("Cannot get call list information for secondary sim");
+               telephony_call_release_call_list(count_sim[i], &call_list_sim);
        }
 
-       telephony_call_release_call_list(count_sim1, &call_list_sim1);
-       telephony_call_release_call_list(count_sim2, &call_list_sim2);
        telephony_deinit(&tel_list);
 
-       if (count_sim1 == 0 && count_sim2 == 0) {
-               return false;
-       } else {
+       if (count_sim[0] > 0) {
+               DEBUG_TRACE("Call connected from SIM 1");
+               return true;
+       }
+
+       if (count_sim[1] > 0) {
+               DEBUG_TRACE("Call connected from SIM 2");
                return true;
        }