Search in sources :

Example 1 with RetryManager

use of com.android.internal.telephony.RetryManager in project XobotOS by xamarin.

the class GsmDataConnectionTracker method createDataConnection.

/** Return the id for a new data connection */
private GsmDataConnection createDataConnection() {
    if (DBG)
        log("createDataConnection E");
    RetryManager rm = new RetryManager();
    int id = mUniqueIdGenerator.getAndIncrement();
    GsmDataConnection conn = GsmDataConnection.makeDataConnection(mPhone, id, rm);
    mDataConnections.put(id, conn);
    DataConnectionAc dcac = new DataConnectionAc(conn, LOG_TAG);
    int status = dcac.fullyConnectSync(mPhone.getContext(), this, conn.getHandler());
    if (status == AsyncChannel.STATUS_SUCCESSFUL) {
        mDataConnectionAsyncChannels.put(dcac.dataConnection.getDataConnectionId(), dcac);
    } else {
        loge("createDataConnection: Could not connect to dcac.mDc=" + dcac.dataConnection + " status=" + status);
    }
    // install reconnect intent filter for this data connection.
    IntentFilter filter = new IntentFilter();
    filter.addAction(INTENT_RECONNECT_ALARM + '.' + id);
    mPhone.getContext().registerReceiver(mIntentReceiver, filter, null, mPhone);
    if (DBG)
        log("createDataConnection() X id=" + id);
    return conn;
}
Also used : IntentFilter(android.content.IntentFilter) RetryManager(com.android.internal.telephony.RetryManager) DataConnectionAc(com.android.internal.telephony.DataConnectionAc)

Example 2 with RetryManager

use of com.android.internal.telephony.RetryManager in project XobotOS by xamarin.

the class CdmaDataConnectionTracker method createAllDataConnectionList.

private void createAllDataConnectionList() {
    CdmaDataConnection dataConn;
    String retryConfig = SystemProperties.get("ro.cdma.data_retry_config");
    for (int i = 0; i < DATA_CONNECTION_POOL_SIZE; i++) {
        RetryManager rm = new RetryManager();
        if (!rm.configure(retryConfig)) {
            if (!rm.configure(DEFAULT_DATA_RETRY_CONFIG)) {
                // Should never happen, log an error and default to a simple linear sequence.
                log("Could not configure using DEFAULT_DATA_RETRY_CONFIG=" + DEFAULT_DATA_RETRY_CONFIG);
                rm.configure(20, 2000, 1000);
            }
        }
        int id = mUniqueIdGenerator.getAndIncrement();
        dataConn = CdmaDataConnection.makeDataConnection(mCdmaPhone, id, rm);
        mDataConnections.put(id, dataConn);
        DataConnectionAc dcac = new DataConnectionAc(dataConn, LOG_TAG);
        int status = dcac.fullyConnectSync(mPhone.getContext(), this, dataConn.getHandler());
        if (status == AsyncChannel.STATUS_SUCCESSFUL) {
            log("Fully connected");
            mDataConnectionAsyncChannels.put(dcac.dataConnection.getDataConnectionId(), dcac);
        } else {
            log("Could not connect to dcac.dataConnection=" + dcac.dataConnection + " status=" + status);
        }
    }
}
Also used : RetryManager(com.android.internal.telephony.RetryManager) DataConnectionAc(com.android.internal.telephony.DataConnectionAc)

Aggregations

DataConnectionAc (com.android.internal.telephony.DataConnectionAc)2 RetryManager (com.android.internal.telephony.RetryManager)2 IntentFilter (android.content.IntentFilter)1