blob: 10da503b32fe9d6e7399acce8c29a7d76f839dde [file] [log] [blame]
diff -ur a/frameworks/base/media/jni/android_mtp_MtpServer.cpp b/frameworks/base/media/jni/android_mtp_MtpServer.cpp
--- a/frameworks/base/media/jni/android_mtp_MtpServer.cpp 2016-08-25 00:31:48.620239171 -0400
+++ b/frameworks/base/media/jni/android_mtp_MtpServer.cpp 2016-08-25 00:31:16.613558876 -0400
@@ -59,7 +59,7 @@
static void
android_mtp_MtpServer_setup(JNIEnv *env, jobject thiz, jobject javaDatabase, jboolean usePtp)
{
- int fd = open("/dev/mtp_usb", O_RDWR);
+ int fd = open("/dev/usb_mtp_gadget", O_RDWR);
if (fd >= 0) {
MtpServer* server = new MtpServer(fd, getMtpDatabase(env, javaDatabase),
usePtp, AID_MEDIA_RW, 0664, 0775);
diff -ur a/packages/services/Telecomm/src/com/android/server/telecom/CallAudioManager.java b/packages/services/Telecomm/src/com/android/server/telecom/CallAudioManager.java
--- a/packages/services/Telecomm/src/com/android/server/telecom/CallAudioManager.java Wed Apr 20 08:50:20 2016
+++ b/packages/services/Telecomm/src/com/android/server/telecom/CallAudioManager.java Thu May 12 01:31:40 2016
@@ -481,8 +481,18 @@
Call call = CallsManager.getInstance().getForegroundCall();
boolean setMsimAudioParams = SystemProperties.getBoolean("ro.multisim.set_audio_params", false);
+ boolean setSamsungRealcallParams = SystemProperties.getBoolean("ro.telephony.samsung.realcall", false);
Log.v(this, "Request to change audio mode from %d to %d", oldMode, newMode);
+
+ if(setSamsungRealcallParams) {
+ if(newMode == 0) {
+ mAudioManager.setParameters("realcall=off");
+ } else if(newMode == AudioManager.MODE_IN_COMMUNICATION || newMode == AudioManager.MODE_RINGTONE
+ || newMode == AudioManager.MODE_IN_CALL) {
+ mAudioManager.setParameters("realcall=on");
+ }
+ }
if (oldMode != newMode) {
if (oldMode == AudioManager.MODE_IN_CALL && newMode == AudioManager.MODE_RINGTONE) {
diff -ur a/hardware/qcom/fm/fmapp2/src/com/caf/fmradio/FMRadioService.java b/hardware/qcom/fm/fmapp2/src/com/caf/fmradio/FMRadioService.java
--- a/hardware/qcom/fm/fmapp2/src/com/caf/fmradio/FMRadioService.java Mon Jun 20 17:28:46 2016
+++ b/hardware/qcom/fm/fmapp2/src/com/caf/fmradio/FMRadioService.java Mon Jun 27 10:45:01 2016
@@ -926,9 +926,19 @@
mSpeakerPhoneOn = true;
Log.d(LOGTAG, "Audio source set it as speaker");
AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, AudioSystem.FORCE_SPEAKER);
+ mAudioManager.setParameters("fm_mode=on");
+ mAudioManager.setParameters("fm_radio_volume=on");
+ mAudioManager.setParameters("FMRadioVol=0.1496235728");
+ mAudioManager.setMode(AudioManager.MODE_IN_CALL);
+ mAudioManager.setSpeakerphoneOn(true);
} else {
Log.d(LOGTAG, "Audio source set it as headset");
AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, AudioSystem.FORCE_NONE);
+ mAudioManager.setParameters("fm_mode=on");
+ mAudioManager.setParameters("fm_radio_volume=on");
+ mAudioManager.setParameters("FMRadioVol=0.1496235728");
+ mAudioManager.setMode(AudioManager.MODE_IN_CALL);
+ mAudioManager.setSpeakerphoneOn(false);
}
AudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_OUT_FM,
AudioSystem.DEVICE_STATE_AVAILABLE, "");
@@ -947,6 +957,8 @@
stopA2dpPlayback();
}else{
Log.d(LOGTAG, "FMRadio: Requesting to stop FM");
+ mAudioManager.setParameters("fm_mode=off");
+ mAudioManager.setParameters("fm_radio_mute=1");
AudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_OUT_FM,
AudioSystem.DEVICE_STATE_UNAVAILABLE, "");
}
@@ -960,6 +972,8 @@
resetA2dpPlayback();
}else{
Log.d(LOGTAG, "FMRadio: Requesting to stop FM");
+ mAudioManager.setParameters("fm_mode=off");
+ mAudioManager.setParameters("fm_radio_mute=1");
AudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_OUT_FM,
AudioSystem.DEVICE_STATE_UNAVAILABLE, "");
sendRecordServiceIntent(RECORD_STOP);
@@ -1168,6 +1182,7 @@
if (audioManager != null) {
Log.d(LOGTAG, "Mute");
mMuted = true;
+ audioManager.setParameters("fm_radio_mute=1");
audioManager.setStreamMute(AudioManager.STREAM_MUSIC,true);
}
}
@@ -2095,6 +2110,7 @@
stopRecording();
stopFM();
AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, AudioSystem.FORCE_NONE);
+ mAudioManager.setSpeakerphoneOn(false);
if (mMuted) {
setAudioPath(true);
} else {
@@ -2104,6 +2120,7 @@
}
} else {
AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, AudioSystem.FORCE_NONE);
+ mAudioManager.setSpeakerphoneOn(false);
}
if (analogmode)
startFM();
@@ -2131,6 +2148,7 @@
}
}
AudioSystem.setForceUse(AudioSystem.FOR_MEDIA, AudioSystem.FORCE_SPEAKER);
+ mAudioManager.setSpeakerphoneOn(true);
if (analogmode)
startFM();
}
@@ -2231,6 +2249,7 @@
if (audioManager != null)
{
mMuted = true;
+ audioManager.setParameters("fm_radio_mute=1");
audioManager.setStreamMute(AudioManager.STREAM_MUSIC,true);
}
return bCommandSent;
@@ -2251,6 +2270,7 @@
if (audioManager != null)
{
mMuted = false;
+ audioManager.setParameters("fm_radio_mute=0");
audioManager.setStreamMute(AudioManager.STREAM_MUSIC,false);
if (mResumeAfterCall)
{