fix(Android/ConnectionService): mic not working
Turns out the microphone will not work on some devices when starting in "audio only", because the audio mode is not set to the MODE_IN_COMMUNICATION, but to the MODE_IN_CALL. Calling setAudioModeIsVoip(true) makes the system adjust to MODE_IN_COMMUNICATION and the mic works fine.
This commit is contained in:
parent
6894de00cc
commit
3b24124d57
|
@ -191,6 +191,9 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
request.getAddress(),
|
request.getAddress(),
|
||||||
TelecomManager.PRESENTATION_ALLOWED);
|
TelecomManager.PRESENTATION_ALLOWED);
|
||||||
connection.setExtras(request.getExtras());
|
connection.setExtras(request.getExtras());
|
||||||
|
|
||||||
|
connection.setAudioModeIsVoip(true);
|
||||||
|
|
||||||
// NOTE there's a time gap between the placeCall and this callback when
|
// NOTE there's a time gap between the placeCall and this callback when
|
||||||
// things could get out of sync, but they are put back in sync once
|
// things could get out of sync, but they are put back in sync once
|
||||||
// the startCall Promise is resolved below. That's because on
|
// the startCall Promise is resolved below. That's because on
|
||||||
|
@ -426,7 +429,7 @@ public class ConnectionService extends android.telecom.ConnectionService {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return String.format(
|
return String.format(
|
||||||
"ConnectionImpl[adress=%s, uuid=%s]@%d",
|
"ConnectionImpl[address=%s, uuid=%s]@%d",
|
||||||
getAddress(), getCallUUID(), hashCode());
|
getAddress(), getCallUUID(), hashCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue