Fix incoming activity not showing up issue
This commit is contained in:
parent
a7f77655d3
commit
176f98c9df
5 changed files with 30 additions and 9 deletions
|
@ -84,7 +84,7 @@
|
||||||
<activity android:name="org.linphone.InCallActivity"
|
<activity android:name="org.linphone.InCallActivity"
|
||||||
android:theme="@style/FullScreen"
|
android:theme="@style/FullScreen"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
android:launchMode="singleInstance">
|
android:launchMode="singleTask">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
|
@ -1009,7 +1009,6 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
instance = this;
|
instance = this;
|
||||||
LinphoneManager.addListener(this);
|
|
||||||
|
|
||||||
if (isVideoEnabled) {
|
if (isVideoEnabled) {
|
||||||
displayVideoCallControlsIfHidden();
|
displayVideoCallControlsIfHidden();
|
||||||
|
@ -1019,6 +1018,8 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
|
LinphoneManager.addListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -23,6 +23,7 @@ import static android.content.Intent.ACTION_MAIN;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.linphone.LinphoneManager.AddressType;
|
import org.linphone.LinphoneManager.AddressType;
|
||||||
|
@ -1267,14 +1268,14 @@ public class LinphoneActivity extends FragmentActivity implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
|
LinphoneManager.removeListener(this);
|
||||||
|
|
||||||
super.onPause();
|
super.onPause();
|
||||||
refreshStatus(OnlineStatus.Away);
|
refreshStatus(OnlineStatus.Away);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onDestroy() {
|
protected void onDestroy() {
|
||||||
LinphoneManager.removeListener(this);
|
|
||||||
|
|
||||||
if (chatStorage != null) {
|
if (chatStorage != null) {
|
||||||
chatStorage.close();
|
chatStorage.close();
|
||||||
chatStorage = null;
|
chatStorage = null;
|
||||||
|
@ -1327,7 +1328,10 @@ public class LinphoneActivity extends FragmentActivity implements
|
||||||
((DialerFragment) dialerFragment).newOutgoingCall(intent);
|
((DialerFragment) dialerFragment).newOutgoingCall(intent);
|
||||||
}
|
}
|
||||||
if (LinphoneManager.getLc().getCalls().length > 0) {
|
if (LinphoneManager.getLc().getCalls().length > 0) {
|
||||||
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
LinphoneCall calls[] = LinphoneManager.getLc().getCalls();
|
||||||
|
if (calls.length > 0) {
|
||||||
|
LinphoneCall call = calls[0];
|
||||||
|
|
||||||
if (call != null && call.getState() != LinphoneCall.State.IncomingReceived) {
|
if (call != null && call.getState() != LinphoneCall.State.IncomingReceived) {
|
||||||
if (call.getCurrentParamsCopy().getVideoEnabled()) {
|
if (call.getCurrentParamsCopy().getVideoEnabled()) {
|
||||||
startVideoActivity(call);
|
startVideoActivity(call);
|
||||||
|
@ -1336,6 +1340,18 @@ public class LinphoneActivity extends FragmentActivity implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If a call is ringing, start incomingcallactivity
|
||||||
|
Collection<LinphoneCall.State> incoming = new ArrayList<LinphoneCall.State>();
|
||||||
|
incoming.add(LinphoneCall.State.IncomingReceived);
|
||||||
|
if (LinphoneUtils.getCallsInState(LinphoneManager.getLc(), incoming).size() > 0) {
|
||||||
|
if (InCallActivity.isInstanciated()) {
|
||||||
|
InCallActivity.instance().startIncomingCallActivity();
|
||||||
|
} else {
|
||||||
|
startActivity(new Intent(this, IncomingCallActivity.class));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,7 @@ import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
||||||
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration.AndroidCamera;
|
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration.AndroidCamera;
|
||||||
import org.linphone.mediastream.video.capture.hwconf.Hacks;
|
import org.linphone.mediastream.video.capture.hwconf.Hacks;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
|
@ -1004,6 +1005,7 @@ public final class LinphoneManager implements LinphoneCoreListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("Wakelock")
|
||||||
public void callState(final LinphoneCore lc,final LinphoneCall call, final State state, final String message) {
|
public void callState(final LinphoneCore lc,final LinphoneCall call, final State state, final String message) {
|
||||||
Log.i("new state [",state,"]");
|
Log.i("new state [",state,"]");
|
||||||
if (state == IncomingReceived && !call.equals(lc.getCurrentCall())) {
|
if (state == IncomingReceived && !call.equals(lc.getCurrentCall())) {
|
||||||
|
|
|
@ -546,6 +546,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
||||||
Log.i("Service not ready, discarding call state change to ",state.toString());
|
Log.i("Service not ready, discarding call state change to ",state.toString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == LinphoneCall.State.IncomingReceived) {
|
if (state == LinphoneCall.State.IncomingReceived) {
|
||||||
onIncomingReceived();
|
onIncomingReceived();
|
||||||
}
|
}
|
||||||
|
@ -574,6 +575,7 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
|
||||||
if ((state == State.CallEnd || state == State.Error) && LinphoneManager.getLc().getCallsNb() < 1) {
|
if ((state == State.CallEnd || state == State.Error) && LinphoneManager.getLc().getCallsNb() < 1) {
|
||||||
mWifiLock.release();
|
mWifiLock.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
mHandler.post(new Runnable() {
|
mHandler.post(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
if (guiListener() != null)
|
if (guiListener() != null)
|
||||||
|
|
Loading…
Reference in a new issue