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:
Andy2 2011-01-13 18:25:10 -08:00
parent 067bef3e26
commit 4948ceab2b

View file

@ -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 );
}
}
}
}