Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3146e09 authored by twyen's avatar twyen Committed by Eric Erfanian
Browse files

Log IMS video call available state

TEST=TAP
Bug: 77976254
Test: TAP
PiperOrigin-RevId: 197924728
Change-Id: I512ebe193cefae24e45c0526bcabdcb23846e236
parent 3a44f188
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -61,29 +61,34 @@ public class ImsVideoTech implements VideoTech {
  @Override
  public boolean isAvailable(Context context, PhoneAccountHandle phoneAccountHandle) {
    if (call.getVideoCall() == null) {
      LogUtil.i("ImsVideoCall.isAvailable", "null video call");
      return false;
    }

    // We are already in an IMS video call
    if (VideoProfile.isVideo(call.getDetails().getVideoState())) {
      LogUtil.i("ImsVideoCall.isAvailable", "already video call");
      return true;
    }

    // The user has disabled IMS video calling in system settings
    if (!CallUtil.isVideoEnabled(context)) {
      LogUtil.i("ImsVideoCall.isAvailable", "disabled in settings");
      return false;
    }

    // The current call doesn't support transmitting video
    if (!call.getDetails().can(Call.Details.CAPABILITY_SUPPORTS_VT_LOCAL_TX)) {
      LogUtil.i("ImsVideoCall.isAvailable", "no TX");
      return false;
    }

    // The current call remote device doesn't support receiving video
    if (!call.getDetails().can(Call.Details.CAPABILITY_SUPPORTS_VT_REMOTE_RX)) {
      LogUtil.i("ImsVideoCall.isAvailable", "no RX");
      return false;
    }

    LogUtil.i("ImsVideoCall.isAvailable", "available");
    return true;
  }