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