I'm willing to detect if roaming switch on a telephone is turned off.
if (Build.VERSION.SDK_INT < 17) {
isDataRoamingDisabled =
(Settings.System.getInt(context.getContentResolver(), Settings.Secure.DATA_ROAMING, 0)
== 0);
} else {
isDataRoamingDisabled =
(Settings.Global.getInt(context.getContentResolver(), Settings.Global.DATA_ROAMING, 0)
== 0);
}
Unfortunately only for OnePlus One/Two/Three the setting is always false (0). On rest devices that i tested - Nexus 6P, LG G5, Samsung S5 all is working fine...
telephonyManager.isNetworkRoaming(),
is not really the solution here since it detects if a user in roaming and not switch in settings.
Thanks for help! :)