diff --git a/src/android/org/linphone/StatusFragment.java b/src/android/org/linphone/StatusFragment.java index 079597167..35ddc7415 100644 --- a/src/android/org/linphone/StatusFragment.java +++ b/src/android/org/linphone/StatusFragment.java @@ -387,6 +387,17 @@ public class StatusFragment extends Fragment { } if(ZRTPdialog == null || !ZRTPdialog.isShowing()) { + String token = call.getAuthenticationToken(); + + if (token == null){ + Log.w("Can't display ZRTP popup, no token !"); + return; + } + if (token.length()<4){ + Log.w("Can't display ZRTP popup, token is invalid ("+token+")"); + return; + } + ZRTPdialog = new Dialog(getActivity()); ZRTPdialog.requestWindowFeature(Window.FEATURE_NO_TITLE); Drawable d = new ColorDrawable(ContextCompat.getColor(getActivity(), R.color.colorC)); @@ -395,13 +406,14 @@ public class StatusFragment extends Fragment { ZRTPdialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT); ZRTPdialog.getWindow().setBackgroundDrawable(d); String zrtpToRead, zrtpToListen; + if (call.getDirection().equals(CallDirection.Incoming)) { - zrtpToRead = call.getAuthenticationToken().substring(0,2); - zrtpToListen = call.getAuthenticationToken().substring(2); + zrtpToRead = token.substring(0,2); + zrtpToListen = token.substring(2); } else { - zrtpToListen = call.getAuthenticationToken().substring(0,2); - zrtpToRead = call.getAuthenticationToken().substring(2); + zrtpToListen = token.substring(0,2); + zrtpToRead = token.substring(2); } TextView customText = (TextView) ZRTPdialog.findViewById(R.id.customText); diff --git a/submodules/bctoolbox b/submodules/bctoolbox index 0cda86868..e93227f56 160000 --- a/submodules/bctoolbox +++ b/submodules/bctoolbox @@ -1 +1 @@ -Subproject commit 0cda8686829e23387c4468f33c71425bcc36b9d7 +Subproject commit e93227f56dc0c2299de20ac1460bfdb72e8e695b diff --git a/submodules/bzrtp b/submodules/bzrtp index 1d092f58e..4c37a23c8 160000 --- a/submodules/bzrtp +++ b/submodules/bzrtp @@ -1 +1 @@ -Subproject commit 1d092f58ec8e04c617e2288577cbedfab7bf9e6a +Subproject commit 4c37a23c805e7f08c8874d848525a720c165c906 diff --git a/submodules/linphone b/submodules/linphone index 145b15c27..2637c2a15 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 145b15c2712c787f3d0129b7d643a4df5d1e6a2e +Subproject commit 2637c2a15e3d26720908eaa64ab6b03533979670 diff --git a/submodules/mediastreamer2 b/submodules/mediastreamer2 index 2b231ac73..5d9cc0e40 160000 --- a/submodules/mediastreamer2 +++ b/submodules/mediastreamer2 @@ -1 +1 @@ -Subproject commit 2b231ac7381e0f43fcdf509b26c77f640b4984e7 +Subproject commit 5d9cc0e40bd0907cfbacefbbccb5df2ecd752ba3 diff --git a/submodules/oRTP b/submodules/oRTP index 8e6ab4f17..100146d7c 160000 --- a/submodules/oRTP +++ b/submodules/oRTP @@ -1 +1 @@ -Subproject commit 8e6ab4f17f8d1d6870859ba9c64157693d6537a1 +Subproject commit 100146d7c09aea0bddcc6a10926f1ee528d42738