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

Commit dc9b300c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Address comments on ag/14486203" into sc-dev

parents 1595a20d f27877ae
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -237,9 +237,9 @@ public class NetworkRanker {
        partitionInto(candidates, nai -> nai.getScore().hasPolicy(POLICY_TRANSPORT_PRIMARY),
                accepted, rejected);
        if (accepted.size() > 0) {
            // Some networks are primary. For each transport, keep only the primary, but also
            // keep all networks for which there isn't a primary (which are now in the |rejected|
            // array).
            // Some networks are primary for their transport. For each transport, keep only the
            // primary, but also keep all networks for which there isn't a primary (which are now
            // in the |rejected| array).
            // So for each primary network, remove from |rejected| all networks with the same
            // transports as one of the primary networks. The remaining networks should be accepted.
            for (final T defaultSubNai : accepted) {
@@ -247,6 +247,8 @@ public class NetworkRanker {
                rejected.removeIf(
                        nai -> Arrays.equals(transports, nai.getCapsNoCopy().getTransportTypes()));
            }
            // Now the |rejected| list contains networks with transports for which there isn't
            // a primary network. Add them back to the candidates.
            accepted.addAll(rejected);
            candidates = new ArrayList<>(accepted);
        }