JK just pointed out to me that this might be a DBUS failure that we fixed a while back.
Can you make sure you have this patch in your build? commit 4a364130fb072bf44367e537f8d24e7e00c6ca69 Author: Nick Pelly <[email protected]> Date: Thu Jun 18 15:05:34 2009 -0700 Fix runtime restarts due to sending the wrong flags to dbus. In eventLoopMain we were correctly translating from unix events to dbus flags, but a coding typo then gave the unix events to dbus. Fix this typo. Also noticed that we were passing raw dbus flags to poll() in another area. This did not cause any immediate problem, since POLLIN | POLLPRI is harmless and we do not usually need POLLOUT. But fixed anyway. diff --git a/core/jni/android_server_BluetoothEventLoop.cpp b/core/jni/android_server_BluetoothEventLoop.cpp index ff8f28a..ad24136 100644 --- a/core/jni/android_server_BluetoothEventLoop.cpp +++ b/core/jni/android_server_BluetoothEventLoop.cpp @@ -162,6 +162,19 @@ static const DBusObjectPathVTable agent_vtable = { NULL, agent_event_filter, NULL, NULL, NULL, NULL }; +static unsigned int unix_events_to_dbus_flags(short events) { + return (events & DBUS_WATCH_READABLE ? POLLIN : 0) | + (events & DBUS_WATCH_WRITABLE ? POLLOUT : 0) | + (events & DBUS_WATCH_ERROR ? POLLERR : 0) | + (events & DBUS_WATCH_HANGUP ? POLLHUP : 0); +} + +static short dbus_flags_to_unix_events(unsigned int flags) { + return (flags & POLLIN ? DBUS_WATCH_READABLE : 0) | + (flags & POLLOUT ? DBUS_WATCH_WRITABLE : 0) | + (flags & POLLERR ? DBUS_WATCH_ERROR : 0) | + (flags & POLLHUP ? DBUS_WATCH_HANGUP : 0); +} static jboolean setUpEventLoop(native_data_t *nat) { LOGV(__FUNCTION__); @@ -385,8 +398,7 @@ static void handleWatchAdd(native_data_t *nat) { read(nat->controlFdR, &newFD, sizeof(int)); read(nat->controlFdR, &flags, sizeof(unsigned int)); read(nat->controlFdR, &watch, sizeof(DBusWatch *)); - int events = (flags & DBUS_WATCH_READABLE ? POLLIN : 0) - | (flags & DBUS_WATCH_WRITABLE ? POLLOUT : 0); + short events = dbus_flags_to_unix_events(flags); for (int y = 0; y<nat->pollMemberCount; y++) { if ((nat->pollData[y].fd == newFD) && @@ -430,8 +442,7 @@ static void handleWatchRemove(native_data_t *nat) { read(nat->controlFdR, &removeFD, sizeof(int)); read(nat->controlFdR, &flags, sizeof(unsigned int)); - int events = (flags & DBUS_WATCH_READABLE ? POLLIN : 0) - | (flags & DBUS_WATCH_WRITABLE ? POLLOUT : 0); + short events = dbus_flags_to_unix_events(flags); for (int y = 0; y < nat->pollMemberCount; y++) { if ((nat->pollData[y].fd == removeFD) && @@ -495,13 +506,12 @@ static void *eventLoopMain(void *ptr) { } } } else { - int event = nat->pollData[i].revents; - int flags = (event & POLLIN ? DBUS_WATCH_READABLE : 0) | - (event & POLLOUT ? DBUS_WATCH_WRITABLE : 0); - dbus_watch_handle(nat->watchData[i], event); - nat->pollData[i].revents = 0; - // can only do one - it may have caused a 'remove' - break; + short events = nat->pollData[i].revents; + unsigned int flags = unix_events_to_dbus_flags(events); + dbus_watch_handle(nat->watchData[i], flags); + nat->pollData[i].revents = 0; + // can only do one - it may have caused a 'remove' + break; } } while (dbus_connection_dispatch(nat->conn) == On Fri, Aug 7, 2009 at 9:41 AM, Nick Pelly<[email protected]> wrote: > Hi, > > Sorry for the late reply, > > This is a really strange failure log. We have never seen this before. > Sorry I know that is not very useful :( > > Nick > > On Wed, Jul 29, 2009 at 7:01 AM, pavan savoy<[email protected]> wrote: >> Hi, >> >> On the donut branch - a2dp connection the first time, when userdata and >> cache is empty always seem to fail - resulting in restart of whole android. >> Is android trying to read in some-parameter from userdata/cache which hasn't >> been created yet ? >> >> find below the logs, [also attached the complete log file] >> >> I/BT HSHFP( 1083): Successful RFCOMM socket connect. >> D/BT HSHFP( 1083): RFCOMM connection attempt took 1775 ms >> D/BT HSHFP( 1083): Rfcomm connected >> D/BT HSHFP( 1083): Headset state 1 -> 2, result = 1 >> D/BluetoothA2dpService( 931): connectSink(00:13:17:72:30:B9) >> I/Bluetooth AT recv( 1083): AT+BRSF=27 >> I/Bluetooth AT sent( 1083): +BRSF: 99 >> I/Bluetooth AT sent( 1083): OK >> D/BluetoothA2dpService( 931): new bluez sink: 00:13:17:72:30:B9 >> (/org/bluez/audio/device0) >> binder: release 931:936 transaction 4665 in, still active >> binder: send failed reply for transaction 4665 to 1083:1083 >> binder: release 931:1099 transaction 4664 in, still active >> binder: send failed reply for transaction 4664 to 1153:1153 >> E/BluetoothDevice( 1083): >> E/BluetoothDevice( 1083): android.os.DeadObjectException >> E/BluetoothDevice( 1083): \0x09at android.os.BinderProxy.transact(Native >> Method) >> E/BluetoothDevice( 1083): \0x09at >> android.bluetooth.IBluetoothDevice$Stub$Proxy.getRemoteName(IBluetoothDevice.java:991) >> binder: 1083:1236 transaction failed 29189, size104-4 >> ....... >> E/BluetoothDevice( 1083): \0x09at >> com.android.phone.BluetoothHandsfree.configAudioParameters(BluetoothHandsfree.java:270) >> E/BluetoothDevice( 1083): \0x09at >> com.android.phone.BluetoothHandsfree.connectHeadset(BluetoothHandsfree.binder: >> 1083:1083 transaction failed 29189, size120-0 >> java:232) >> E/BluetoothDevice( 1083): \0x09at >> com.android.phone.BluetoothHandsfree.connectHeadset(BluetoothHandsfree.binder: >> 1083:1083 transaction failed 29189, size120-0 >> java:232) >> E/BluetoothDevice( 1083): \0x09at >> com.android.phone.BluetoothHeadsetService$6.handleMessage(BluetoothHeadsetService.java:466) >> E/BluetoothDevice( 1083): \0x09at >> android.os.Handler.dispatchMessage(Handler.java:99) >> ...... >> E/BluetoothDevice( 1083): \0x09at >> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) >> E/BluetoothDevice( 1083): \0x09at >> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) >> E/BluetoothDevice( 1083): \0x09at dalvik.system.NativeStart.main(Native >> Method) >> I/ActivityThread( 1204): Removing dead content provider: settings >> I/ActivityThread( 1186): Removing dead content provider: settings >> I/ActivityThread( 1177): Removing dead content provider: settings >> I/ActivityThread( 1107): Removing dead content provider: settingsinit: >> untracked pid 1120 exited >> >> I/ActivityThread( 1153): Removing dead content provider: settings >> I/ServiceManager( 871): service 'battery' died >> I/ServiceManager( 871): service 'hardware' died >> I/ServiceManager( 871): service 'activity.senders' died >> I/ServiceManager( 871): service 'meminfo' died >> I/ServiceManager( 871): service 'cpuinfo' died >> I/ServiceManager( 871): service 'isms' died >> I/ServiceManager( 871): service 'simphonebook' died >> I/ServiceManager( 871): service 'iphonesubinfo' died >> I/ServiceManager( 871): service 'phone' died >> D/AndroidRuntime( 1239): >> D/AndroidRuntime( 1239): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<< >> >> >> -- >> --Pavan Savoy >> >> >> >> >> > --~--~---------~--~----~------------~-------~--~----~ unsubscribe: [email protected] website: http://groups.google.com/group/android-porting -~----------~----~----~----~------~----~------~--~---
