From 52be51902fce37898492057b10abccf047923e8c Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 23 Apr 2024 08:08:01 -0500 Subject: [PATCH] Do not use network country when there is not SIM If network is not preferred, then probably we should not use it at all. Otherwise simless devices will change locale when they roam. --- .../java/eu/siacs/conversations/utils/LocationProvider.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/utils/LocationProvider.java b/src/main/java/eu/siacs/conversations/utils/LocationProvider.java index bca997a7e33a4de32795110d490af9abaa799464..1d94b54fa1b17d52d1d26787cedf4d6e45f44a2f 100644 --- a/src/main/java/eu/siacs/conversations/utils/LocationProvider.java +++ b/src/main/java/eu/siacs/conversations/utils/LocationProvider.java @@ -39,9 +39,8 @@ public class LocationProvider { if (simCountry != null && simCountry.length() == 2) { // SIM country code is available return simCountry.toUpperCase(Locale.US); - } else if (networkCountry != null && networkCountry.length() == 2) { // network country code is available - return networkCountry.toUpperCase(Locale.US); } + return getUserCountryFallback(); } catch (final Exception e) { return getUserCountryFallback();