Buggy code:
public class SerialPort { public static final String TAG = "SerialPort" ; public static final int SP_CURRENT_SERIAL_PORT_VERSION = 2 ; private final byte [ ] serialPortServiceUuid = new byte [ ] { ( ( byte ) ( 36 ) ) , ( ( byte ) ( 86 ) ) , ( ( byte ) ( 225 ) ) , ( ( byte ) ( 185 ) ) , ( ( byte ) ( 38 ) ) , ( ( byte ) ( 226 ) ) , ( ( byte ) ( 143 ) ) , ( ( byte ) ( 131 ) ) , ( ( byte ) ( 231 ) ) , ( ( byte ) ( 68 ) ) , ( ( byte ) ( 243 ) ) , ( ( byte ) ( 79 ) ) , ( ( byte ) ( 1 ) ) , ( ( byte ) ( 233 ) ) , ( ( byte ) ( 215 ) ) , ( ( byte ) ( 1 ) ) } ; private final byte [ ] serialPortFifoCharactUuid = new byte [ ] { ( ( byte ) ( 36 ) ) , ( ( byte ) ( 86 ) ) , ( ( byte ) ( 225 ) ) , ( ( byte ) ( 185 ) ) , ( ( byte ) ( 38 ) ) , ( ( byte ) ( 226 ) ) , ( ( byte ) ( 143 ) ) , ( ( byte ) ( 131 ) ) , ( ( byte ) ( 231 ) ) , ( ( byte ) ( 68 ) ) , ( ( byte ) ( 243 ) ) , ( ( byte ) ( 79 ) ) , ( ( byte ) ( 1 ) ) , ( ( byte ) ( 233 ) ) , ( ( byte ) ( 215 ) ) , ( ( byte ) ( 3 ) ) } ; private final byte [ ] creditsCharactUuid = new byte [ ] { ( ( byte ) ( 36 ) ) , ( ( byte ) ( 86 ) ) , ( ( byte ) ( 225 ) ) , ( ( byte ) ( 185 ) ) , ( ( byte ) ( 38 ) ) , ( ( byte ) ( 226 ) ) , ( ( byte ) ( 143 ) ) , ( ( byte ) ( 131 ) ) , ( ( byte ) ( 231 ) ) , ( ( byte ) ( 68 ) ) , ( ( byte ) ( 243 ) ) , ( ( byte ) ( 79 ) ) , ( ( byte ) ( 1 ) ) , ( ( byte ) ( 233 ) ) , ( ( byte ) ( 215 ) ) , ( ( byte ) ( 4 ) ) } ; private final byte [ ] deviceIdServiceUuid = new byte [ ] { 24 , 10 } ; private final byte [ ] modelNumberCharactUuid = new byte [ ] { 42 , 36 } ; private final byte [ ] serialNumberCharactUuid = new byte [ ] { 42 , 37 } ; private final byte [ ] firmwareRevisionCharactUuid = new byte [ ] { 42 , 38 } ; public static final int DEVICE_NOTCONNECTED = 0 ; public static final int DEVICE_CONNECTING = 1 ; public static final int DEVICE_CONNECTED = 2 ; public static final int DEVICE_DISCONNECTED = 3 ; public static final int DEVICE_OPENED = 4 ; private int mDeviceState = SerialPort . DEVICE_NOTCONNECTED ; public static final String kSerialPortDataUpdatedNotification = "serial<seq2seq4repair_space>port<seq2seq4repair_space>data<seq2seq4repair_space>updated<seq2seq4repair_space>notification" ; public static final String kSerialPortConnectedNotification = "serial<seq2seq4repair_space>port<seq2seq4repair_space>connected<seq2seq4repair_space>notification" ; public static final String kSerialPortDisconnectedNotification = "serial<seq2seq4repair_space>port<seq2seq4repair_space>disconnected<seq2seq4repair_space>notification" ; public static final String kSerialPortReadDataNotification = "serial<seq2seq4repair_space>port<seq2seq4repair_space>read<seq2seq4repair_space>data<seq2seq4repair_space>notification" ; public static final String kLocalCharacteristicNotificationFailed = "kLocalCharacteristicNotificationFailed" ; public static final int SP_MAX_WRITE_SIZE = 20 ; public int _rssi = 0 ; private int _serialPortVersion ; BluetoothGattService _service ; BluetoothGattCharacteristic _fifoCharacteristic ; BluetoothGattService _deviceIdService ; BluetoothGattCharacteristic _fwVersionCharacteristic ; BluetoothGattCharacteristic _modelNumberCharacteristic ; public static final int BLECOMMUNICATE_TIMEOUT = 60 ; private Handler timeoutHandler = new Handler ( ) ; private Runnable timeoutRunnable = new Runnable ( ) { @ Override public void run ( ) { } } ; private BlePeripheral _peripheral ; private boolean _isRegistered ; public static class ReadData { public byte [ ] bytes ; public SerialPort port ; } public SerialPort ( BlePeripheral peripheral ) { } public int getDeviceStatus ( ) { } protected int _getVersionFromString ( String sVersion ) { } protected int _getSerialPortVersion ( ) { } public void _openSerialPortService ( ) { } public void _discoverCharacteristics ( ) { } public void onEvent ( SEvent e ) { } protected void _peripheralConnected ( BlePeripheral peripheral ) { } protected void _peripheralDisconnected ( BlePeripheral peripheral ) { } protected void _retrievedCharacteristics ( BlePeripheral peripheral ) { } protected void _descriptorWrite ( BlePeripheral peripheral , BluetoothGattDescriptor descriptor , boolean success ) { } protected void _notificationFailed ( BlePeripheral peripheral ) { } protected void _readCharacteristic ( BlePeripheral peripheral , BluetoothGattCharacteristic characteristic , byte [ ] value ) { if ( ( peripheral != ( _peripheral ) ) || ( peripheral == null ) ) return ; SerialPort . ReadData data = new SerialPort . ReadData ( ) ; data . port = this ; data . bytes = value ; <START_BUG> EventManager . sharedInstance ( ) . post ( SerialPort . kSerialPortReadDataNotification , this ) ; <END_BUG> } protected void _writedCharacteristic ( BlePeripheral peripheral , BluetoothGattCharacteristic characteristic , boolean success ) { } protected void _rssiUpdated ( BlePeripheral peripheral ) { } public boolean open ( ) { } public void close ( ) { } public void setDeviceState ( int deviceState ) { } public String name ( ) { } public boolean write ( byte [ ] data ) { } }

Fix:
EventManager . sharedInstance ( ) . post ( SerialPort . kSerialPortReadDataNotification , data ) ;