Persist and use country code reliably

It looks like we never persisted country code if it wasn't
set on the driver; this is not correct.

Also fixed initial sequence - the cached country code is now
trashed on reboot if config_wifi_revert_country_code_on_cellular_loss
is set. New country codes will be set if telephony stacks
retrieve them; or else, ro.boot.wificountrycode will stick.

Note that there are possible race conditions between telephony
finding country codes and starting Wifi functionality (like SoftAP)
so it is possible that Wifi uses more conservative country code
from ro.boot.wificountrycode even if telephony finds a better
country code later. The situation will recover eventually.

Bug: 24553903

Change-Id: I37bb2f64947ab04a82a0392eb85f521a08147e29
1 file changed
tree: 2f8d786420fef1d5a1bb18eaae15e0e3ef4b063f
  1. service/