mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Add more fixes to the country picker.
This commit is contained in:
@@ -232,6 +232,11 @@ public class Util {
|
||||
return Optional.ofNullable(simCountryIso != null ? simCountryIso.toUpperCase() : null);
|
||||
}
|
||||
|
||||
public static @Nullable String getNetworkCountryIso(Context context) {
|
||||
String networkCountryIso = ((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getNetworkCountryIso();
|
||||
return networkCountryIso == null ? null : networkCountryIso.toUpperCase();
|
||||
}
|
||||
|
||||
public static @NonNull <T> T firstNonNull(@Nullable T optional, @NonNull T fallback) {
|
||||
return optional != null ? optional : fallback;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user