Search in sources :

Example 1 with GsmCdmaConnection

use of com.android.internal.telephony.GsmCdmaConnection in project android_frameworks_opt_telephony by LineageOS.

the class VoiceCallSessionStats method onRilCallListChanged.

/**
 * Updates internal states when CS calls are created or terminated, or CS call state is changed.
 */
public synchronized void onRilCallListChanged(List<GsmCdmaConnection> connections) {
    for (Connection conn : connections) {
        int id = getConnectionId(conn);
        if (!mCallProtos.contains(id)) {
            // handle new connections
            if (conn.getDisconnectCause() == DisconnectCause.NOT_DISCONNECTED) {
                addCall(conn);
                checkCallSetup(conn, mCallProtos.get(id));
            } else {
                logd("onRilCallListChanged: skip adding disconnected connection");
            }
        } else {
            VoiceCallSession proto = mCallProtos.get(id);
            // handle call state change
            checkCallSetup(conn, proto);
            // handle terminated connections
            if (conn.getDisconnectCause() != DisconnectCause.NOT_DISCONNECTED) {
                // should be CS
                proto.bearerAtEnd = getBearer(conn);
                proto.disconnectReasonCode = conn.getDisconnectCause();
                proto.disconnectExtraCode = conn.getPreciseDisconnectCause();
                proto.disconnectExtraMessage = conn.getVendorDisconnectCause();
                finishCall(id);
            }
        }
    }
// NOTE: we cannot check stray connections (CS call in our list but not in RIL), as
// GsmCdmaCallTracker can call this with a partial list
}
Also used : VoiceCallSession(com.android.internal.telephony.nano.PersistAtomsProto.VoiceCallSession) ImsPhoneConnection(com.android.internal.telephony.imsphone.ImsPhoneConnection) GsmCdmaConnection(com.android.internal.telephony.GsmCdmaConnection) Connection(com.android.internal.telephony.Connection)

Aggregations

Connection (com.android.internal.telephony.Connection)1 GsmCdmaConnection (com.android.internal.telephony.GsmCdmaConnection)1 ImsPhoneConnection (com.android.internal.telephony.imsphone.ImsPhoneConnection)1 VoiceCallSession (com.android.internal.telephony.nano.PersistAtomsProto.VoiceCallSession)1