DO NOT MERGE Update network priorities before PNO is triggered

The max SSID watch list size for PNO supported by wlan drivers is fixed
to a certain size.  wpa_supplicant sorts this SSID watch list based on
the priorities assigned to those networks. This may result in us losing
some frequently used networks from the PNO list because they have lower
priorities. This is a side effect of how we assign priorities to
network configuration as they're added.
So before we trigger PNO, re-sort the network list based on the
'numAssociation' value and assign them relative priorities. This will make
sure that the PNO SSID watch list contains all the frequent SSID's to
which we were connected to.
PS: This change has a side-effect of ignoring the configured priorities
during PNO.

BUG: 26763375
Change-Id: I2c82254b2cb83aef0dd4da9e7d9b2eb5b376bead
Cherry-picked from:
https://partner-android-review.googlesource.com/#/c/529355
(cherry picked from commit 27e7123ef9e83fe8bc6f3f881e425358e7f5e62b)
3 files changed
tree: 5c333c576490978e1a60d97951dae0b45af4c6fd
  1. service/