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

Commit 2d14a3c6 authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by android-build-merger
Browse files

Don't notify on network switch if source network is validated. am: c2e10bb0...

Don't notify on network switch if source network is validated. am: c2e10bb0 am: b301283d am: a0a41b1e
am: 228252aa

Change-Id: I150cbafb6ab3fce4800241bfacec4bf4ee73db31
parents 31b1db8f 228252aa
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -4721,9 +4721,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
                        if (VDBG) log("   accepting network in place of " + currentNetwork.name());
                        currentNetwork.removeRequest(nri.request.requestId);
                        currentNetwork.lingerRequest(nri.request, now, mLingerDelayMs);
                        if (isDefaultRequest(nri)) {
                            mLingerMonitor.noteLingerDefaultNetwork(currentNetwork, newNetwork);
                        }
                        affectedNetworks.add(currentNetwork);
                    } else {
                        if (VDBG) log("   accepting network in place of null");
@@ -4744,6 +4741,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
                    if (isDefaultRequest(nri)) {
                        isNewDefault = true;
                        oldDefaultNetwork = currentNetwork;
                        if (currentNetwork != null) {
                            mLingerMonitor.noteLingerDefaultNetwork(currentNetwork, newNetwork);
                        }
                    }
                }
            } else if (newNetwork.isSatisfyingRequest(nri.request.requestId)) {
+6 −0
Original line number Diff line number Diff line
@@ -242,6 +242,12 @@ public class LingerMonitor {
            return;
        }

        // Only show the notification if we switched away because a network became unvalidated, not
        // because its score changed.
        // TODO: instead of just skipping notification, keep a note of it, and show it if it becomes
        // unvalidated.
        if (fromNai.lastValidated) return;

        if (isNotificationEnabled(fromNai, toNai)) {
            notify(fromNai, toNai, forceToast);
        }