Skip to content
Snippets Groups Projects
Commit a4a7d2ac authored by Adrien Béraud's avatar Adrien Béraud
Browse files

call: catch exceptions in enterPipMode

Change-Id: I0bef953710d5ed4229abb443f7ab53c350d6816e
parent b117db5e
No related branches found
No related tags found
No related merge requests found
...@@ -276,6 +276,8 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -276,6 +276,8 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
Rect videoBounds = new Rect(x, y, x + w, y + h); Rect videoBounds = new Rect(x, y, x + w, y + h);
paramBuilder.setAspectRatio(new Rational(w, h)); paramBuilder.setAspectRatio(new Rational(w, h));
paramBuilder.setSourceRectHint(videoBounds); paramBuilder.setSourceRectHint(videoBounds);
} else {
return;
} }
ArrayList<RemoteAction> actions = new ArrayList<>(1); ArrayList<RemoteAction> actions = new ArrayList<>(1);
actions.add(new RemoteAction( actions.add(new RemoteAction(
...@@ -287,7 +289,11 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements ...@@ -287,7 +289,11 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
.setClass(context, DRingService.class) .setClass(context, DRingService.class)
.putExtra(NotificationService.KEY_CALL_ID, callId), PendingIntent.FLAG_ONE_SHOT))); .putExtra(NotificationService.KEY_CALL_ID, callId), PendingIntent.FLAG_ONE_SHOT)));
paramBuilder.setActions(actions); paramBuilder.setActions(actions);
try {
requireActivity().enterPictureInPictureMode(paramBuilder.build()); requireActivity().enterPictureInPictureMode(paramBuilder.build());
} catch (Exception e) {
Log.w(TAG, "Can't enter PIP mode", e);
}
} else if (DeviceUtils.isTv(context)) { } else if (DeviceUtils.isTv(context)) {
requireActivity().enterPictureInPictureMode(); requireActivity().enterPictureInPictureMode();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment