Merge change 4956 into donut
* changes: Tune the Reconnect back off timer.
This commit is contained in:
@@ -98,8 +98,8 @@ public abstract class DataConnectionTracker extends Handler {
|
|||||||
//***** Constants
|
//***** Constants
|
||||||
protected static final int RECONNECT_DELAY_INITIAL_MILLIS = 5 * 1000;
|
protected static final int RECONNECT_DELAY_INITIAL_MILLIS = 5 * 1000;
|
||||||
|
|
||||||
/** Cap out with 1 hour retry interval. */
|
/** Cap out with 30 min retry interval. */
|
||||||
protected static final int RECONNECT_DELAY_MAX_MILLIS = 60 * 60 * 1000;
|
protected static final int RECONNECT_DELAY_MAX_MILLIS = 30 * 60 * 1000;
|
||||||
|
|
||||||
/** Slow poll when attempting connection recovery. */
|
/** Slow poll when attempting connection recovery. */
|
||||||
protected static final int POLL_NETSTAT_SLOW_MILLIS = 5000;
|
protected static final int POLL_NETSTAT_SLOW_MILLIS = 5000;
|
||||||
|
|||||||
@@ -26,22 +26,18 @@ import android.content.SharedPreferences;
|
|||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.net.wifi.WifiManager;
|
import android.net.wifi.WifiManager;
|
||||||
import android.os.AsyncResult;
|
import android.os.AsyncResult;
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.INetStatService;
|
import android.os.INetStatService;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.os.SystemProperties;
|
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.provider.Checkin;
|
import android.provider.Checkin;
|
||||||
import android.provider.Settings;
|
|
||||||
import android.provider.Settings.SettingNotFoundException;
|
|
||||||
import android.telephony.ServiceState;
|
import android.telephony.ServiceState;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.telephony.cdma.CdmaCellLocation;
|
import android.telephony.cdma.CdmaCellLocation;
|
||||||
import android.util.EventLog;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.EventLog;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.android.internal.telephony.CommandsInterface;
|
import com.android.internal.telephony.CommandsInterface;
|
||||||
@@ -50,7 +46,6 @@ import com.android.internal.telephony.DataConnection;
|
|||||||
import com.android.internal.telephony.DataConnection.FailCause;
|
import com.android.internal.telephony.DataConnection.FailCause;
|
||||||
import com.android.internal.telephony.DataConnectionTracker;
|
import com.android.internal.telephony.DataConnectionTracker;
|
||||||
import com.android.internal.telephony.Phone;
|
import com.android.internal.telephony.Phone;
|
||||||
import com.android.internal.telephony.PhoneProxy;
|
|
||||||
import com.android.internal.telephony.TelephonyEventLog;
|
import com.android.internal.telephony.TelephonyEventLog;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -67,6 +62,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
// Indicates baseband will not auto-attach
|
// Indicates baseband will not auto-attach
|
||||||
private boolean noAutoAttach = false;
|
private boolean noAutoAttach = false;
|
||||||
long nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
long nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
||||||
|
private boolean mReregisterOnReconnectFailure = false;
|
||||||
private boolean mIsScreenOn = true;
|
private boolean mIsScreenOn = true;
|
||||||
|
|
||||||
//useful for debugging
|
//useful for debugging
|
||||||
@@ -464,6 +460,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
startNetStatPoll();
|
startNetStatPoll();
|
||||||
// reset reconnect timer
|
// reset reconnect timer
|
||||||
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
||||||
|
mReregisterOnReconnectFailure = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetPollStats() {
|
private void resetPollStats() {
|
||||||
@@ -619,6 +616,21 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
|
|
||||||
private void reconnectAfterFail(FailCause lastFailCauseCode, String reason) {
|
private void reconnectAfterFail(FailCause lastFailCauseCode, String reason) {
|
||||||
if (state == State.FAILED) {
|
if (state == State.FAILED) {
|
||||||
|
if (nextReconnectDelay > RECONNECT_DELAY_MAX_MILLIS) {
|
||||||
|
if (mReregisterOnReconnectFailure) {
|
||||||
|
// We have already tried to re-register to the network.
|
||||||
|
// This might be a problem with the data network.
|
||||||
|
nextReconnectDelay = RECONNECT_DELAY_MAX_MILLIS;
|
||||||
|
} else {
|
||||||
|
// Try to Re-register to the network.
|
||||||
|
Log.d(LOG_TAG, "PDP activate failed, Reregistering to the network");
|
||||||
|
mReregisterOnReconnectFailure = true;
|
||||||
|
mCdmaPhone.mSST.reRegisterNetwork(null);
|
||||||
|
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Log.d(LOG_TAG, "Data Connection activate failed. Scheduling next attempt for "
|
Log.d(LOG_TAG, "Data Connection activate failed. Scheduling next attempt for "
|
||||||
+ (nextReconnectDelay / 1000) + "s");
|
+ (nextReconnectDelay / 1000) + "s");
|
||||||
|
|
||||||
@@ -634,9 +646,6 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
|
|
||||||
// double it for next time
|
// double it for next time
|
||||||
nextReconnectDelay *= 2;
|
nextReconnectDelay *= 2;
|
||||||
if (nextReconnectDelay > RECONNECT_DELAY_MAX_MILLIS) {
|
|
||||||
nextReconnectDelay = RECONNECT_DELAY_MAX_MILLIS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!shouldPostNotification(lastFailCauseCode)) {
|
if (!shouldPostNotification(lastFailCauseCode)) {
|
||||||
Log.d(LOG_TAG,"NOT Posting Data Connection Unavailable notification "
|
Log.d(LOG_TAG,"NOT Posting Data Connection Unavailable notification "
|
||||||
@@ -716,6 +725,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
// Make sure our reconnect delay starts at the initial value
|
// Make sure our reconnect delay starts at the initial value
|
||||||
// next time the radio comes on
|
// next time the radio comes on
|
||||||
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
||||||
|
mReregisterOnReconnectFailure = false;
|
||||||
|
|
||||||
if (phone.getSimulatedRadioControl() != null) {
|
if (phone.getSimulatedRadioControl() != null) {
|
||||||
// Assume data is connected on the simulator
|
// Assume data is connected on the simulator
|
||||||
@@ -793,6 +803,7 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
} else {
|
} else {
|
||||||
// reset reconnect timer
|
// reset reconnect timer
|
||||||
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
||||||
|
mReregisterOnReconnectFailure = false;
|
||||||
// in case data setup was attempted when we were on a voice call
|
// in case data setup was attempted when we were on a voice call
|
||||||
trySetupData(Phone.REASON_VOICE_CALL_ENDED);
|
trySetupData(Phone.REASON_VOICE_CALL_ENDED);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
private static final String LOG_TAG = "GSM";
|
private static final String LOG_TAG = "GSM";
|
||||||
private static final boolean DBG = true;
|
private static final boolean DBG = true;
|
||||||
|
|
||||||
|
private GSMPhone mGsmPhone;
|
||||||
/**
|
/**
|
||||||
* Handles changes to the APN db.
|
* Handles changes to the APN db.
|
||||||
*/
|
*/
|
||||||
@@ -85,6 +86,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
// Indicates baseband will not auto-attach
|
// Indicates baseband will not auto-attach
|
||||||
private boolean noAutoAttach = false;
|
private boolean noAutoAttach = false;
|
||||||
long nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
long nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
||||||
|
private boolean mReregisterOnReconnectFailure = false;
|
||||||
private ContentResolver mResolver;
|
private ContentResolver mResolver;
|
||||||
|
|
||||||
private boolean mPingTestActive = false;
|
private boolean mPingTestActive = false;
|
||||||
@@ -204,6 +206,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
|
|
||||||
GsmDataConnectionTracker(GSMPhone p) {
|
GsmDataConnectionTracker(GSMPhone p) {
|
||||||
super(p);
|
super(p);
|
||||||
|
mGsmPhone = p;
|
||||||
|
|
||||||
p.mCM.registerForAvailable (this, EVENT_RADIO_AVAILABLE, null);
|
p.mCM.registerForAvailable (this, EVENT_RADIO_AVAILABLE, null);
|
||||||
p.mCM.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null);
|
p.mCM.registerForOffOrNotAvailable(this, EVENT_RADIO_OFF_OR_NOT_AVAILABLE, null);
|
||||||
@@ -250,16 +253,16 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
//Unregister for all events
|
//Unregister for all events
|
||||||
phone.mCM.unregisterForAvailable(this);
|
phone.mCM.unregisterForAvailable(this);
|
||||||
phone.mCM.unregisterForOffOrNotAvailable(this);
|
phone.mCM.unregisterForOffOrNotAvailable(this);
|
||||||
((GSMPhone) phone).mSIMRecords.unregisterForRecordsLoaded(this);
|
mGsmPhone.mSIMRecords.unregisterForRecordsLoaded(this);
|
||||||
phone.mCM.unregisterForDataStateChanged(this);
|
phone.mCM.unregisterForDataStateChanged(this);
|
||||||
((GSMPhone) phone).mCT.unregisterForVoiceCallEnded(this);
|
mGsmPhone.mCT.unregisterForVoiceCallEnded(this);
|
||||||
((GSMPhone) phone).mCT.unregisterForVoiceCallStarted(this);
|
mGsmPhone.mCT.unregisterForVoiceCallStarted(this);
|
||||||
((GSMPhone) phone).mSST.unregisterForGprsAttached(this);
|
mGsmPhone.mSST.unregisterForGprsAttached(this);
|
||||||
((GSMPhone) phone).mSST.unregisterForGprsDetached(this);
|
mGsmPhone.mSST.unregisterForGprsDetached(this);
|
||||||
((GSMPhone) phone).mSST.unregisterForRoamingOn(this);
|
mGsmPhone.mSST.unregisterForRoamingOn(this);
|
||||||
((GSMPhone) phone).mSST.unregisterForRoamingOff(this);
|
mGsmPhone.mSST.unregisterForRoamingOff(this);
|
||||||
((GSMPhone) phone).mSST.unregisterForPsRestrictedEnabled(this);
|
mGsmPhone.mSST.unregisterForPsRestrictedEnabled(this);
|
||||||
((GSMPhone) phone).mSST.unregisterForPsRestrictedDisabled(this);
|
mGsmPhone.mSST.unregisterForPsRestrictedDisabled(this);
|
||||||
|
|
||||||
phone.getContext().unregisterReceiver(this.mIntentReceiver);
|
phone.getContext().unregisterReceiver(this.mIntentReceiver);
|
||||||
phone.getContext().getContentResolver().unregisterContentObserver(this.apnObserver);
|
phone.getContext().getContentResolver().unregisterContentObserver(this.apnObserver);
|
||||||
@@ -407,8 +410,8 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
public boolean isDataConnectionAsDesired() {
|
public boolean isDataConnectionAsDesired() {
|
||||||
boolean roaming = phone.getServiceState().getRoaming();
|
boolean roaming = phone.getServiceState().getRoaming();
|
||||||
|
|
||||||
if (((GSMPhone) phone).mSIMRecords.getRecordsLoaded() &&
|
if (mGsmPhone.mSIMRecords.getRecordsLoaded() &&
|
||||||
((GSMPhone) phone).mSST.getCurrentGprsState() == ServiceState.STATE_IN_SERVICE &&
|
mGsmPhone.mSST.getCurrentGprsState() == ServiceState.STATE_IN_SERVICE &&
|
||||||
(!roaming || getDataOnRoamingEnabled()) &&
|
(!roaming || getDataOnRoamingEnabled()) &&
|
||||||
!mIsWifiConnected &&
|
!mIsWifiConnected &&
|
||||||
!mIsPsRestricted ) {
|
!mIsPsRestricted ) {
|
||||||
@@ -572,13 +575,13 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gprsState = ((GSMPhone) phone).mSST.getCurrentGprsState();
|
int gprsState = mGsmPhone.mSST.getCurrentGprsState();
|
||||||
boolean roaming = phone.getServiceState().getRoaming();
|
boolean roaming = phone.getServiceState().getRoaming();
|
||||||
boolean desiredPowerState = ((GSMPhone) phone).mSST.getDesiredPowerState();
|
boolean desiredPowerState = mGsmPhone.mSST.getDesiredPowerState();
|
||||||
|
|
||||||
if ((state == State.IDLE || state == State.SCANNING)
|
if ((state == State.IDLE || state == State.SCANNING)
|
||||||
&& (gprsState == ServiceState.STATE_IN_SERVICE || noAutoAttach)
|
&& (gprsState == ServiceState.STATE_IN_SERVICE || noAutoAttach)
|
||||||
&& ((GSMPhone) phone).mSIMRecords.getRecordsLoaded()
|
&& mGsmPhone.mSIMRecords.getRecordsLoaded()
|
||||||
&& phone.getState() == Phone.State.IDLE
|
&& phone.getState() == Phone.State.IDLE
|
||||||
&& isDataAllowed()
|
&& isDataAllowed()
|
||||||
&& !mIsPsRestricted
|
&& !mIsPsRestricted
|
||||||
@@ -604,8 +607,8 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
log("trySetupData: Not ready for data: " +
|
log("trySetupData: Not ready for data: " +
|
||||||
" dataState=" + state +
|
" dataState=" + state +
|
||||||
" gprsState=" + gprsState +
|
" gprsState=" + gprsState +
|
||||||
" sim=" + ((GSMPhone) phone).mSIMRecords.getRecordsLoaded() +
|
" sim=" + mGsmPhone.mSIMRecords.getRecordsLoaded() +
|
||||||
" UMTS=" + ((GSMPhone) phone).mSST.isConcurrentVoiceAndData() +
|
" UMTS=" + mGsmPhone.mSST.isConcurrentVoiceAndData() +
|
||||||
" phoneState=" + phone.getState() +
|
" phoneState=" + phone.getState() +
|
||||||
" dataEnabled=" + getAnyDataEnabled() +
|
" dataEnabled=" + getAnyDataEnabled() +
|
||||||
" roaming=" + roaming +
|
" roaming=" + roaming +
|
||||||
@@ -792,7 +795,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
isConnected = (state != State.IDLE && state != State.FAILED);
|
isConnected = (state != State.IDLE && state != State.FAILED);
|
||||||
|
|
||||||
// The "current" may no longer be valid. MMS depends on this to send properly.
|
// The "current" may no longer be valid. MMS depends on this to send properly.
|
||||||
((GSMPhone) phone).updateCurrentCarrierInProvider();
|
mGsmPhone.updateCurrentCarrierInProvider();
|
||||||
|
|
||||||
// TODO: It'd be nice to only do this if the changed entrie(s)
|
// TODO: It'd be nice to only do this if the changed entrie(s)
|
||||||
// match the current operator.
|
// match the current operator.
|
||||||
@@ -802,6 +805,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
if (!isConnected) {
|
if (!isConnected) {
|
||||||
// reset reconnect timer
|
// reset reconnect timer
|
||||||
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
||||||
|
mReregisterOnReconnectFailure = false;
|
||||||
trySetupData(Phone.REASON_APN_CHANGED);
|
trySetupData(Phone.REASON_APN_CHANGED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -882,6 +886,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
startNetStatPoll();
|
startNetStatPoll();
|
||||||
// reset reconnect timer
|
// reset reconnect timer
|
||||||
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
||||||
|
mReregisterOnReconnectFailure = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupDnsProperties() {
|
private void setupDnsProperties() {
|
||||||
@@ -952,7 +957,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
} else {
|
} else {
|
||||||
mPdpResetCount = 0;
|
mPdpResetCount = 0;
|
||||||
EventLog.writeEvent(TelephonyEventLog.EVENT_LOG_REREGISTER_NETWORK, sentSinceLastRecv);
|
EventLog.writeEvent(TelephonyEventLog.EVENT_LOG_REREGISTER_NETWORK, sentSinceLastRecv);
|
||||||
((GSMPhone) phone).mSST.reRegisterNetwork(null);
|
mGsmPhone.mSST.reRegisterNetwork(null);
|
||||||
}
|
}
|
||||||
// TODO: Add increasingly drastic recovery steps, eg,
|
// TODO: Add increasingly drastic recovery steps, eg,
|
||||||
// reset the radio, reset the device.
|
// reset the radio, reset the device.
|
||||||
@@ -1166,6 +1171,20 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
|
|
||||||
private void reconnectAfterFail(FailCause lastFailCauseCode, String reason) {
|
private void reconnectAfterFail(FailCause lastFailCauseCode, String reason) {
|
||||||
if (state == State.FAILED) {
|
if (state == State.FAILED) {
|
||||||
|
if (nextReconnectDelay > RECONNECT_DELAY_MAX_MILLIS) {
|
||||||
|
if (mReregisterOnReconnectFailure) {
|
||||||
|
// We have already tried to re-register to the network.
|
||||||
|
// This might be a problem with the data network.
|
||||||
|
nextReconnectDelay = RECONNECT_DELAY_MAX_MILLIS;
|
||||||
|
} else {
|
||||||
|
// Try to Re-register to the network.
|
||||||
|
Log.d(LOG_TAG, "PDP activate failed, Reregistering to the network");
|
||||||
|
mReregisterOnReconnectFailure = true;
|
||||||
|
mGsmPhone.mSST.reRegisterNetwork(null);
|
||||||
|
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
Log.d(LOG_TAG, "PDP activate failed. Scheduling next attempt for "
|
Log.d(LOG_TAG, "PDP activate failed. Scheduling next attempt for "
|
||||||
+ (nextReconnectDelay / 1000) + "s");
|
+ (nextReconnectDelay / 1000) + "s");
|
||||||
|
|
||||||
@@ -1181,9 +1200,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
|
|
||||||
// double it for next time
|
// double it for next time
|
||||||
nextReconnectDelay *= 2;
|
nextReconnectDelay *= 2;
|
||||||
if (nextReconnectDelay > RECONNECT_DELAY_MAX_MILLIS) {
|
|
||||||
nextReconnectDelay = RECONNECT_DELAY_MAX_MILLIS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!shouldPostNotification(lastFailCauseCode)) {
|
if (!shouldPostNotification(lastFailCauseCode)) {
|
||||||
Log.d(LOG_TAG,"NOT Posting GPRS Unavailable notification "
|
Log.d(LOG_TAG,"NOT Posting GPRS Unavailable notification "
|
||||||
@@ -1258,6 +1274,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
// Make sure our reconnect delay starts at the initial value
|
// Make sure our reconnect delay starts at the initial value
|
||||||
// next time the radio comes on
|
// next time the radio comes on
|
||||||
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
||||||
|
mReregisterOnReconnectFailure = false;
|
||||||
|
|
||||||
if (phone.getSimulatedRadioControl() != null) {
|
if (phone.getSimulatedRadioControl() != null) {
|
||||||
// Assume data is connected on the simulator
|
// Assume data is connected on the simulator
|
||||||
@@ -1370,7 +1387,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void onVoiceCallStarted() {
|
protected void onVoiceCallStarted() {
|
||||||
if (state == State.CONNECTED && !((GSMPhone) phone).mSST.isConcurrentVoiceAndData()) {
|
if (state == State.CONNECTED && ! mGsmPhone.mSST.isConcurrentVoiceAndData()) {
|
||||||
stopNetStatPoll();
|
stopNetStatPoll();
|
||||||
phone.notifyDataConnection(Phone.REASON_VOICE_CALL_STARTED);
|
phone.notifyDataConnection(Phone.REASON_VOICE_CALL_STARTED);
|
||||||
}
|
}
|
||||||
@@ -1378,7 +1395,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
|
|
||||||
protected void onVoiceCallEnded() {
|
protected void onVoiceCallEnded() {
|
||||||
if (state == State.CONNECTED) {
|
if (state == State.CONNECTED) {
|
||||||
if (!((GSMPhone) phone).mSST.isConcurrentVoiceAndData()) {
|
if (mGsmPhone.mSST.isConcurrentVoiceAndData()) {
|
||||||
startNetStatPoll();
|
startNetStatPoll();
|
||||||
phone.notifyDataConnection(Phone.REASON_VOICE_CALL_ENDED);
|
phone.notifyDataConnection(Phone.REASON_VOICE_CALL_ENDED);
|
||||||
} else {
|
} else {
|
||||||
@@ -1388,6 +1405,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
} else {
|
} else {
|
||||||
// reset reconnect timer
|
// reset reconnect timer
|
||||||
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
||||||
|
mReregisterOnReconnectFailure = false;
|
||||||
// in case data setup was attempted when we were on a voice call
|
// in case data setup was attempted when we were on a voice call
|
||||||
trySetupData(Phone.REASON_VOICE_CALL_ENDED);
|
trySetupData(Phone.REASON_VOICE_CALL_ENDED);
|
||||||
}
|
}
|
||||||
@@ -1417,7 +1435,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
*/
|
*/
|
||||||
private void createAllApnList() {
|
private void createAllApnList() {
|
||||||
allApns = new ArrayList<ApnSetting>();
|
allApns = new ArrayList<ApnSetting>();
|
||||||
String operator = ((GSMPhone) phone).mSIMRecords.getSIMOperatorNumeric();
|
String operator = mGsmPhone.mSIMRecords.getSIMOperatorNumeric();
|
||||||
|
|
||||||
if (operator != null) {
|
if (operator != null) {
|
||||||
String selection = "numeric = '" + operator + "'";
|
String selection = "numeric = '" + operator + "'";
|
||||||
@@ -1459,7 +1477,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
DataConnection pdp;
|
DataConnection pdp;
|
||||||
|
|
||||||
for (int i = 0; i < PDP_CONNECTION_POOL_SIZE; i++) {
|
for (int i = 0; i < PDP_CONNECTION_POOL_SIZE; i++) {
|
||||||
pdp = new PdpConnection((GSMPhone) phone);
|
pdp = new PdpConnection(mGsmPhone);
|
||||||
pdpList.add(pdp);
|
pdpList.add(pdp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1478,7 +1496,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
*/
|
*/
|
||||||
private ArrayList<ApnSetting> buildWaitingApns() {
|
private ArrayList<ApnSetting> buildWaitingApns() {
|
||||||
ArrayList<ApnSetting> apnList = new ArrayList<ApnSetting>();
|
ArrayList<ApnSetting> apnList = new ArrayList<ApnSetting>();
|
||||||
String operator = ((GSMPhone )phone).mSIMRecords.getSIMOperatorNumeric();
|
String operator = mGsmPhone.mSIMRecords.getSIMOperatorNumeric();
|
||||||
|
|
||||||
if (mRequestedApnType.equals(Phone.APN_TYPE_DEFAULT)) {
|
if (mRequestedApnType.equals(Phone.APN_TYPE_DEFAULT)) {
|
||||||
if (canSetPreferApn && preferredApn != null) {
|
if (canSetPreferApn && preferredApn != null) {
|
||||||
@@ -1664,6 +1682,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
if (state == State.FAILED) {
|
if (state == State.FAILED) {
|
||||||
cleanUpConnection(false, Phone.REASON_PS_RESTRICT_ENABLED);
|
cleanUpConnection(false, Phone.REASON_PS_RESTRICT_ENABLED);
|
||||||
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
nextReconnectDelay = RECONNECT_DELAY_INITIAL_MILLIS;
|
||||||
|
mReregisterOnReconnectFailure = false;
|
||||||
}
|
}
|
||||||
trySetupData(Phone.REASON_PS_RESTRICT_ENABLED);
|
trySetupData(Phone.REASON_PS_RESTRICT_ENABLED);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user