mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-14 20:47:54 +01:00
add relay and bt as default address types when there's no preference set
This commit is contained in:
parent
76fe26a057
commit
e750811836
1 changed files with 13 additions and 2 deletions
|
@ -30,6 +30,7 @@ import java.util.ArrayList;
|
||||||
|
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
|
|
||||||
|
import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType;
|
||||||
import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnTypeSet;
|
import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnTypeSet;
|
||||||
|
|
||||||
public class XWPrefs {
|
public class XWPrefs {
|
||||||
|
@ -466,8 +467,18 @@ public class XWPrefs {
|
||||||
|
|
||||||
public static CommsConnTypeSet getAddrTypes( Context context )
|
public static CommsConnTypeSet getAddrTypes( Context context )
|
||||||
{
|
{
|
||||||
int flags = getPrefsInt( context, R.string.key_addrs_pref, 0 );
|
CommsConnTypeSet result;
|
||||||
return DBUtils.intToConnTypeSet( flags );
|
int flags = getPrefsInt( context, R.string.key_addrs_pref, -1 );
|
||||||
|
if ( -1 == flags ) {
|
||||||
|
result = new CommsConnTypeSet();
|
||||||
|
result.add( CommsConnType.COMMS_CONN_RELAY );
|
||||||
|
if ( BTService.BTEnabled() ) {
|
||||||
|
result.add( CommsConnType.COMMS_CONN_BT );
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result = DBUtils.intToConnTypeSet( flags );
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setAddrTypes( Context context, CommsConnTypeSet set )
|
public static void setAddrTypes( Context context, CommsConnTypeSet set )
|
||||||
|
|
Loading…
Add table
Reference in a new issue