Skip to content

Commit

Permalink
telephony: support for setting add. audioparams for incall audio
Browse files Browse the repository at this point in the history
Change-Id: Ic6f72fba542e1421631826d9bcd86340064c942b
  • Loading branch information
codeworkx authored and Whitehawkx committed Jun 20, 2012
1 parent 47528ee commit 4f76da1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/res/res/values/config.xml
Expand Up @@ -661,6 +661,11 @@
<!-- The VoiceMail default value is displayed to my own number if it is true -->
<bool name="config_telephony_use_own_number_for_voicemail">false</bool>

<!-- Set additional audio parameters for incall audio -->
<!-- Examples: <item>realcall</item> <item>dualmic_enabled</item> <item>mic_boost</item> -->
<string-array name="config_telephony_set_audioparameters" translatable="false">
</string-array>

<!-- If this value is true, Sms encoded as octet is decoded by utf8 decoder.
If false, decoded by Latin decoder. -->
<bool name="config_sms_utf8_support">false</bool>
Expand Down
13 changes: 13 additions & 0 deletions telephony/java/com/android/internal/telephony/CallManager.java
Expand Up @@ -395,6 +395,19 @@ public void setAudioMode() {
}
break;
}

// Set additional audio parameters needed for incall audio
String[] audioParams = context.getResources().getStringArray(com.android.internal.R.array.config_telephony_set_audioparameters);
for (String parameter : audioParams) {
if (mode == AudioManager.MODE_IN_CALL) {
Log.d(LOG_TAG, "setAudioMode(): " + parameter + "=on");
audioManager.setParameters(parameter + "=on");
} else if (mode == AudioManager.MODE_NORMAL) {
Log.d(LOG_TAG, "setAudioMode(): " + parameter + "=off");
audioManager.setParameters(parameter + "=off");
}
}

// calling audioManager.setMode() multiple times in a short period of
// time seems to break the audio recorder in in-call mode
if (audioManager.getMode() != mode) audioManager.setMode(mode);
Expand Down

0 comments on commit 4f76da1

Please sign in to comment.