diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2015-02-12 02:43:45 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-02-12 02:43:45 +0000 |
commit | be828a3ba6ecefc92a88da26dbbfab52a2d933a6 (patch) | |
tree | bf36158656d21df4e8dc8cacfece2a3ed4d3fb38 /services | |
parent | 22d1f8cfb6746577ed7efddd48e76509d25aeedc (diff) | |
parent | c7ccc393b470220710f566d447412d93f7f8d21b (diff) | |
download | frameworks_base-be828a3ba6ecefc92a88da26dbbfab52a2d933a6.zip frameworks_base-be828a3ba6ecefc92a88da26dbbfab52a2d933a6.tar.gz frameworks_base-be828a3ba6ecefc92a88da26dbbfab52a2d933a6.tar.bz2 |
am c7ccc393: Merge "Make reportInetCondition revalidate if the report differs from our state" into lmp-mr1-dev
* commit 'c7ccc393b470220710f566d447412d93f7f8d21b':
Make reportInetCondition revalidate if the report differs from our state
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/ConnectivityService.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 551a5dc..b72b29d 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -2636,9 +2636,15 @@ public class ConnectivityService extends IConnectivityManager.Stub // 100 percent is full good, 0 is full bad. public void reportInetCondition(int networkType, int percentage) { - if (percentage > 50) return; // don't handle good network reports NetworkAgentInfo nai = mLegacyTypeTracker.getNetworkForType(networkType); - if (nai != null) reportBadNetwork(nai.network); + if (nai == null) return; + boolean isGood = percentage > 50; + // Revalidate if the app report does not match our current validated state. + if (isGood != nai.lastValidated) { + // Make the message logged by reportBadNetwork below less confusing. + if (DBG && isGood) log("reportInetCondition: type=" + networkType + " ok, revalidate"); + reportBadNetwork(nai.network); + } } public void reportBadNetwork(Network network) { |