Prevent some crashes
This commit is contained in:
parent
83635ffc45
commit
b212ad4ce1
2 changed files with 16 additions and 11 deletions
|
@ -88,12 +88,15 @@ public class IncomingCallActivity extends Activity implements LinphoneOnCallStat
|
|||
super.onResume();
|
||||
instance = this;
|
||||
LinphoneManager.addListener(this);
|
||||
|
||||
// Only one call ringing at a time is allowed
|
||||
List<LinphoneCall> calls = LinphoneUtils.getLinphoneCalls(LinphoneManager.getLc());
|
||||
for (LinphoneCall call : calls) {
|
||||
if (State.IncomingReceived == call.getState()) {
|
||||
mCall = call;
|
||||
break;
|
||||
if (LinphoneManager.getLcIfManagerNotDestroyedOrNull() != null) {
|
||||
List<LinphoneCall> calls = LinphoneUtils.getLinphoneCalls(LinphoneManager.getLc());
|
||||
for (LinphoneCall call : calls) {
|
||||
if (State.IncomingReceived == call.getState()) {
|
||||
mCall = call;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mCall == null) {
|
||||
|
|
|
@ -1032,12 +1032,14 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
|||
}
|
||||
|
||||
public Context getActivity() {
|
||||
if (LinphoneActivity.isInstanciated())
|
||||
return LinphoneActivity.instance();
|
||||
else if (InCallActivity.isInstanciated())
|
||||
return InCallActivity.instance();
|
||||
else if (IncomingCallActivity.isInstanciated())
|
||||
return IncomingCallActivity.instance();
|
||||
try {
|
||||
if (LinphoneActivity.isInstanciated())
|
||||
return LinphoneActivity.instance();
|
||||
else if (InCallActivity.isInstanciated())
|
||||
return InCallActivity.instance();
|
||||
else if (IncomingCallActivity.isInstanciated())
|
||||
return IncomingCallActivity.instance();
|
||||
} catch (Exception e) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue