There was a way to get to the sender before its handler had been
initialized. That can only happen on UI thread, so just drop the send
rather than figure out a better way (for now).
This commit is contained in:
Eric House 2020-08-28 08:32:23 -07:00
parent 193383bfa6
commit 73b6d0519f

View file

@ -29,7 +29,6 @@ import android.net.NetworkInfo;
import android.os.Build; import android.os.Build;
import android.os.Handler; import android.os.Handler;
import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType; import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType;
import java.util.HashSet; import java.util.HashSet;
@ -235,6 +234,9 @@ public class NetStateCache {
// will only fire if we go that long without coming // will only fire if we go that long without coming
// through here again. // through here again.
if ( null == mHandler ) {
Log.e( TAG, "notifyStateChanged(): handler null so dropping" );
} else {
if ( null != mNotifyLater ) { if ( null != mNotifyLater ) {
mHandler.removeCallbacks( mNotifyLater ); mHandler.removeCallbacks( mNotifyLater );
mNotifyLater = null; mNotifyLater = null;
@ -266,6 +268,6 @@ public class NetStateCache {
mHandler.postDelayed( mNotifyLater, WAIT_STABLE_MILLIS ); mHandler.postDelayed( mNotifyLater, WAIT_STABLE_MILLIS );
} }
} }
} // class PvtBroadcastReceiver }
} // class PvtBroadcastReceiver
} }