alsa_sound : send voc-cal data for play voip use case

- Volume not being changed when playing voicemail
  during MODE_IN_CALL
- The calibration data was not being sent to the DSP
  for the play voip use case
- Setting the current modifier properly
  Permitting sending of calibration data despite
  no change in rx and tx devices

Change-Id: Ice9599941d3d6c115daa63c44bf4a1daa8f50ba3
CRs-Fixed: 508126
diff --git a/libalsa-intf/alsa_ucm.c b/libalsa-intf/alsa_ucm.c
index f182d26..cafd154 100644
--- a/libalsa-intf/alsa_ucm.c
+++ b/libalsa-intf/alsa_ucm.c
@@ -722,6 +722,7 @@
         strlen(SND_USE_CASE_VERB_IP_VOICECALL)))) {
         voice_acdb = 1;
     }
+//The ident_value should store latest/current modifier
     if (voice_acdb != 1) {
         list_size =
         snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->mod_list_head);
@@ -739,9 +740,6 @@
                     strlen(SND_USE_CASE_MOD_PLAY_VOIP)))) {
                     voice_acdb = 1;
                     strlcpy(current_mod, ident_value, MAX_STR_LEN);
-                    free(ident_value);
-                    ident_value = NULL;
-                    break;
                 }
                 free(ident_value);
                 ident_value = NULL;
@@ -802,9 +800,8 @@
                     && tx_id == DEVICE_HANDSET_TX_FV5_ACDB_ID) {
                     tx_id = DEVICE_SPEAKER_TX_FV5_ACDB_ID;
                 }
-
-                if ((rx_id != uc_mgr->current_rx_device) ||
-                    (tx_id != uc_mgr->current_tx_device)) {
+/* Despite no change in rx and tx devices, calibration data can be required to be sent.
+This happens when the modifier changes*/
                     uc_mgr->current_rx_device = rx_id;
                     uc_mgr->current_tx_device = tx_id;
                     ALOGD("Voice acdb: rx id %d tx id %d verb:%s modifier:%s",
@@ -816,7 +813,7 @@
                           strlen(SND_USE_CASE_VERB_IP_VOICECALL)) ||
                           (!strncmp(current_mod, SND_USE_CASE_MOD_PLAY_VOIP,
                            strlen(SND_USE_CASE_MOD_PLAY_VOIP)))) ||
-                          (!uc_mgr->isFusion3Platform))
+                          (!uc_mgr->isFusion3Platform)) {
                         if (uc_mgr->acdb_handle) {
                             acdb_send_voice_cal = dlsym(uc_mgr->acdb_handle,"acdb_loader_send_voice_cal");
                             if (acdb_send_voice_cal == NULL) {
@@ -826,11 +823,7 @@
                                         uc_mgr->current_tx_device);
                             }
                         }
-                } else {
-                    ALOGV("Voice acdb: Required acdb already pushed \
-                         rx id %d tx id %d", uc_mgr->current_rx_device,
-                         uc_mgr->current_tx_device);
-                }
+                    }
             }
             free(ident_value);
             ident_value = NULL;