diff --git a/xwords4/android/XWords4/archive/R.java b/xwords4/android/XWords4/archive/R.java index caeabc561..ecabfd403 100644 --- a/xwords4/android/XWords4/archive/R.java +++ b/xwords4/android/XWords4/archive/R.java @@ -854,6 +854,7 @@ public final class R { /** */ public static final int cur_tiles_fmt=0x7f0601fc; + public static final int data_gsm_only=0x7f0602ae; public static final int debug_features=0x7f06007c; public static final int debug_features_summary=0x7f06007d; /** dictionary used by default for human players when creating diff --git a/xwords4/android/XWords4/res/values/strings.xml b/xwords4/android/XWords4/res/values/strings.xml index 6d1efaf14..e65cf0882 100644 --- a/xwords4/android/XWords4/res/values/strings.xml +++ b/xwords4/android/XWords4/res/values/strings.xml @@ -2235,5 +2235,7 @@ Enable local translating Add option to every screen menu + + SMS Data is only available on GSM phones. diff --git a/xwords4/android/XWords4/res/xml/xwprefs.xml b/xwords4/android/XWords4/res/xml/xwprefs.xml index 2b1a0f488..10eb90e02 100644 --- a/xwords4/android/XWords4/res/xml/xwprefs.xml +++ b/xwords4/android/XWords4/res/xml/xwprefs.xml @@ -347,7 +347,7 @@ Integer.valueOf( android.os.Build.VERSION.SDK ) - || XWPrefs.getPrefsBoolean( context, R.string.key_send_data_sms, - false ) ) { + boolean preKitkat = 19 > Integer.valueOf( android.os.Build.VERSION.SDK); + boolean usingData = + XWPrefs.getPrefsBoolean( context, R.string.key_send_data_sms, + false ); + if ( preKitkat || usingData ) { TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); if ( null != tm ) { int type = tm.getPhoneType(); - doesSMS = TelephonyManager.PHONE_TYPE_NONE != type; + doesSMS = (usingData && !preKitkat) + ? TelephonyManager.PHONE_TYPE_GSM == type + : TelephonyManager.PHONE_TYPE_NONE != type; } } s_deviceSupportSMS = new Boolean( doesSMS );