Skip to content
Snippets Groups Projects
Commit c190a446 authored by Aline Bonnet's avatar Aline Bonnet Committed by gerrit2
Browse files

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
parent e3de5091
No related branches found
No related tags found
No related merge requests found
...@@ -670,12 +670,16 @@ public class CallFragment extends Fragment implements CallInterface, ContactDeta ...@@ -670,12 +670,16 @@ public class CallFragment extends Fragment implements CallInterface, ContactDeta
@Override @Override
public void onConfigurationChanged(Configuration newConfig) { public void onConfigurationChanged(Configuration newConfig) {
updatePreview();
}
private void updatePreview() {
if (videoPreview.getVisibility() == View.VISIBLE) { if (videoPreview.getVisibility() == View.VISIBLE) {
try { try {
mCallbacks.getRemoteService().setPreviewSettings(); mCallbacks.getRemoteService().setPreviewSettings();
mCallbacks.getRemoteService().videoPreviewSurfaceAdded(); mCallbacks.getRemoteService().videoPreviewSurfaceAdded();
} catch (RemoteException e) { } catch (RemoteException e) {
e.printStackTrace(); Log.e(TAG, "service not found ", e);
} }
} }
} }
...@@ -843,6 +847,8 @@ public class CallFragment extends Fragment implements CallInterface, ContactDeta ...@@ -843,6 +847,8 @@ public class CallFragment extends Fragment implements CallInterface, ContactDeta
contactBubbleLayout.setVisibility(haveVideo ? View.GONE : View.VISIBLE); contactBubbleLayout.setVisibility(haveVideo ? View.GONE : View.VISIBLE);
updateSecurityDisplay(); updateSecurityDisplay();
updatePreview();
} }
private void updateSecurityDisplay() { private void updateSecurityDisplay() {
...@@ -951,8 +957,7 @@ public class CallFragment extends Fragment implements CallInterface, ContactDeta ...@@ -951,8 +957,7 @@ public class CallFragment extends Fragment implements CallInterface, ContactDeta
Photo tmp = vcard.getPhotos().get(0); Photo tmp = vcard.getPhotos().get(0);
if (tmp.getData() != null) { if (tmp.getData() != null) {
contactBubbleView.setImageBitmap(CropImageUtils.cropImageToCircle(tmp.getData())); contactBubbleView.setImageBitmap(CropImageUtils.cropImageToCircle(tmp.getData()));
} } else {
else{
setDefaultPhoto(); setDefaultPhoto();
} }
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment