Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b0dfaad8 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Android Git Automerger
Browse files

am f99551d8: am c7ccc393: Merge "Make reportInetCondition revalidate if the...

am f99551d8: am c7ccc393: Merge "Make reportInetCondition revalidate if the report differs from our state" into lmp-mr1-dev

* commit 'f99551d8':
  Make reportInetCondition revalidate if the report differs from our state
parents 97e0ba69 f99551d8
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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) {