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" <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="singleTop">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
</intent-filter> </intent-filter>

View file

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

View file

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