mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
port over from android_branch the concept of ignoring all net state
messages but CONNECTED and DISCONNECTED. If this works to fix the problem 'bill' is having I'll incorporate it with these other changes for a b21. Otherwise it's out of b21. In neither case should it be merged into android_branch; it dies here since an equivalent change is already there.
This commit is contained in:
parent
067bef3e26
commit
4948ceab2b
1 changed files with 20 additions and 9 deletions
|
@ -341,17 +341,28 @@ public class CommsTransport implements TransportProcs {
|
|||
|
||||
NetworkInfo ni = (NetworkInfo)intent.
|
||||
getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
|
||||
boolean netAvail = NetworkInfo.State.CONNECTED == ni.getState();
|
||||
|
||||
boolean netAvailDet = NetworkInfo.DetailedState.CONNECTED ==
|
||||
ni.getDetailedState();
|
||||
Utils.logf( "CommsTransport::onReceive: getState()=>%s",
|
||||
ni.getState().toString() );
|
||||
|
||||
Utils.logf( "CommsTransport::onReceive: netAvail=%s;netAvailDet=%s",
|
||||
netAvail?"true":"false", netAvailDet?"true":"false" );
|
||||
m_netAvail = netAvail;
|
||||
if ( !netAvail ) {
|
||||
waitToStopImpl();
|
||||
m_jniThread.handle( JNICmd.CMD_TRANSFAIL );
|
||||
boolean netAvail;
|
||||
switch ( ni.getState() ) {
|
||||
case CONNECTED:
|
||||
netAvail = true;
|
||||
break;
|
||||
case DISCONNECTED:
|
||||
netAvail = false;
|
||||
break;
|
||||
default:
|
||||
netAvail = m_netAvail; // so we'll do nothing below
|
||||
}
|
||||
|
||||
if ( m_netAvail != netAvail ) {
|
||||
m_netAvail = netAvail;
|
||||
if ( !netAvail ) {
|
||||
waitToStopImpl();
|
||||
m_jniThread.handle( JNICmd.CMD_TRANSFAIL );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue