summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2010-11-20 11:57:56 -0800
committerWink Saville <wink@google.com>2010-11-20 11:57:56 -0800
commit804043193a46a79a8616fd7696fb781edb80b519 (patch)
treeb52928b3b973c7b0cb0965f1e8a4c7cef2d5f09a /telephony
parentf5c4111f668f0e0ffa6739a056f0be67536fcf44 (diff)
downloadframeworks_base-804043193a46a79a8616fd7696fb781edb80b519.zip
frameworks_base-804043193a46a79a8616fd7696fb781edb80b519.tar.gz
frameworks_base-804043193a46a79a8616fd7696fb781edb80b519.tar.bz2
Remove pingtest in GsmDataConnectionTracker.
The pingtest have been disabled since petit-four and ping's use is being deprecated. Removing the ping test code, if needed use InetAddress.isReachable instead. bug: 1824738 Change-Id: I42b3de85b67b82dc6389e7a2234afa7b1d687209
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/DataConnectionTracker.java2
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java49
2 files changed, 3 insertions, 48 deletions
diff --git a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
index 96c90a2..9c738ec 100644
--- a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
@@ -149,8 +149,6 @@ public abstract class DataConnectionTracker extends Handler {
/** Slow poll when attempting connection recovery. */
protected static final int POLL_NETSTAT_SLOW_MILLIS = 5000;
- /** Default ping deadline, in seconds. */
- protected static final int DEFAULT_PING_DEADLINE = 5;
/** Default max failure count before attempting to network re-registration. */
protected static final int DEFAULT_MAX_PDP_RESET_FAIL = 3;
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index 06c7c1b..bbfdd31 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -81,7 +81,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
private boolean mReregisterOnReconnectFailure = false;
private ContentResolver mResolver;
- private boolean mPingTestActive = false;
// Count of PDP reset attempts; reset when we see incoming,
// call reRegisterNetwork, or pingTest succeeds.
private int mPdpResetCount = 0;
@@ -654,7 +653,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
@Override
protected void startNetStatPoll() {
- if (mState == State.CONNECTED && mPingTestActive == false && mNetStatPollEnabled == false) {
+ if (mState == State.CONNECTED && mNetStatPollEnabled == false) {
log("[DataConnection] Start poll NetStat");
resetPollStats();
mNetStatPollEnabled = true;
@@ -763,18 +762,9 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
POLL_NETSTAT_SLOW_MILLIS);
} else {
if (DBG) log("Sent " + String.valueOf(mSentSinceLastRecv) +
- " pkts since last received");
- // We've exceeded the threshold. Run ping test as a final check;
- // it will proceed with recovery if ping fails.
+ " pkts since last received start recovery process");
stopNetStatPoll();
- Thread pingTest = new Thread() {
- @Override
- public void run() {
- runPingTest();
- }
- };
- mPingTestActive = true;
- pingTest.start();
+ sendMessage(obtainMessage(EVENT_START_RECOVERY));
}
} else {
mNoRecvPollCount = 0;
@@ -794,37 +784,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
}
};
- private void runPingTest () {
- int status = -1;
- try {
- String address = Settings.Secure.getString(mResolver,
- Settings.Secure.PDP_WATCHDOG_PING_ADDRESS);
- int deadline = Settings.Secure.getInt(mResolver,
- Settings.Secure.PDP_WATCHDOG_PING_DEADLINE, DEFAULT_PING_DEADLINE);
- if (DBG) log("pinging " + address + " for " + deadline + "s");
- if (address != null && !NULL_IP.equals(address)) {
- Process p = Runtime.getRuntime()
- .exec("ping -c 1 -i 1 -w "+ deadline + " " + address);
- status = p.waitFor();
- }
- } catch (IOException e) {
- loge("ping failed: IOException");
- } catch (Exception e) {
- loge("exception trying to ping");
- }
-
- if (status == 0) {
- // ping succeeded. False alarm. Reset netStatPoll.
- // ("-1" for this event indicates a false alarm)
- EventLog.writeEvent(EventLogTags.PDP_RADIO_RESET, -1);
- mPdpResetCount = 0;
- sendMessage(obtainMessage(EVENT_START_NETSTAT_POLL));
- } else {
- // ping failed. Proceed with recovery.
- sendMessage(obtainMessage(EVENT_START_RECOVERY));
- }
- }
-
/**
* Returns true if the last fail cause is something that
* seems like it deserves an error notification.
@@ -1399,12 +1358,10 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
break;
case EVENT_START_NETSTAT_POLL:
- mPingTestActive = false;
startNetStatPoll();
break;
case EVENT_START_RECOVERY:
- mPingTestActive = false;
doRecovery();
break;