summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Keith <javelinanddart@gmail.com>2018-04-25 03:03:03 +0200
committerPaul Keith <javelinanddart@gmail.com>2018-05-04 19:43:45 +0200
commit8b312302586b18f6cf1f37afa0fa6b3c19bb46b9 (patch)
tree0b9cf5c65e41373acc58e413954c07e471be2b1d
parent3b840d294a20f3aa34c393a49d86177371cc4517 (diff)
downloadhardware_qcom_audio-8b312302586b18f6cf1f37afa0fa6b3c19bb46b9.tar.gz
hardware_qcom_audio-8b312302586b18f6cf1f37afa0fa6b3c19bb46b9.tar.bz2
hardware_qcom_audio-8b312302586b18f6cf1f37afa0fa6b3c19bb46b9.zip
hal: msim_voice_extn: Set msim_phone based on phone_type parameter
* This is consistently cp1 on SIM1 and cp2 on SIM2, so drop all the confusing and unnecessary property_get calls, and just use the param Change-Id: I4a59ebd177d46b47e00067af7e6dce49d3e7e676
-rw-r--r--hal/voice_extn/msim_voice_extn.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/hal/voice_extn/msim_voice_extn.c b/hal/voice_extn/msim_voice_extn.c
index 1549ca08..6c4e1996 100644
--- a/hal/voice_extn/msim_voice_extn.c
+++ b/hal/voice_extn/msim_voice_extn.c
@@ -34,14 +34,6 @@
#define AUDIO_PARAMETER_VALUE_CP1 "cp1"
#define AUDIO_PARAMETER_VALUE_CP2 "cp2"
-#ifdef HTC_DUAL_SIM
-#define RADIO_PREFER_NETWORK_SLOT0 "persist.radio.prefer.network"
-#define RADIO_PREFER_NETWORK_SLOT1 "persist.radio.prefer.nw.sub"
-#elif SAMSUNG_DUAL_SIM
-#define AUDIO_PROPERTY_SEC_VSID1 "gsm.current.vsid"
-#define AUDIO_PROPERTY_SEC_VSID2 "gsm.current.vsid2"
-#endif
-
#define VOICE2_VSID 0x10DC1000
#define VOICE2_SESS_IDX (VOICE_SESS_IDX + 1)
@@ -87,27 +79,12 @@ int msim_voice_extn_set_parameters(struct audio_device *adev __unused,
struct str_parms *parms)
{
int ret;
- int voice_slot = 0;
char value[32] = {0};
ret = str_parms_get_str(parms, AUDIO_PARAMETER_KEY_PHONETYPE, value,
sizeof(value));
if (ret >= 0) {
-#ifdef HTC_DUAL_SIM
- voice_slot = property_get_int32(RADIO_PREFER_NETWORK_SLOT0) != 1 ? 0 : 1;
- if (property_get_int32(RADIO_PREFER_NETWORK_SLOT0) ==
- property_get_int32(RADIO_PREFER_NETWORK_SLOT1)) {
- voice_slot = 0;
- }
- if (!strcmp(value, AUDIO_PARAMETER_VALUE_CP2)) {
- msim_phone = voice_slot == 0 ? MSIM_SIM2 : MSIM_SIM1;
- } else {
- msim_phone = voice_slot == 0 ? MSIM_SIM1 : MSIM_SIM2;
- }
-#elif SAMSUNG_DUAL_SIM
- msim_phone = property_get_int32(!strcmp(value, AUDIO_PARAMETER_VALUE_CP2) ?
- AUDIO_PROPERTY_SEC_VSID2 : AUDIO_PROPERTY_SEC_VSID1) != 0 ? MSIM_SIM2 : MSIM_SIM1;
-#endif
+ msim_phone = !strcmp(value, AUDIO_PARAMETER_VALUE_CP2) ? MSIM_SIM2 : MSIM_SIM1;
ALOGV("%s: msim_phone=%d", __func__, msim_phone);
}