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);
@ -1259,6 +1260,12 @@ public class LinphoneActivity extends FragmentActivity implements
} }
} }
@Override
protected void onPause() {
getIntent().putExtra("PreviousActivity", 0);
super.onPause();
}
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
@ -1279,12 +1286,14 @@ public class LinphoneActivity extends FragmentActivity implements
LinphoneManager.getInstance().changeStatusToOnline(); LinphoneManager.getInstance().changeStatusToOnline();
if(getIntent().getIntExtra("PreviousActivity", 0) != CALL_ACTIVITY){
if (LinphoneManager.getLc().getCalls().length > 0) { if (LinphoneManager.getLc().getCalls().length > 0) {
LinphoneCall call = LinphoneManager.getLc().getCalls()[0]; LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
LinphoneCall.State callState = call.getState(); LinphoneCall.State callState = call.getState();
if (callState == State.IncomingReceived) { if (callState == State.IncomingReceived) {
startActivity(new Intent(this, IncomingCallActivity.class)); startActivity(new Intent(this, IncomingCallActivity.class));
} else { } else {
if (call.getCurrentParamsCopy().getVideoEnabled()) { if (call.getCurrentParamsCopy().getVideoEnabled()) {
startVideoActivity(call); startVideoActivity(call);
} else { } else {
@ -1293,6 +1302,7 @@ public class LinphoneActivity extends FragmentActivity implements
} }
} }
} }
}
@Override @Override
protected void onDestroy() { protected void onDestroy() {