fix derp

Change-Id: If3a9272f8dc34ca01731431edf2c8ad62424d2d5
Fix of Settings application sort crash

The original implementation of compareTo function
will sometimes cause crash when the power usage list
above 32 items.

When comparing double values a proper comparison method
needs to be used. Using just subtraction does not take
into account NaN:S, infinities and +/-0 numbers. In certain
cirtumstances it seems that using subtraction causes
compareTo to return values that is not expected by the
sorting code and causes an illegal argument exception with
"Comparison method violates its general contract!".

This problem only happens if the sort code is called arrays
containing more than 32 (currently) due to how
ComparableTimSort works (call chain is Collections.sort ->
Arrays.sort(Object[]) -> ComparableTimSort.

Change-Id: If732f04797a3c8b2a43568c90bb73a1ec69a4c98
Wi-Fi: Manage Wi-Fi AP priorities

AOSP has a basic LRU priority for Wi-Fi networks (last connected has more priority).
This changes added the ability of graphically set the priority of any of the configured
Wi-Fi networks through Settings -> Wi-Fi -> Advanced Settings -> Wi-Fi priority.

Change-Id: Icceac649e2fa630ac89365747189efd058bcc882
clean up

Change-Id: I1911e502dffbd83b092d1143698c51f4819d1279