More details: Bluetooth Chat Demo app running on Android 4.0.3 and try to connect my Bluetooth device (running on security mode 1) . System popup "Bluetooth pairing request" window. After enter pin, connection achieved. Logcat msg as follow,
06-18 15:28:37.630: E/BluetoothChat(2207): - ON PAUSE - 06-18 15:28:39.450: D/BluetoothChat(2207): onActivityResult -1 06-18 15:28:39.450: D/BluetoothChatService(2207): connect to: 00:13:43:02:C0:91 06-18 15:28:39.450: D/BluetoothChatService(2207): setState() 1 -> 2 06-18 15:28:39.450: I/BluetoothChatService(2207): BEGIN mConnectThread SocketType:Insecure 06-18 15:28:39.460: E/BluetoothChat(2207): + ON RESUME + 06-18 15:28:39.490: I/BluetoothChat(2207): MESSAGE_STATE_CHANGE: 2 06-18 15:28:40.920: E/BluetoothChat(2207): - ON PAUSE - 06-18 15:28:41.050: W/IInputConnectionWrapper(2207): showStatusIcon on inactive InputConnection 06-18 15:28:44.200: E/BluetoothChat(2207): + ON RESUME + 06-18 15:28:44.940: D/BluetoothChatService(2207): connected, Socket Type:Insecure 06-18 15:28:44.950: D/BluetoothChatService(2207): Socket TypeSecurecancel Thread[AcceptThreadSecure,5,main] 06-18 15:28:44.960: D/BluetoothChatService(2207): Socket TypeInsecurecancel Thread[AcceptThreadInsecure,5,main] 06-18 15:28:44.970: D/BluetoothChatService(2207): create ConnectedThread: Insecure 06-18 15:28:44.980: E/BluetoothChatService(2207): Socket Type: Secureaccept() failed 06-18 15:28:44.980: E/BluetoothChatService(2207): java.io.IOException: Operation Canceled 06-18 15:28:44.980: E/BluetoothChatService(2207): at android.bluetooth.BluetoothSocket.acceptNative(Native Method) 06-18 15:28:44.980: E/BluetoothChatService(2207): at android.bluetooth.BluetoothSocket.accept(BluetoothSocket.java:305) 06-18 15:28:44.980: E/BluetoothChatService(2207): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:107) 06-18 15:28:44.980: E/BluetoothChatService(2207): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:93) 06-18 15:28:44.980: E/BluetoothChatService(2207): at com.example.android.BluetoothChat.BluetoothChatService$AcceptThread.run(BluetoothChatService.java:327) 06-18 15:28:44.980: I/BluetoothChatService(2207): END mAcceptThread, socket Type: Secure 06-18 15:28:44.980: I/BluetoothChatService(2207): BEGIN mConnectedThread 06-18 15:28:44.980: D/BluetoothChatService(2207): setState() 2 -> 3 06-18 15:28:44.990: E/BluetoothChatService(2207): Socket Type: Insecureaccept() failed 06-18 15:28:44.990: E/BluetoothChatService(2207): java.io.IOException: Operation Canceled 06-18 15:28:44.990: E/BluetoothChatService(2207): at android.bluetooth.BluetoothSocket.acceptNative(Native Method) 06-18 15:28:44.990: E/BluetoothChatService(2207): at android.bluetooth.BluetoothSocket.accept(BluetoothSocket.java:305) 06-18 15:28:44.990: E/BluetoothChatService(2207): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:107) 06-18 15:28:44.990: E/BluetoothChatService(2207): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:93) 06-18 15:28:44.990: E/BluetoothChatService(2207): at com.example.android.BluetoothChat.BluetoothChatService$AcceptThread.run(BluetoothChatService.java:327) 06-18 15:28:44.990: I/BluetoothChatService(2207): END mAcceptThread, socket Type: Insecure 06-18 15:28:44.990: I/BluetoothChat(2207): MESSAGE_STATE_CHANGE: 3 [disconnect issued] 06-18 15:29:04.590: D/BluetoothChatService(2207): stop 06-18 15:29:04.600: E/BluetoothChatService(2207): disconnected 06-18 15:29:04.600: E/BluetoothChatService(2207): java.io.IOException: Operation Canceled 06-18 15:29:04.600: E/BluetoothChatService(2207): at android.bluetooth.BluetoothSocket.readNative(Native Method) 06-18 15:29:04.600: E/BluetoothChatService(2207): at android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:327) 06-18 15:29:04.600: E/BluetoothChatService(2207): at android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:96) 06-18 15:29:04.600: E/BluetoothChatService(2207): at java.io.InputStream.read(InputStream.java:163) 06-18 15:29:04.600: E/BluetoothChatService(2207): at com.example.android.BluetoothChat.BluetoothChatService$ConnectedThread.run(BluetoothChatService.java:477) 06-18 15:29:04.600: D/BluetoothChatService(2207): setState() 3 -> 0 06-18 15:29:04.600: D/BluetoothChatService(2207): start 06-18 15:29:04.600: D/BluetoothChatService(2207): setState() 0 -> 1 06-18 15:29:04.620: D/BluetoothChatService(2207): Socket Type: SecureBEGIN mAcceptThreadThread[Thread-272,5,main] 06-18 15:29:04.630: D/BluetoothChatService(2207): start 06-18 15:29:04.630: D/BluetoothChatService(2207): setState() 1 -> 1 06-18 15:29:04.630: D/BluetoothChatService(2207): Socket Type: InsecureBEGIN mAcceptThreadThread[Thread-273,5,main] 06-18 15:29:04.640: I/BluetoothChat(2207): MESSAGE_STATE_CHANGE: 0 06-18 15:29:04.640: I/BluetoothChat(2207): MESSAGE_STATE_CHANGE: 1 06-18 15:29:04.680: I/BluetoothChat(2207): MESSAGE_STATE_CHANGE: 1 ******************************************************* Bluetooth Chat Demo app running on Android 3.2 and try to connect my Bluetooth device (running on security mode 1) . Connection achieved without popup Logcat msg as follow, 06-18 14:14:18.990: E/BluetoothChat(3618): - ON PAUSE - 06-18 14:14:23.560: D/BluetoothChat(3618): onActivityResult -1 06-18 14:14:23.560: D/BluetoothChatService(3618): connect to: 00:13:43:02:C0:91 06-18 14:14:23.560: D/BluetoothChatService(3618): setState() 1 -> 2 06-18 14:14:23.560: I/BluetoothChatService(3618): BEGIN mConnectThread SocketType:Insecure 06-18 14:14:23.560: E/BluetoothChat(3618): + ON RESUME + 06-18 14:14:23.600: I/BluetoothChat(3618): MESSAGE_STATE_CHANGE: 2 06-18 14:14:27.630: D/BluetoothChatService(3618): connected, Socket Type:Insecure 06-18 14:14:27.630: D/BluetoothChatService(3618): Socket TypeSecurecancel Thread[AcceptThreadSecure,5,main] 06-18 14:14:27.640: D/BluetoothChatService(3618): Socket TypeInsecurecancel Thread[AcceptThreadInsecure,5,main] 06-18 14:14:27.640: E/BluetoothChatService(3618): Socket Type: Secureaccept() failed 06-18 14:14:27.640: E/BluetoothChatService(3618): java.io.IOException: Operation Canceled 06-18 14:14:27.640: E/BluetoothChatService(3618): at android.bluetooth.BluetoothSocket.acceptNative(Native Method) 06-18 14:14:27.640: E/BluetoothChatService(3618): at android.bluetooth.BluetoothSocket.accept(BluetoothSocket.java:287) 06-18 14:14:27.640: E/BluetoothChatService(3618): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:105) 06-18 14:14:27.640: E/BluetoothChatService(3618): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:91) 06-18 14:14:27.640: E/BluetoothChatService(3618): at com.example.android.BluetoothChat.BluetoothChatService$AcceptThread.run(BluetoothChatService.java:327) 06-18 14:14:27.640: I/BluetoothChatService(3618): END mAcceptThread, socket Type: Secure 06-18 14:14:27.650: E/BluetoothChatService(3618): Socket Type: Insecureaccept() failed 06-18 14:14:27.650: E/BluetoothChatService(3618): java.io.IOException: Operation Canceled 06-18 14:14:27.650: E/BluetoothChatService(3618): at android.bluetooth.BluetoothSocket.acceptNative(Native Method) 06-18 14:14:27.650: E/BluetoothChatService(3618): at android.bluetooth.BluetoothSocket.accept(BluetoothSocket.java:287) 06-18 14:14:27.650: E/BluetoothChatService(3618): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:105) 06-18 14:14:27.650: E/BluetoothChatService(3618): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:91) 06-18 14:14:27.650: E/BluetoothChatService(3618): at com.example.android.BluetoothChat.BluetoothChatService$AcceptThread.run(BluetoothChatService.java:327) 06-18 14:14:27.650: I/BluetoothChatService(3618): END mAcceptThread, socket Type: Insecure 06-18 14:14:27.660: D/BluetoothChatService(3618): create ConnectedThread: Insecure 06-18 14:14:27.660: I/BluetoothChatService(3618): BEGIN mConnectedThread 06-18 14:14:27.660: D/BluetoothChatService(3618): setState() 2 -> 3 06-18 14:14:27.670: I/BluetoothChat(3618): MESSAGE_STATE_CHANGE: 3 [disconnect issued] 06-18 14:14:41.330: D/BluetoothChatService(3618): stop 06-18 14:14:41.340: D/BluetoothChatService(3618): setState() 3 -> 0 06-18 14:14:41.340: E/BluetoothChatService(3618): disconnected 06-18 14:14:41.340: E/BluetoothChatService(3618): java.io.IOException: Operation Canceled 06-18 14:14:41.340: E/BluetoothChatService(3618): at android.bluetooth.BluetoothSocket.readNative(Native Method) 06-18 14:14:41.340: E/BluetoothChatService(3618): at android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:307) 06-18 14:14:41.340: E/BluetoothChatService(3618): at android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:96) 06-18 14:14:41.340: E/BluetoothChatService(3618): at java.io.InputStream.read(InputStream.java:158) 06-18 14:14:41.340: E/BluetoothChatService(3618): at com.example.android.BluetoothChat.BluetoothChatService$ConnectedThread.run(BluetoothChatService.java:477) 06-18 14:14:41.340: D/BluetoothChatService(3618): start 06-18 14:14:41.340: D/BluetoothChatService(3618): setState() 0 -> 1 06-18 14:14:41.360: D/BluetoothChatService(3618): start 06-18 14:14:41.360: D/BluetoothChatService(3618): setState() 1 -> 1 06-18 14:14:41.360: D/BluetoothChatService(3618): Socket Type: SecureBEGIN mAcceptThreadThread[Thread-15,5,main] 06-18 14:14:41.360: D/BluetoothChatService(3618): Socket Type: InsecureBEGIN mAcceptThreadThread[Thread-16,5,main] 06-18 14:14:41.360: I/BluetoothChat(3618): MESSAGE_STATE_CHANGE: 0 06-18 14:14:41.370: I/BluetoothChat(3618): MESSAGE_STATE_CHANGE: 1 06-18 14:14:41.410: I/BluetoothChat(3618): MESSAGE_STATE_CHANGE: 1 Connection from Android 4.0.3 to Android 3.2 tablet with no popup. Logcat msg as follow, 06-18 16:13:06.930: E/BluetoothChat(1387): - ON PAUSE - 06-18 16:13:09.330: D/BluetoothChat(1387): onActivityResult -1 06-18 16:13:09.330: D/BluetoothChatService(1387): connect to: E0:B9:A5:78:30:62 06-18 16:13:09.330: D/BluetoothChatService(1387): setState() 1 -> 2 06-18 16:13:09.330: E/BluetoothChat(1387): + ON RESUME + 06-18 16:13:09.330: I/BluetoothChatService(1387): BEGIN mConnectThread SocketType:Insecure 06-18 16:13:09.360: I/BluetoothChat(1387): MESSAGE_STATE_CHANGE: 2 06-18 16:13:14.010: D/BluetoothChatService(1387): connected, Socket Type:Insecure 06-18 16:13:14.010: D/BluetoothChatService(1387): Socket TypeSecurecancel Thread[AcceptThreadSecure,5,main] 06-18 16:13:14.020: D/BluetoothChatService(1387): Socket TypeInsecurecancel Thread[AcceptThreadInsecure,5,main] 06-18 16:13:14.030: E/BluetoothChatService(1387): Socket Type: Secureaccept() failed 06-18 16:13:14.030: E/BluetoothChatService(1387): java.io.IOException: Operation Canceled 06-18 16:13:14.030: E/BluetoothChatService(1387): at android.bluetooth.BluetoothSocket.acceptNative(Native Method) 06-18 16:13:14.030: E/BluetoothChatService(1387): at android.bluetooth.BluetoothSocket.accept(BluetoothSocket.java:305) 06-18 16:13:14.030: E/BluetoothChatService(1387): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:107) 06-18 16:13:14.030: E/BluetoothChatService(1387): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:93) 06-18 16:13:14.030: E/BluetoothChatService(1387): at com.example.android.BluetoothChat.BluetoothChatService$AcceptThread.run(BluetoothChatService.java:327) 06-18 16:13:14.040: I/BluetoothChatService(1387): END mAcceptThread, socket Type: Secure 06-18 16:13:14.040: E/BluetoothChatService(1387): Socket Type: Insecureaccept() failed 06-18 16:13:14.040: E/BluetoothChatService(1387): java.io.IOException: Operation Canceled 06-18 16:13:14.040: E/BluetoothChatService(1387): at android.bluetooth.BluetoothSocket.acceptNative(Native Method) 06-18 16:13:14.040: E/BluetoothChatService(1387): at android.bluetooth.BluetoothSocket.accept(BluetoothSocket.java:305) 06-18 16:13:14.040: E/BluetoothChatService(1387): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:107) 06-18 16:13:14.040: E/BluetoothChatService(1387): at android.bluetooth.BluetoothServerSocket.accept(BluetoothServerSocket.java:93) 06-18 16:13:14.040: E/BluetoothChatService(1387): at com.example.android.BluetoothChat.BluetoothChatService$AcceptThread.run(BluetoothChatService.java:327) 06-18 16:13:14.050: D/BluetoothChatService(1387): create ConnectedThread: Insecure 06-18 16:13:14.050: D/BluetoothChatService(1387): setState() 2 -> 3 06-18 16:13:14.050: I/BluetoothChatService(1387): END mAcceptThread, socket Type: Insecure 06-18 16:13:14.050: I/BluetoothChatService(1387): BEGIN mConnectedThread 06-18 16:13:14.060: I/BluetoothChat(1387): MESSAGE_STATE_CHANGE: 3 06-18 16:13:14.100: D/dalvikvm(1387): GC_CONCURRENT freed 189K, 12% free 8011K/9095K, paused 1ms+3ms [disconnect issued] 06-18 16:13:24.520: D/BluetoothChatService(1387): stop 06-18 16:13:24.530: D/BluetoothChatService(1387): setState() 3 -> 0 06-18 16:13:24.530: E/BluetoothChatService(1387): disconnected 06-18 16:13:24.530: E/BluetoothChatService(1387): java.io.IOException: Operation Canceled 06-18 16:13:24.530: E/BluetoothChatService(1387): at android.bluetooth.BluetoothSocket.readNative(Native Method) 06-18 16:13:24.530: E/BluetoothChatService(1387): at android.bluetooth.BluetoothSocket.read(BluetoothSocket.java:327) 06-18 16:13:24.530: E/BluetoothChatService(1387): at android.bluetooth.BluetoothInputStream.read(BluetoothInputStream.java:96) 06-18 16:13:24.530: E/BluetoothChatService(1387): at java.io.InputStream.read(InputStream.java:163) 06-18 16:13:24.530: E/BluetoothChatService(1387): at com.example.android.BluetoothChat.BluetoothChatService$ConnectedThread.run(BluetoothChatService.java:477) 06-18 16:13:24.530: D/BluetoothChatService(1387): start 06-18 16:13:24.530: D/BluetoothChatService(1387): setState() 0 -> 1 06-18 16:13:24.550: D/BluetoothChatService(1387): Socket Type: SecureBEGIN mAcceptThreadThread[Thread-208,5,main] 06-18 16:13:24.550: D/BluetoothChatService(1387): start 06-18 16:13:24.550: D/BluetoothChatService(1387): setState() 1 -> 1 06-18 16:13:24.550: D/BluetoothChatService(1387): Socket Type: InsecureBEGIN mAcceptThreadThread[Thread-209,5,main] 06-18 16:13:24.560: I/BluetoothChat(1387): MESSAGE_STATE_CHANGE: 0 06-18 16:13:24.570: I/BluetoothChat(1387): MESSAGE_STATE_CHANGE: 1 06-18 16:13:24.610: I/BluetoothChat(1387): MESSAGE_STATE_CHANGE: 1 Any thoughts? How do I avoid the "Bluetooth pairing request" popup ? Thanks. On Monday, June 18, 2012 11:11:25 AM UTC-4, HC wrote: > > I have same issue when I try to connect to my own Bluetooth (SPP) device > with modified Bluetooth Chat app using insecure connection mode on a > GT-P3113, that is with Android 4.0.3, a "Bluetooth pairing request" window > popup after select the paired device while with Android 3.2 it doesn't. > But when I use the same modified Bluetooth Chat app (on the same GT-P3113) > to connect another Android tablet running Bluetooth Chat app, there is no > pairing request. > Is it possible Android tablet automatically switch to secure mode and skip > the "unnecessary" pairing? > > Thanks > On Monday, May 14, 2012 11:09:44 PM UT-4, Jim Morris wrote: >> >> I have developed an Android app that communicates with a Blue Bamboo >> Bluetooth printer. I have no trouble communicating with the printer on >> a galaxy P-6210 (Android 3.2). I purchased a P-3113 (Android 4.0.3). >> When my app runs on the P-3113, I get the following problem. >> >> When the P-3113 is trying to pair with the Blue Bamboo printers, it >> asks me to type in the pin number for pairing, but the device was >> already paired before the app started up!!!!!!! Why does it ask me for >> a pin number again, when the devices are already paired up? >> >> When I enter the pin number again, the device will still not connect. >> >> The problem occurs on the device running version 4.0.3 regardless of >> whether my software is targeted for version 4.0.3 or version 3.2. >> >> I can supply the manufacturer's demo software source code, which also >> exhibits the same problem. >> >> I believe this is a bug introduced into Android 4.0.3. The software >> works fine on Android 3.2 on a Galaxy P-6210. > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en