diff --git a/res/layout/accept_call_update_dialog.xml b/res/layout/accept_call_update_dialog.xml
new file mode 100644
index 000000000..cede720a5
--- /dev/null
+++ b/res/layout/accept_call_update_dialog.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/res/values-FR/strings.xml b/res/values-FR/strings.xml
index e00baca0d..9e84cc952 100644
--- a/res/values-FR/strings.xml
+++ b/res/values-FR/strings.xml
@@ -285,7 +285,7 @@
Tout supprimer
Transfert
- Ajouter appel
+ + Appel
Vidéo
Micro
Haut parleur
@@ -294,6 +294,11 @@
Envoyer
Img
Envoi en cours…
+
+ Mise à jour de l'appel
+ Votre correspondant souhaite ajouter la vidéo à l\'appel en cours.
+ Accepter
+ Refuser
Petite
Moyenne
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d355bc5af..fce8489e5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -345,6 +345,11 @@
Send
Pic
Uploading…
+
+ Call update requested
+ Your correspondent would like to add video to the current call.
+ Accept
+ Decline
Small
Medium
diff --git a/src/org/linphone/InCallActivity.java b/src/org/linphone/InCallActivity.java
index 6cbb9bce7..807d958ba 100644
--- a/src/org/linphone/InCallActivity.java
+++ b/src/org/linphone/InCallActivity.java
@@ -27,6 +27,7 @@ import org.linphone.core.LinphoneCall.State;
import org.linphone.core.LinphoneCallParams;
import org.linphone.core.LinphoneCore;
import org.linphone.core.LinphoneCoreException;
+import org.linphone.core.Log;
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
import org.linphone.ui.Numpad;
@@ -38,10 +39,13 @@ import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.preference.PreferenceManager;
+import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.KeyEvent;
+import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
@@ -50,6 +54,7 @@ import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
+import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
@@ -79,6 +84,7 @@ public class InCallActivity extends FragmentActivity implements
private int cameraNumber;
private Animation slideOutLeftToRight, slideInRightToLeft, slideInBottomToTop, slideInTopToBottom, slideOutBottomToTop, slideOutTopToBottom;
private CountDownTimer timer;
+ private AcceptCallUpdateDialog callUpdateDialog;
public static InCallActivity instance() {
return instance;
@@ -816,6 +822,10 @@ public class InCallActivity extends FragmentActivity implements
if (timer != null) {
timer.cancel();
}
+
+ if (callUpdateDialog != null) {
+ callUpdateDialog.dismissAllowingStateLoss();
+ }
LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
if (call == null) {
@@ -890,7 +900,7 @@ public class InCallActivity extends FragmentActivity implements
if (remoteVideo && !localVideo && !autoAcceptCameraPolicy && !LinphoneManager.getLc().isInConference()) {
mHandler.post(new Runnable() {
public void run() {
- //TODO: ask the user it's choice
+ showAcceptCallUpdateDialog();
// We let 30 secs for the user to decide
timer = new CountDownTimer(30000, 1000) {
@@ -913,6 +923,12 @@ public class InCallActivity extends FragmentActivity implements
transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
}
+
+ private void showAcceptCallUpdateDialog() {
+ FragmentManager fm = getSupportFragmentManager();
+ callUpdateDialog = new AcceptCallUpdateDialog();
+ callUpdateDialog.show(fm, "Accept Call Update Dialog");
+ }
@Override
public void onCallEncryptionChanged(final LinphoneCall call, boolean encrypted, String authenticationToken) {
@@ -998,4 +1014,38 @@ public class InCallActivity extends FragmentActivity implements
public void bindVideoFragment(VideoCallFragment fragment) {
videoCallFragment = fragment;
}
+
+ class AcceptCallUpdateDialog extends DialogFragment {
+
+ public AcceptCallUpdateDialog() {
+ // Empty constructor required for DialogFragment
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.accept_call_update_dialog, container);
+
+ getDialog().setTitle(R.string.call_update_title);
+
+ Button yes = (Button) view.findViewById(R.id.yes);
+ yes.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Log.d("Call Update Accepted");
+ acceptCallUpdate(true);
+ }
+ });
+
+ Button no = (Button) view.findViewById(R.id.no);
+ no.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Log.d("Call Update Denied");
+ acceptCallUpdate(false);
+ }
+ });
+
+ return view;
+ }
+ }
}