remove dead and dangerous code.
Indeed, if linphone was started when a gsm call is active, max_calls was irrecoverably set to 0, which caused no calls to be sent or received.
This commit is contained in:
parent
2096f2730d
commit
3c53044a44
1 changed files with 0 additions and 30 deletions
|
@ -361,9 +361,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
// H264 codec Management - set to auto mode -> MediaCodec >= android 5.0 >= OpenH264
|
// H264 codec Management - set to auto mode -> MediaCodec >= android 5.0 >= OpenH264
|
||||||
H264Helper.setH264Mode(H264Helper.MODE_AUTO, getLc());
|
H264Helper.setH264Mode(H264Helper.MODE_AUTO, getLc());
|
||||||
|
|
||||||
TelephonyManager tm = (TelephonyManager) c.getSystemService(Context.TELEPHONY_SERVICE);
|
|
||||||
boolean gsmIdle = tm.getCallState() == TelephonyManager.CALL_STATE_IDLE;
|
|
||||||
setGsmIdle(gsmIdle);
|
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
@ -1325,33 +1322,6 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int savedMaxCallWhileGsmIncall;
|
|
||||||
private synchronized void preventSIPCalls() {
|
|
||||||
if (savedMaxCallWhileGsmIncall != 0) {
|
|
||||||
Log.w("SIP calls are already blocked due to GSM call running");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
savedMaxCallWhileGsmIncall = mLc.getMaxCalls();
|
|
||||||
mLc.setMaxCalls(0);
|
|
||||||
}
|
|
||||||
private synchronized void allowSIPCalls() {
|
|
||||||
if (savedMaxCallWhileGsmIncall == 0) {
|
|
||||||
Log.w("SIP calls are already allowed as no GSM call known to be running");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mLc.setMaxCalls(savedMaxCallWhileGsmIncall);
|
|
||||||
savedMaxCallWhileGsmIncall = 0;
|
|
||||||
}
|
|
||||||
public static void setGsmIdle(boolean gsmIdle) {
|
|
||||||
LinphoneManager mThis = instance;
|
|
||||||
if (mThis == null) return;
|
|
||||||
if (gsmIdle) {
|
|
||||||
mThis.allowSIPCalls();
|
|
||||||
} else {
|
|
||||||
mThis.preventSIPCalls();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Context getContext() {
|
public Context getContext() {
|
||||||
try {
|
try {
|
||||||
if (LinphoneActivity.isInstanciated())
|
if (LinphoneActivity.isInstanciated())
|
||||||
|
|
Loading…
Reference in a new issue