mirror of
https://gitlab.com/xynngh/YetAnotherCallBlocker.git
synced 2025-02-15 19:20:41 +01:00
Fix usage of String.toUpperCase()
This commit is contained in:
parent
ac2360210c
commit
37197065ce
@ -9,6 +9,8 @@ import androidx.preference.PreferenceManager;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import dummydomain.yetanothercallblocker.data.CountryHelper;
|
import dummydomain.yetanothercallblocker.data.CountryHelper;
|
||||||
import dummydomain.yetanothercallblocker.sia.model.database.DbManager;
|
import dummydomain.yetanothercallblocker.sia.model.database.DbManager;
|
||||||
|
|
||||||
@ -228,14 +230,14 @@ public class Settings extends GenericSettings {
|
|||||||
|
|
||||||
public String getCountryCode() {
|
public String getCountryCode() {
|
||||||
String override = getCountryCodeOverride();
|
String override = getCountryCodeOverride();
|
||||||
if (!TextUtils.isEmpty(override)) return override.toUpperCase();
|
if (!TextUtils.isEmpty(override)) return override.toUpperCase(Locale.ROOT);
|
||||||
|
|
||||||
return getCachedAutoDetectedCountryCode();
|
return getCachedAutoDetectedCountryCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCountryCodeForReviews() {
|
public String getCountryCodeForReviews() {
|
||||||
String override = getCountryCodeForReviewsOverride();
|
String override = getCountryCodeForReviewsOverride();
|
||||||
if (!TextUtils.isEmpty(override)) return override.toUpperCase();
|
if (!TextUtils.isEmpty(override)) return override.toUpperCase(Locale.ROOT);
|
||||||
|
|
||||||
String code = getCachedAutoDetectedCountryCode();
|
String code = getCachedAutoDetectedCountryCode();
|
||||||
return !TextUtils.isEmpty(code) ? code : "US";
|
return !TextUtils.isEmpty(code) ? code : "US";
|
||||||
|
@ -9,6 +9,8 @@ import androidx.core.os.ConfigurationCompat;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
public class CountryHelper {
|
public class CountryHelper {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(CountryHelper.class);
|
private static final Logger LOG = LoggerFactory.getLogger(CountryHelper.class);
|
||||||
@ -20,10 +22,10 @@ public class CountryHelper {
|
|||||||
|
|
||||||
if (tm != null) {
|
if (tm != null) {
|
||||||
String countryCode = tm.getNetworkCountryIso();
|
String countryCode = tm.getNetworkCountryIso();
|
||||||
if (!TextUtils.isEmpty(countryCode)) return countryCode.toUpperCase();
|
if (!TextUtils.isEmpty(countryCode)) return countryCode.toUpperCase(Locale.ROOT);
|
||||||
|
|
||||||
countryCode = tm.getSimCountryIso();
|
countryCode = tm.getSimCountryIso();
|
||||||
if (!TextUtils.isEmpty(countryCode)) return countryCode.toUpperCase();
|
if (!TextUtils.isEmpty(countryCode)) return countryCode.toUpperCase(Locale.ROOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
String countryCode = ConfigurationCompat
|
String countryCode = ConfigurationCompat
|
||||||
|
Loading…
x
Reference in New Issue
Block a user