public Connection onCreateIncomingConnection(PhoneAccountHandle phoneaccounthandle, ConnectionRequest connectionrequest)
 {
     phoneaccounthandle = String.valueOf(connectionrequest);
     eev.e("Babel_telephony", (new StringBuilder(String.valueOf(phoneaccounthandle).length() + 59)).append("TeleConnectionService.onCreateIncomingConnection, request: ").append(phoneaccounthandle).toString());
     int i = eaj.a(this).b();
     dyd dyd1;
     boolean flag;
     if (i != -1)
     {
         phoneaccounthandle = new dxm(this, i);
     } else
     {
         phoneaccounthandle = null;
     }
     dyd1 = (dyd)hlp.a(this, dyd);
     if (dyg.a(connectionrequest.getExtras()) != null)
     {
         flag = true;
     } else
     {
         flag = false;
     }
     if (flag)
     {
         return dyd1.a(this, connectionrequest, phoneaccounthandle);
     } else
     {
         return (new dyc(this, this, connectionrequest, phoneaccounthandle)).a();
     }
 }
Пример #2
0
  /**
   * This can be used by telecom to either create a new outgoing call or attach to an existing
   * incoming call. In either case, telecom will cycle through a set of services and call
   * createConnection util a connection service cancels the process or completes it successfully.
   */
  private void createConnection(
      final PhoneAccountHandle callManagerAccount,
      final String callId,
      final ConnectionRequest request,
      boolean isIncoming,
      boolean isUnknown) {
    Log.d(
        this,
        "createConnection, callManagerAccount: %s, callId: %s, request: %s, "
            + "isIncoming: %b, isUnknown: %b",
        callManagerAccount,
        callId,
        request,
        isIncoming,
        isUnknown);

    Connection connection =
        isUnknown
            ? onCreateUnknownConnection(callManagerAccount, request)
            : isIncoming
                ? onCreateIncomingConnection(callManagerAccount, request)
                : onCreateOutgoingConnection(callManagerAccount, request);
    Log.d(this, "createConnection, connection: %s", connection);
    if (connection == null) {
      connection = Connection.createFailedConnection(new DisconnectCause(DisconnectCause.ERROR));
    }

    if (connection.getState() != Connection.STATE_DISCONNECTED) {
      addConnection(callId, connection);
    }

    Uri address = connection.getAddress();
    String number = address == null ? "null" : address.getSchemeSpecificPart();
    Log.v(
        this,
        "createConnection, number: %s, state: %s, capabilities: %s",
        Connection.toLogSafePhoneNumber(number),
        Connection.stateToString(connection.getState()),
        Connection.capabilitiesToString(connection.getConnectionCapabilities()));

    Log.d(this, "createConnection, calling handleCreateConnectionSuccessful %s", callId);
    mAdapter.handleCreateConnectionComplete(
        callId,
        request,
        new ParcelableConnection(
            request.getAccountHandle(),
            connection.getState(),
            connection.getConnectionCapabilities(),
            connection.getAddress(),
            connection.getAddressPresentation(),
            connection.getCallerDisplayName(),
            connection.getCallerDisplayNamePresentation(),
            connection.getVideoProvider() == null
                ? null
                : connection.getVideoProvider().getInterface(),
            connection.getVideoState(),
            connection.isRingbackRequested(),
            connection.getAudioModeIsVoip(),
            connection.getStatusHints(),
            connection.getDisconnectCause(),
            createIdList(connection.getConferenceables())));
  }