lichong19880911 / backport-android-bluetooth

Automatically exported from code.google.com/p/backport-android-bluetooth
0 stars 0 forks source link

Process crash on Samsung Galaxy I7500L #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to open a socket

What is the expected output? What do you see instead?
Expected: Open socket, or exception.
Actual: Process just crashes, and app restarts. No exceptions are thrown, but 
there is a BlueZ log:

11-07 06:02:26.540: ERROR/BLZ_WRAPPER(1517): btl_if_socket : blz wrapper not 
initialized
11-07 06:02:26.560: INFO/WindowManager(1063): WIN DEATH: Window{433b36b8 
com.acme.mypackage/com.acme.mypackage.activity.InitialScreen paused=false}
11-07 06:02:26.560: INFO/ActivityManager(1063): Process com.acme.mypackage (pid 
1517) has died.
11-07 06:02:26.560: WARN/ActivityManager(1063): Scheduling restart of crashed 
service com.acme.mypackage/.service.MyService in 5000ms
11-07 06:02:26.570: INFO/WindowManager(1063): WIN DEATH: Window{433210a8 
com.acme.mypackage/com.acme.mypackage.activity.Dashboard paused=false}
11-07 06:02:26.630: DEBUG/Zygote(1013): Process 1517 exited cleanly (1)
11-07 06:02:26.660: INFO/ActivityManager(1063): Start proc com.acme.mypackage 
for activity com.acme.mypackage/.activity.InitialScreen: pid=1528 uid=10042 
gids={3002, 3001}

What version of the product are you using? On what operating system?
backport-android-bluetooth: 2.2.2
Android OS: 1.5

Please provide any additional information below.

Original issue reported on code.google.com by nicolas....@gmail.com on 7 Nov 2010 at 6:17

GoogleCodeExporter commented 9 years ago
The sample chat app provided on backport-android-bluetooth source shows the 
same problem.

11-07 06:25:30.870: INFO/ActivityManager(1063): Starting activity: Intent { 
comp={backport.android.bluetooth/com.example.bluetooth.BluetoothChat} }
11-07 06:25:30.940: ERROR/BluetoothChat(2137): +++ ON CREATE +++
11-07 06:25:31.190: ERROR/BluetoothChat(2137): ++ ON START ++
11-07 06:25:31.190: DEBUG/BluetoothChat(2137): setupChat()
11-07 06:25:31.200: ERROR/BluetoothChat(2137): + ON RESUME +
11-07 06:25:31.200: DEBUG/BluetoothChatService(2137): start
11-07 06:25:31.210: ERROR/BLZ_WRAPPER(2137): btl_if_socket : blz wrapper not 
initialized
11-07 06:25:31.220: INFO/ActivityManager(1063): Process 
backport.android.bluetooth (pid 2137) has died.
11-07 06:25:31.230: INFO/WindowManager(1063): WIN DEATH: Window{433be5a0 
backport.android.bluetooth/com.example.bluetooth.MainActivity paused=false}
11-07 06:25:31.250: DEBUG/Zygote(1013): Process 2137 exited cleanly (1)
11-07 06:25:31.260: INFO/ActivityManager(1063): Start proc 
backport.android.bluetooth for activity 
backport.android.bluetooth/com.example.bluetooth.MainActivity: pid=2148 
uid=10043 gids={3002, 3001}

Original comment by nicolas....@gmail.com on 7 Nov 2010 at 6:27

GoogleCodeExporter commented 9 years ago
I should add that I've debugged this and I'm pretty sure the problem is when 
Rfcommsocket happens when it calls createNative(). Considering the 
"BLZ_WRAPPER" log, it's probably calling the native code correctly, but 
something wrong happens.

RfcommSocket.java

Line 155:
    /**
     * Creates a socket. You need to call this method before performing any
     * other operation on a socket.
     * 
     * @return FileDescriptor for the data stream.
     * @throws IOException
     * @see #destroy()
     */
    public FileDescriptor create() throws IOException {
        if (mFd == null) {
            mFd = createNative();
        }
        if (mFd == null) {
            throw new IOException("socket not created");
        }
        return mFd;
    }

Original comment by nicolas....@gmail.com on 7 Nov 2010 at 6:40