From c190a4463ccba4197dc1fecf35794fdc50f590bf Mon Sep 17 00:00:00 2001 From: Aline Bonnet <aline.bonnet@savoirfairelinux.com> Date: Mon, 31 Oct 2016 11:42:11 -0400 Subject: [PATCH] video: fix the video display When accepting a video call from the notification bar, sometimes the video is not displayed. startCapture was called before the initialization of CallActivity and CallFragment. This commit forces the addition of a videoSurface. Change-Id: I9a7a370ca95bb8f87a66c7941bc88c180fc676b5 Tuleap: #774 --- .../main/java/cx/ring/fragments/CallFragment.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java b/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java index 7f4ee62c7..d9791aa42 100644 --- a/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java +++ b/ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java @@ -670,12 +670,16 @@ public class CallFragment extends Fragment implements CallInterface, ContactDeta @Override public void onConfigurationChanged(Configuration newConfig) { + updatePreview(); + } + + private void updatePreview() { if (videoPreview.getVisibility() == View.VISIBLE) { try { mCallbacks.getRemoteService().setPreviewSettings(); mCallbacks.getRemoteService().videoPreviewSurfaceAdded(); } catch (RemoteException e) { - e.printStackTrace(); + Log.e(TAG, "service not found ", e); } } } @@ -843,6 +847,8 @@ public class CallFragment extends Fragment implements CallInterface, ContactDeta contactBubbleLayout.setVisibility(haveVideo ? View.GONE : View.VISIBLE); updateSecurityDisplay(); + + updatePreview(); } private void updateSecurityDisplay() { @@ -949,10 +955,9 @@ public class CallFragment extends Fragment implements CallInterface, ContactDeta if (!vcard.getPhotos().isEmpty()) { Photo tmp = vcard.getPhotos().get(0); - if(tmp.getData() != null) { + if (tmp.getData() != null) { contactBubbleView.setImageBitmap(CropImageUtils.cropImageToCircle(tmp.getData())); - } - else{ + } else { setDefaultPhoto(); } } else { -- GitLab