diff options
author | Robert Greenwalt <robdroid@android.com> | 2010-01-25 16:14:00 -0800 |
---|---|---|
committer | Robert Greenwalt <robdroid@android.com> | 2010-01-25 16:23:56 -0800 |
commit | 6e6dec284369238f16ac23497292de5a1a39aca8 (patch) | |
tree | 5a7bbda6d45ebf825b09bf2c3633be0fbb37d420 | |
parent | f904be1659fcc88dd80be2c900ffc89e77b1c737 (diff) | |
download | base-6e6dec284369238f16ac23497292de5a1a39aca8.tar.gz |
Refine fix I53e91db7 to apply only to wifi network
The original fix eliminated duplicate wifi connectivity changes stemming from
location provder scan's for APs. These would generate two DISCONNECTED broadcasts every
two minutes and many apps mis-interpreted them.
The fix was to ignore notifications where the major state was the same as the previous one
for each network. Unfortunately the state of per-apn notifications on cellular is hacky
and so the wifi fix was breaking mms (mms when you're on cellular with a common default+mms apn does
not generate a disconnect notification (apn still connected) so subsequent connect notifications
get dropped as duplicates).
This change refines the previous change so that it only applies to wifi networks.
bug:2392061
Change-Id: I05d8a46a4b55f8d28df8af12e05284e5e68bfc02
drno: ryanpc
-rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index dfb6ff7a0251..45eb6721092e 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -1269,9 +1269,16 @@ public class ConnectivityService extends IConnectivityManager.Stub { info = (NetworkInfo) msg.obj; int type = info.getType(); NetworkInfo.State state = info.getState(); - if (mNetAttributes[type].mLastState == state) { + // only do this optimization for wifi. It going into scan mode for location + // services generates alot of noise. Meanwhile the mms apn won't send out + // subsequent notifications when on default cellular because it never + // disconnects.. so only do this to wifi notifications. Fixed better when the + // APN notifications are standardized. + if (mNetAttributes[type].mLastState == state && + mNetAttributes[type].mRadio == ConnectivityManager.TYPE_WIFI) { if (DBG) { - // TODO - remove this after we validate the dropping doesn't break anything + // TODO - remove this after we validate the dropping doesn't break + // anything Log.d(TAG, "Dropping ConnectivityChange for " + info.getTypeName() + ": " + state + "/" + info.getDetailedState()); |