diff options
author | Erik Kline <ek@google.com> | 2014-12-04 03:13:54 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-12-04 03:14:02 +0000 |
commit | 9261d9d64548f0221de50eb99f3675488a4176a4 (patch) | |
tree | f910a8f58cf7e8e35e0d838e962948867096db66 | |
parent | 32b61ab28f54e5b00f472b2166f9b1100375e4ff (diff) | |
parent | 8e3f4fbdf6e562f4f5731b98e327e8af33b75c4c (diff) | |
download | frameworks_base-9261d9d64548f0221de50eb99f3675488a4176a4.zip frameworks_base-9261d9d64548f0221de50eb99f3675488a4176a4.tar.gz frameworks_base-9261d9d64548f0221de50eb99f3675488a4176a4.tar.bz2 |
Merge "Remove CONNECTIVITY_CHANGE_DELAY and friends." into lmp-mr1-dev
-rw-r--r-- | core/java/android/net/ConnectivityManager.java | 14 | ||||
-rw-r--r-- | core/java/android/provider/Settings.java | 2 | ||||
-rw-r--r-- | services/core/java/com/android/server/ConnectivityService.java | 40 |
3 files changed, 5 insertions, 51 deletions
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 4215f20..4fe418a 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -100,7 +100,7 @@ public class ConnectivityManager { /** * Identical to {@link #CONNECTIVITY_ACTION} broadcast, but sent without any - * applicable {@link Settings.Global#CONNECTIVITY_CHANGE_DELAY}. + * historic {@link Settings.Global#CONNECTIVITY_CHANGE_DELAY}. * * @hide */ @@ -428,18 +428,6 @@ public class ConnectivityManager { public static final int DEFAULT_NETWORK_PREFERENCE = TYPE_WIFI; /** - * Default value for {@link Settings.Global#CONNECTIVITY_CHANGE_DELAY} in - * milliseconds. This was introduced because IPv6 routes seem to take a - * moment to settle - trying network activity before the routes are adjusted - * can lead to packets using the wrong interface or having the wrong IP address. - * This delay is a bit crude, but in the future hopefully we will have kernel - * notifications letting us know when it's safe to use the new network. - * - * @hide - */ - public static final int CONNECTIVITY_CHANGE_DELAY_DEFAULT = 3000; - - /** * @hide */ public final static int REQUEST_ID_UNSET = 0; diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 0c036d51..3bc74ae 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -6118,7 +6118,7 @@ public final class Settings { /** * The number of milliseconds to delay before sending out - * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. + * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored. * * @hide */ diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index c5af085..84fddd7 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -797,17 +797,6 @@ public class ConnectivityService extends IConnectivityManager.Stub throw new IllegalStateException("No free netIds"); } - private int getConnectivityChangeDelay() { - final ContentResolver cr = mContext.getContentResolver(); - - /** Check system properties for the default value then use secure settings value, if any. */ - int defaultDelay = SystemProperties.getInt( - "conn." + Settings.Global.CONNECTIVITY_CHANGE_DELAY, - ConnectivityManager.CONNECTIVITY_CHANGE_DELAY_DEFAULT); - return Settings.Global.getInt(cr, Settings.Global.CONNECTIVITY_CHANGE_DELAY, - defaultDelay); - } - private boolean teardown(NetworkStateTracker netTracker) { if (netTracker.teardown()) { netTracker.setTeardownRequested(true); @@ -1479,11 +1468,6 @@ public class ConnectivityService extends IConnectivityManager.Stub sendGeneralBroadcast(info, CONNECTIVITY_ACTION); } - private void sendConnectedBroadcastDelayed(NetworkInfo info, int delayMs) { - sendGeneralBroadcast(info, CONNECTIVITY_ACTION_IMMEDIATE); - sendGeneralBroadcastDelayed(info, CONNECTIVITY_ACTION, delayMs); - } - private void sendInetConditionBroadcast(NetworkInfo info) { sendGeneralBroadcast(info, ConnectivityManager.INET_CONDITION_ACTION); } @@ -1515,10 +1499,6 @@ public class ConnectivityService extends IConnectivityManager.Stub sendStickyBroadcast(makeGeneralIntent(info, bcastType)); } - private void sendGeneralBroadcastDelayed(NetworkInfo info, String bcastType, int delayMs) { - sendStickyBroadcastDelayed(makeGeneralIntent(info, bcastType), delayMs); - } - private void sendDataActivityBroadcast(int deviceType, boolean active, long tsNanos) { Intent intent = new Intent(ConnectivityManager.ACTION_DATA_ACTIVITY_CHANGE); intent.putExtra(ConnectivityManager.EXTRA_DEVICE_TYPE, deviceType); @@ -1552,19 +1532,6 @@ public class ConnectivityService extends IConnectivityManager.Stub } } - private void sendStickyBroadcastDelayed(Intent intent, int delayMs) { - if (delayMs <= 0) { - sendStickyBroadcast(intent); - } else { - if (VDBG) { - log("sendStickyBroadcastDelayed: delayMs=" + delayMs + ", action=" - + intent.getAction()); - } - mHandler.sendMessageDelayed(mHandler.obtainMessage( - EVENT_SEND_STICKY_BROADCAST_INTENT, intent), delayMs); - } - } - void systemReady() { // start network sampling .. Intent intent = new Intent(ACTION_PKT_CNT_SAMPLE_INTERVAL_ELAPSED); @@ -4307,7 +4274,7 @@ public class ConnectivityService extends IConnectivityManager.Stub info.setType(type); if (connected) { info.setDetailedState(DetailedState.CONNECTED, null, info.getExtraInfo()); - sendConnectedBroadcastDelayed(info, getConnectivityChangeDelay()); + sendConnectedBroadcast(info); } else { info.setDetailedState(DetailedState.DISCONNECTED, null, info.getExtraInfo()); Intent intent = new Intent(ConnectivityManager.CONNECTIVITY_ACTION); @@ -4338,10 +4305,9 @@ public class ConnectivityService extends IConnectivityManager.Stub final Intent immediateIntent = new Intent(intent); immediateIntent.setAction(CONNECTIVITY_ACTION_IMMEDIATE); sendStickyBroadcast(immediateIntent); - sendStickyBroadcastDelayed(intent, getConnectivityChangeDelay()); + sendStickyBroadcast(intent); if (newDefaultAgent != null) { - sendConnectedBroadcastDelayed(newDefaultAgent.networkInfo, - getConnectivityChangeDelay()); + sendConnectedBroadcast(newDefaultAgent.networkInfo); } } } |