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

Skip to content
Commit 8e5017d2 authored by Michael W's avatar Michael W Committed by Bruno Martins
Browse files

LineageParts: Stats: Try getting a valid country code

* As per https://developer.android.com/reference/android/telephony/TelephonyManager#getNetworkCountryIso()
  we are either getting a valid lowercase 2 character alpha-2 country
  code or an empty string. Make it uppercase so the server needs to do
  less work on those strings
* Additionally the doc states to be unreliable on CDMA networks, so in
  those case don't use the result
* To get a country code anyway, use getCountry() on the current locale
  - we will get either an uppercase 2-letter or a 3-digit code,
  which we only use when it's the 2-letter result

Change-Id: I2c2538e1d77502f3c240543b544c954226175061
parent f9a1ec6f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment