diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 09b912981..d15e3547a 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -197,6 +197,8 @@ Vos amis pourront vous joindre plus facilement si vous associez votre compte à
Aucun appel en cours
Une erreur est survenue pendant l\'acceptation de l\'appel
Indiquez le code SAS suivant à votre interlocuteur:\nDites: %s
+ SAS
+ Veulliez vérifier par oral avec votre interlocatueur qu\'il dispose de ce code.
Inconnu
Audio
Vidéo
diff --git a/res/values/strings.xml b/res/values/strings.xml
index e2dd3a0d0..eb53619d0 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -212,6 +212,8 @@
An error occurred while accepting the call
Confirm the following SAS with peer:\nSay: %s
\nYour caller should say: %s
+ SAS
+ Confirm the previous SAS code with your correspondant
Unknown
Audio
Video
diff --git a/src/android/org/linphone/CallActivity.java b/src/android/org/linphone/CallActivity.java
index 0fea400b9..8dfadd1e7 100644
--- a/src/android/org/linphone/CallActivity.java
+++ b/src/android/org/linphone/CallActivity.java
@@ -166,6 +166,10 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList
@Override
public void callState(LinphoneCore lc, final LinphoneCall call, LinphoneCall.State state, String message) {
if (LinphoneManager.getLc().getCallsNb() == 0) {
+ if (status != null) {
+ LinphoneService.instance().removeSasNotification();
+ status.setisZrtpAsk(false);
+ }
finish();
return;
}
diff --git a/src/android/org/linphone/LinphoneActivity.java b/src/android/org/linphone/LinphoneActivity.java
index 013e0b604..6c2db45f6 100644
--- a/src/android/org/linphone/LinphoneActivity.java
+++ b/src/android/org/linphone/LinphoneActivity.java
@@ -1438,7 +1438,7 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
-
+
if (getCurrentFragment() == FragmentsAvailable.SETTINGS) {
if (fragment instanceof SettingsFragment) {
((SettingsFragment) fragment).closePreferenceScreen();
diff --git a/src/android/org/linphone/LinphoneService.java b/src/android/org/linphone/LinphoneService.java
index f9e139640..26b221d82 100644
--- a/src/android/org/linphone/LinphoneService.java
+++ b/src/android/org/linphone/LinphoneService.java
@@ -94,6 +94,7 @@ public final class LinphoneService extends Service {
private final static int MESSAGE_NOTIF_ID=3;
private final static int CUSTOM_NOTIF_ID=4;
private final static int MISSED_NOTIF_ID=5;
+ private final static int SAS_NOTIF_ID=6;
public static boolean isReady() {
return instance != null && instance.mTestDelayElapsed;
@@ -118,6 +119,7 @@ public final class LinphoneService extends Service {
private Notification mIncallNotif;
private Notification mMsgNotif;
private Notification mCustomNotif;
+ private Notification mSasNotif;
private int mMsgNotifCount;
private PendingIntent mNotifContentIntent;
private String mNotificationTitle;
@@ -347,6 +349,12 @@ public final class LinphoneService extends Service {
}
if (state == State.CallEnd || state == State.CallReleased || state == State.Error) {
+ if (LinphoneManager.isInstanciated() && LinphoneManager.getLc() != null && LinphoneManager.getLc().getCallsNb() == 0) {
+ if (LinphoneActivity.isInstanciated() && LinphoneActivity.instance().getStatusFragment() != null) {
+ removeSasNotification();
+ LinphoneActivity.instance().getStatusFragment().setisZrtpAsk(false);
+ }
+ }
destroyOverlay();
}
@@ -415,7 +423,7 @@ public final class LinphoneService extends Service {
}
});
-
+
try {
mStartForeground = getClass().getMethod("startForeground", mStartFgSign);
mStopForeground = getClass().getMethod("stopForeground", mStopFgSign);
@@ -634,6 +642,19 @@ public final class LinphoneService extends Service {
resetIntentLaunchedOnNotificationClick();
}
+ public void displaySasNotification(String sas) {
+ mSasNotif = Compatibility.createSimpleNotification(getApplicationContext(),
+ getString(R.string.zrtp_notification_title),
+ sas + " " + getString(R.string.zrtp_notification_message),
+ null);
+
+ notifyWrapper(SAS_NOTIF_ID, mSasNotif);
+ }
+
+ public void removeSasNotification() {
+ mNM.cancel(SAS_NOTIF_ID);
+ }
+
private static final Class>[] mSetFgSign = new Class[] {boolean.class};
private static final Class>[] mStartFgSign = new Class[] {
int.class, Notification.class};
diff --git a/src/android/org/linphone/StatusFragment.java b/src/android/org/linphone/StatusFragment.java
index a9216e51d..169db023c 100644
--- a/src/android/org/linphone/StatusFragment.java
+++ b/src/android/org/linphone/StatusFragment.java
@@ -416,6 +416,8 @@ public class StatusFragment extends Fragment {
zrtpToRead = token.substring(2);
}
+ LinphoneService.instance().displaySasNotification(token);
+
TextView customText = (TextView) ZRTPdialog.findViewById(R.id.customText);
String newText = getString(R.string.zrtp_dialog1).replace("%s", zrtpToRead)
+ getString(R.string.zrtp_dialog2).replace("%s", zrtpToListen);
@@ -434,6 +436,7 @@ public class StatusFragment extends Fragment {
}
isZrtpAsk = false;
ZRTPdialog.dismiss();
+ LinphoneService.instance().removeSasNotification();
}
});
@@ -448,6 +451,7 @@ public class StatusFragment extends Fragment {
}
isZrtpAsk = false;
ZRTPdialog.dismiss();
+ LinphoneService.instance().removeSasNotification();
}
});
ZRTPdialog.show();