Commit a4a7d2ac authored by Adrien Béraud's avatar Adrien Béraud

call: catch exceptions in enterPipMode

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