My application worked fine under Android 2.3.3 to 4.1.2, but with Android 4.2.2 and Android 4.3 I have
fatal signal 11 (SIGSEGV) at 0x00....
when i close the bluetooth jack.
I go through many forums and the main answer is that
BluetoothSocket.close();
called from two different threads at the same time, but this is not the case in my code.
I use Samsung Galaxy Note 2 under A4.1.2 (working fine) and Nexus 4 for A4.2.2 and 4.3.
Thanks in advance for your suggestions!
EDIT 1: here are 2 streams that control the Bluetooth jack.
the first:
private class ConnectThread extends Thread { private final BluetoothSocket mmSocket; private final BluetoothDevice mmDevice;
and second:
private class ConnectedThread extends Thread { private final BluetoothSocket mmSocket; private final DataInputStream mmInStream; private final OutputStream mmOutStream; public ConnectedThread(BluetoothSocket socket) { Log.d(TAG, "/S4B/ Create ConnectedThread"); mmSocket = socket; InputStream tmpIn = null; OutputStream tmpOut = null;
EDIT 2: I tried to use only one thread to make sure that in parrallel there is no access to
BluetoothSocket
but the result is exactly the same. As soon as i call
BluetoothSocket.close();
I get a fatal signal 11 and the application crashes.
source share