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

Commit fd2df955 authored by Roshan Pius's avatar Roshan Pius
Browse files

WifiNetworkSuggestion: Change the polarity of priority

The current ordering of priority is hard to handle inside the wifi
stack because "-1" was unassigned priority and 0 is considered the
higheest priority level.
Reverse the polarity so it's much easier to compare network
suggestions with different priorities such that
priority1 > priority2 is always true. unassigned priority will always
be lesser than any assigned priority value.

Bug: 127644378
Test: Compiles
Change-Id: I74dacdb85838250c242257a80ebbe6046cef752f
parent dbd26f3f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -283,10 +283,10 @@ public final class WifiNetworkSuggestion implements Parcelable {

        /**
         * Specify the priority of this network among other network suggestions provided by the same
         * app (priorities have no impact on suggestions by different apps). The lower the number,
         * the higher the priority (i.e value of 0 = highest priority).
         * app (priorities have no impact on suggestions by different apps). The higher the number,
         * the higher the priority (i.e value of 0 = lowest priority).
         * <p>
         * <li>If not set, defaults to -1 (i.e unassigned priority).</li>
         * <li>If not set, defaults a lower priority than any assigned priority.</li>
         *
         * @param priority Integer number representing the priority among suggestions by the app.
         * @return Instance of {@link Builder} to enable chaining of the builder method.