blob: 5f494c8fb93fcc44de286c025036f2e34273b8b1 [file] [log] [blame]
Zvikomborero VIncent Zvikaramba1027b4e2016-08-17 17:59:07 -04001diff -ur a/packages/services/Telecomm/src/com/android/server/telecom/CallAudioManager.java b/packages/services/Telecomm/src/com/android/server/telecom/CallAudioManager.java
2--- a/packages/services/Telecomm/src/com/android/server/telecom/CallAudioManager.java Wed Apr 20 08:50:20 2016
3+++ b/packages/services/Telecomm/src/com/android/server/telecom/CallAudioManager.java Thu May 12 01:31:40 2016
4@@ -481,8 +481,18 @@
5
6 Call call = CallsManager.getInstance().getForegroundCall();
7 boolean setMsimAudioParams = SystemProperties.getBoolean("ro.multisim.set_audio_params", false);
8+ boolean setSamsungRealcallParams = SystemProperties.getBoolean("ro.telephony.samsung.realcall", false);
9
10 Log.v(this, "Request to change audio mode from %d to %d", oldMode, newMode);
11+
12+ if(setSamsungRealcallParams) {
13+ if(newMode == 0) {
14+ mAudioManager.setParameters("realcall=off");
15+ } else if(newMode == AudioManager.MODE_IN_COMMUNICATION || newMode == AudioManager.MODE_RINGTONE
16+ || newMode == AudioManager.MODE_IN_CALL) {
17+ mAudioManager.setParameters("realcall=on");
18+ }
19+ }
20
21 if (oldMode != newMode) {
22 if (oldMode == AudioManager.MODE_IN_CALL && newMode == AudioManager.MODE_RINGTONE) {
23
24diff -ur a/hardware/qcom/fm/fmapp2/src/com/caf/fmradio/FMRadioService.java b/hardware/qcom/fm/fmapp2/src/com/caf/fmradio/FMRadioService.java
25--- a/hardware/qcom/fm/fmapp2/src/com/caf/fmradio/FMRadioService.java Mon Jun 20 17:28:46 2016
26+++ b/hardware/qcom/fm/fmapp2/src/com/caf/fmradio/FMRadioService.java Mon Jun 27 10:45:01 2016
27@@ -926,9 +926,19 @@
28 mSpeakerPhoneOn = true;
29 Log.d(LOGTAG, "Audio source set it as speaker");
30 AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, AudioSystem.FORCE_SPEAKER);
31+ mAudioManager.setParameters("fm_mode=on");
32+ mAudioManager.setParameters("fm_radio_volume=on");
33+ mAudioManager.setParameters("FMRadioVol=0.1496235728");
34+ mAudioManager.setMode(AudioManager.MODE_IN_CALL);
35+ mAudioManager.setSpeakerphoneOn(true);
36 } else {
37 Log.d(LOGTAG, "Audio source set it as headset");
38 AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, AudioSystem.FORCE_NONE);
39+ mAudioManager.setParameters("fm_mode=on");
40+ mAudioManager.setParameters("fm_radio_volume=on");
41+ mAudioManager.setParameters("FMRadioVol=0.1496235728");
42+ mAudioManager.setMode(AudioManager.MODE_IN_CALL);
43+ mAudioManager.setSpeakerphoneOn(false);
44 }
45 AudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_OUT_FM,
46 AudioSystem.DEVICE_STATE_AVAILABLE, "");
47@@ -947,6 +957,8 @@
48 stopA2dpPlayback();
49 }else{
50 Log.d(LOGTAG, "FMRadio: Requesting to stop FM");
51+ mAudioManager.setParameters("fm_mode=off");
52+ mAudioManager.setParameters("fm_radio_mute=1");
53 AudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_OUT_FM,
54 AudioSystem.DEVICE_STATE_UNAVAILABLE, "");
55 }
56@@ -960,6 +972,8 @@
57 resetA2dpPlayback();
58 }else{
59 Log.d(LOGTAG, "FMRadio: Requesting to stop FM");
60+ mAudioManager.setParameters("fm_mode=off");
61+ mAudioManager.setParameters("fm_radio_mute=1");
62 AudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_OUT_FM,
63 AudioSystem.DEVICE_STATE_UNAVAILABLE, "");
64 sendRecordServiceIntent(RECORD_STOP);
65@@ -1168,6 +1182,7 @@
66 if (audioManager != null) {
67 Log.d(LOGTAG, "Mute");
68 mMuted = true;
69+ audioManager.setParameters("fm_radio_mute=1");
70 audioManager.setStreamMute(AudioManager.STREAM_MUSIC,true);
71 }
72 }
73@@ -2095,6 +2110,7 @@
74 stopRecording();
75 stopFM();
76 AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, AudioSystem.FORCE_NONE);
77+ mAudioManager.setSpeakerphoneOn(false);
78 if (mMuted) {
79 setAudioPath(true);
80 } else {
81@@ -2104,6 +2120,7 @@
82 }
83 } else {
84 AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, AudioSystem.FORCE_NONE);
85+ mAudioManager.setSpeakerphoneOn(false);
86 }
87 if (analogmode)
88 startFM();
89@@ -2131,6 +2148,7 @@
90 }
91 }
92 AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, AudioSystem.FORCE_SPEAKER);
93+ mAudioManager.setSpeakerphoneOn(true);
94 if (analogmode)
95 startFM();
96 }
97@@ -2231,6 +2249,7 @@
98 if (audioManager != null)
99 {
100 mMuted = true;
101+ audioManager.setParameters("fm_radio_mute=1");
102 audioManager.setStreamMute(AudioManager.STREAM_MUSIC,true);
103 }
104 return bCommandSent;
105@@ -2251,6 +2270,7 @@
106 if (audioManager != null)
107 {
108 mMuted = false;
109+ audioManager.setParameters("fm_radio_mute=0");
110 audioManager.setStreamMute(AudioManager.STREAM_MUSIC,false);
111 if (mResumeAfterCall)
112 {
113