Ejemplo n.º 1
0
 @Override
 public void onConnectionCapabilitiesChanged(Connection c, int capabilities) {
   String id = mIdByConnection.get(c);
   Log.d(
       this,
       "capabilities: parcelableconnection: %s",
       Connection.capabilitiesToString(capabilities));
   mAdapter.setConnectionCapabilities(id, capabilities);
 }
Ejemplo n.º 2
0
 @Override
 public void onConnectionCapabilitiesChanged(
     Conference conference, int connectionCapabilities) {
   String id = mIdByConference.get(conference);
   Log.d(
       this,
       "call capabilities: conference: %s",
       Connection.capabilitiesToString(connectionCapabilities));
   mAdapter.setConnectionCapabilities(id, connectionCapabilities);
 }
Ejemplo n.º 3
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())));
  }