Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge "telephony: support for setting add. audioparams for incall aud…

…io" into jb
  • Loading branch information...
commit 295d88f00ca7caee0ee19e3d92670f1a3f715a88 2 parents c27ac14 + 640dcb4
@Whitehawkx Whitehawkx authored Gerrit Code Review committed
View
6 core/res/res/values/config.xml
@@ -739,6 +739,12 @@
<!-- 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
+ Usage: parameter=onstring=offstring
+ Examples: <item>realcall=on=off</item> <item>dualmic_enabled=true=false</item> <item>mic_boost=yes=no</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>
View
1  core/res/res/values/public.xml
@@ -3659,5 +3659,6 @@
<java-symbol type="string" name="config_legacyUmsLunFile" />
<java-symbol type="bool" name="config_forceDisableHardwareKeyboard" />
+ <java-symbol type="array" name="config_telephony_set_audioparameters" />
</resources>
View
25 telephony/java/com/android/internal/telephony/CallManager.java
@@ -417,6 +417,31 @@ 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);
+ String[] aPValues;
+
+ for (String parameter : audioParams) {
+ aPValues = parameter.split("=");
+
+ if(aPValues[1] == null || aPValues[1].length() == 0) {
+ aPValues[1] = "on";
+ }
+
+ if(aPValues[2] == null || aPValues[2].length() == 0) {
+ aPValues[2] = "off";
+ }
+
+ if (audioManager.getMode() == AudioManager.MODE_IN_CALL) {
+ Log.d(LOG_TAG, "setAudioMode(): " + aPValues[0] + "=" + aPValues[1]);
+ audioManager.setParameters(aPValues[0] + "=" + aPValues[1]);
+ } else if (audioManager.getMode() == AudioManager.MODE_NORMAL) {
+ Log.d(LOG_TAG, "setAudioMode(): " + aPValues[0] + "=" + aPValues[2]);
+ audioManager.setParameters(aPValues[0] + "=" + aPValues[2]);
+ }
+ }
+
}
private Context getContext() {
Please sign in to comment.
Something went wrong with that request. Please try again.