Buggy code:
public class Tethering extends BaseNetworkObserver { private Context mContext ; private static final String TAG = "Tethering" ; private static final boolean DBG = true ; private static final boolean VDBG = false ; private String [ ] mTetherableUsbRegexs ; private String [ ] mTetherableWifiRegexs ; private String [ ] mTetherableBluetoothRegexs ; private Collection < Integer > mUpstreamIfaceTypes ; private Object mPublicSync ; private static final Integer MOBILE_TYPE = new Integer ( ConnectivityManager . TYPE_MOBILE ) ; private static final Integer HIPRI_TYPE = new Integer ( ConnectivityManager . TYPE_MOBILE_HIPRI ) ; private static final Integer DUN_TYPE = new Integer ( ConnectivityManager . TYPE_MOBILE_DUN ) ; private int mPreferredUpstreamMobileApn = ConnectivityManager . TYPE_NONE ; private final INetworkManagementService mNMService ; private final INetworkStatsService mStatsService ; private Looper mLooper ; private HashMap < String , Tethering . TetherInterfaceSM > mIfaces ; private BroadcastReceiver mStateReceiver ; private static final String USB_NEAR_IFACE_ADDR = "192.168.42.129" ; private static final int USB_PREFIX_LENGTH = 24 ; private String [ ] mDhcpRange ; private static final String [ ] DHCP_DEFAULT_RANGE = new String [ ] { "192.168.42.2" , "192.168.42.254" , "192.168.43.2" , "192.168.43.254" , "192.168.44.2" , "192.168.44.254" , "192.168.45.2" , "192.168.45.254" , "192.168.46.2" , "192.168.46.254" , "192.168.47.2" , "192.168.47.254" , "192.168.48.2" , "192.168.48.254" , "192.168.49.2" , "192.168.49.254" } ; private String [ ] mDefaultDnsServers ; private static final String DNS_DEFAULT_SERVER1 = "8.8.8.8" ; private static final String DNS_DEFAULT_SERVER2 = "8.8.4.4" ; private StateMachine mTetherMasterSM ; private Notification mTetheredNotification ; private boolean mRndisEnabled ; private boolean mUsbTetherRequested ; public Tethering ( Context context , INetworkManagementService nmService , INetworkStatsService statsService , Looper looper ) { } private ConnectivityManager getConnectivityManager ( ) { } void updateConfiguration ( ) { } public void interfaceStatusChanged ( String iface , boolean up ) { if ( Tethering . VDBG ) Log . d ( Tethering . TAG , ( ( ( "interfaceStatusChanged<seq2seq4repair_space>" + iface ) + ",<seq2seq4repair_space>" ) + up ) ) ; boolean found = false ; boolean usb = false ; synchronized ( mPublicSync ) { if ( isWifi ( iface ) ) { found = true ; } else if ( isUsb ( iface ) ) { found = true ; usb = true ; } else if ( isBluetooth ( iface ) ) { found = true ; } if ( found == false ) return ; Tethering . TetherInterfaceSM sm = mIfaces . get ( iface ) ; if ( up ) { if ( sm == null ) { sm = new Tethering . TetherInterfaceSM ( iface , mLooper , usb ) ; mIfaces . put ( iface , sm ) ; sm . start ( ) ; } } else { <START_BUG> if ( isUsb ( iface ) ) { <END_BUG> if ( Tethering . VDBG ) Log . d ( Tethering . TAG , ( "ignore<seq2seq4repair_space>interface<seq2seq4repair_space>down<seq2seq4repair_space>for<seq2seq4repair_space>" + iface ) ) ; } else if ( sm != null ) { sm . sendMessage ( Tethering . TetherInterfaceSM . CMD_INTERFACE_DOWN ) ; mIfaces . remove ( iface ) ; } } } } public void interfaceLinkStateChanged ( String iface , boolean up ) { } private boolean isUsb ( String iface ) { } public boolean isWifi ( String iface ) { } public boolean isBluetooth ( String iface ) { } public void interfaceAdded ( String iface ) { } public void interfaceRemoved ( String iface ) { } public int tether ( String iface ) { } public int untether ( String iface ) { } public int getLastTetherError ( String iface ) { } private void sendTetherStateChangedBroadcast ( ) { } private void showTetheredNotification ( int icon ) { } private void clearTetheredNotification ( ) { } private class StateReceiver extends BroadcastReceiver { @ Override public void onReceive ( Context content , Intent intent ) { } } private void tetherUsb ( boolean enable ) { } private boolean configureUsbIface ( boolean enabled ) { } public String [ ] getTetherableUsbRegexs ( ) { } public String [ ] getTetherableWifiRegexs ( ) { } public String [ ] getTetherableBluetoothRegexs ( ) { } public int setUsbTethering ( boolean enable ) { } public int [ ] getUpstreamIfaceTypes ( ) { } public void checkDunRequired ( ) { } public String [ ] getTetheredIfaces ( ) { } public String [ ] getTetherableIfaces ( ) { } public String [ ] getTetheredDhcpRanges ( ) { } public String [ ] getErroredIfaces ( ) { } class TetherInterfaceSM extends StateMachine { static final int CMD_TETHER_MODE_DEAD = 1 ; static final int CMD_TETHER_REQUESTED = 2 ; static final int CMD_TETHER_UNREQUESTED = 3 ; static final int CMD_INTERFACE_DOWN = 4 ; static final int CMD_INTERFACE_UP = 5 ; static final int CMD_CELL_DUN_ERROR = 6 ; static final int CMD_IP_FORWARDING_ENABLE_ERROR = 7 ; static final int CMD_IP_FORWARDING_DISABLE_ERROR = 8 ; static final int CMD_START_TETHERING_ERROR = 9 ; static final int CMD_STOP_TETHERING_ERROR = 10 ; static final int CMD_SET_DNS_FORWARDERS_ERROR = 11 ; static final int CMD_TETHER_CONNECTION_CHANGED = 12 ; private State mDefaultState ; private State mInitialState ; private State mStartingState ; private State mTetheredState ; private State mUnavailableState ; private boolean mAvailable ; private boolean mTethered ; int mLastError ; String mIfaceName ; String mMyUpstreamIfaceName ; boolean mUsb ; TetherInterfaceSM ( String name , Looper looper , boolean usb ) { } public String toString ( ) { } public int getLastError ( ) { } private void setLastError ( int error ) { } public boolean isAvailable ( ) { } private void setAvailable ( boolean available ) { } public boolean isTethered ( ) { } private void setTethered ( boolean tethered ) { } public boolean isErrored ( ) { } class InitialState extends State { @ Override public void enter ( ) { } @ Override public boolean processMessage ( Message message ) { } } class StartingState extends State { @ Override public void enter ( ) { } @ Override public boolean processMessage ( Message message ) { } }

Fix:
if ( ( isUsb ( iface ) ) || ( isBluetooth ( iface ) ) ) {