Fix transfer and add call

This commit is contained in:
Margaux Clerc 2014-09-02 14:28:36 +02:00
parent f3143bc887
commit 7596f7300b
3 changed files with 23 additions and 14 deletions

View file

@ -89,7 +89,7 @@
<activity android:name="org.linphone.InCallActivity"
android:theme="@style/FullScreen"
android:noHistory="true"
android:launchMode="singleInstance">
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>

View file

@ -41,7 +41,6 @@ import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.net.Uri;
import android.opengl.Visibility;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;

View file

@ -1248,6 +1248,7 @@ public class LinphoneActivity extends FragmentActivity implements
selectMenu(newFragment);
}
} else if (resultCode == Activity.RESULT_FIRST_USER && requestCode == CALL_ACTIVITY) {
getIntent().putExtra("PreviousActivity", CALL_ACTIVITY);
boolean callTransfer = data == null ? false : data.getBooleanExtra("Transfer", false);
if (LinphoneManager.getLc().getCallsNb() > 0) {
initInCallMenuLayout(callTransfer);
@ -1259,6 +1260,12 @@ public class LinphoneActivity extends FragmentActivity implements
}
}
@Override
protected void onPause() {
getIntent().putExtra("PreviousActivity", 0);
super.onPause();
}
@Override
protected void onResume() {
super.onResume();
@ -1279,18 +1286,21 @@ public class LinphoneActivity extends FragmentActivity implements
LinphoneManager.getInstance().changeStatusToOnline();
if (LinphoneManager.getLc().getCalls().length > 0) {
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
LinphoneCall.State callState = call.getState();
if (callState == State.IncomingReceived) {
startActivity(new Intent(this, IncomingCallActivity.class));
} else {
if (call.getCurrentParamsCopy().getVideoEnabled()) {
startVideoActivity(call);
if(getIntent().getIntExtra("PreviousActivity", 0) != CALL_ACTIVITY){
if (LinphoneManager.getLc().getCalls().length > 0) {
LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
LinphoneCall.State callState = call.getState();
if (callState == State.IncomingReceived) {
startActivity(new Intent(this, IncomingCallActivity.class));
} else {
startIncallActivity(call);
if (call.getCurrentParamsCopy().getVideoEnabled()) {
startVideoActivity(call);
} else {
startIncallActivity(call);
}
}
}
}
}
}