Some fix for Bluetooth management
This commit is contained in:
parent
6b1fc72b5e
commit
a79d71c70d
2 changed files with 46 additions and 52 deletions
|
@ -1203,7 +1203,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
// Brighten screen for at least 10 seconds
|
||||
if (mLc.getCallsNb() == 1) {
|
||||
requestAudioFocus(STREAM_RING);
|
||||
BluetoothManager.getInstance().disableBluetoothSCO(); // Just in case
|
||||
|
||||
ringingCall = call;
|
||||
startRinging();
|
||||
|
@ -1218,10 +1217,12 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
if (mLc.getCallsNb() == 1) {
|
||||
//It is for incoming calls, because outgoing calls enter MODE_IN_COMMUNICATION immediately when they start.
|
||||
//However, incoming call first use the MODE_RINGING to play the local ring.
|
||||
if(call.getDirection() == CallDirection.Incoming) {
|
||||
setAudioManagerInCallMode();
|
||||
mAudioManager.abandonAudioFocus(null);
|
||||
requestAudioFocus(STREAM_VOICE_CALL);
|
||||
}
|
||||
}
|
||||
|
||||
if (Hacks.needSoftvolume()) {
|
||||
Log.w("Using soft volume audio hack");
|
||||
|
@ -1293,13 +1294,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
|||
public void startBluetooth() {
|
||||
if (BluetoothManager.getInstance().isBluetoothHeadsetAvailable()) {
|
||||
BluetoothManager.getInstance().routeAudioToBluetooth();
|
||||
// Hack to ensure the bluetooth route is really used
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
BluetoothManager.getInstance().routeAudioToBluetooth();
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue