Пример #1
0
  public void addConversationFragmentReceiveCall() {

    QBRTCSession session = getCurrentSession();

    if (getCurrentSession() != null) {
      Integer myId = QBChatService.getInstance().getUser().getId();
      ArrayList<Integer> opponentsWithoutMe = new ArrayList<>(session.getOpponents());
      opponentsWithoutMe.remove(new Integer(myId));
      opponentsWithoutMe.add(session.getCallerID());

      ArrayList<QBUser> opponents =
          DataHolder.getUsersByIDs(
              opponentsWithoutMe.toArray(new Integer[opponentsWithoutMe.size()]));
      SettingsUtil.setSettingsStrategy(opponents, getDefaultSharedPrefs(), this);
      ConversationFragment fragment =
          ConversationFragment.newInstance(
              opponents,
              DataHolder.getUserNameByID(session.getCallerID()),
              session.getConferenceType(),
              session.getUserInfo(),
              StartConversetionReason.INCOME_CALL_FOR_ACCEPTION,
              getCurrentSession().getSessionID());
      // Start conversation fragment
      audioManager.init();
      FragmentExecuotr.addFragment(
          getFragmentManager(), R.id.fragment_container, fragment, CONVERSATION_CALL_FRAGMENT);
    }
  }
Пример #2
0
 public void addConversationFragmentStartCall(
     List<QBUser> opponents,
     QBRTCTypes.QBConferenceType qbConferenceType,
     Map<String, String> userInfo) {
   QBRTCSession newSessionWithOpponents =
       rtcClient.createNewSessionWithOpponents(getOpponentsIds(opponents), qbConferenceType);
   SettingsUtil.setSettingsStrategy(opponents, getDefaultSharedPrefs(), this);
   Log.d("Crash", "addConversationFragmentStartCall. Set session " + newSessionWithOpponents);
   initCurrentSession(newSessionWithOpponents);
   ConversationFragment fragment =
       ConversationFragment.newInstance(
           opponents,
           opponents.get(0).getFullName(),
           qbConferenceType,
           userInfo,
           StartConversetionReason.OUTCOME_CALL_MADE,
           getCurrentSession().getSessionID());
   FragmentExecuotr.addFragment(
       getFragmentManager(), R.id.fragment_container, fragment, CONVERSATION_CALL_FRAGMENT);
   audioManager.init();
   ringtonePlayer.play(true);
 }