mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
refactor: move inline tests for being on emulator into a static method
This commit is contained in:
parent
a2e00794fa
commit
8626fdf027
3 changed files with 4 additions and 3 deletions
|
@ -87,7 +87,7 @@ public class CommsTransport implements TransportProcs,
|
|||
m_done = false;
|
||||
boolean failed = true;
|
||||
try {
|
||||
if ( Build.PRODUCT.contains("sdk") ) {
|
||||
if ( XWApp.onEmulator() ) {
|
||||
System.setProperty("java.net.preferIPv6Addresses", "false");
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public class NetStateCache {
|
|||
private static boolean s_netAvail = false;
|
||||
private static boolean s_isWifi;
|
||||
private static PvtBroadcastReceiver s_receiver;
|
||||
private static final boolean s_onSim = Build.PRODUCT.contains("sdk");
|
||||
private static final boolean s_onSim = XWApp.onEmulator();
|
||||
|
||||
public static void register( Context context, StateChangedIf proc )
|
||||
{
|
||||
|
|
|
@ -112,7 +112,8 @@ public class XWApp extends Application {
|
|||
public static boolean onEmulator()
|
||||
{
|
||||
if ( null == s_onEmulator ) {
|
||||
s_onEmulator = new Boolean( "google_sdk".equals(Build.MODEL) );
|
||||
s_onEmulator = new Boolean( "google_sdk".equals(Build.MODEL)
|
||||
|| Build.PRODUCT.startsWith("vbox") );
|
||||
}
|
||||
return s_onEmulator;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue