diff options
author | Christopher Tate <ctate@google.com> | 2011-03-04 17:45:00 -0800 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2011-03-04 17:45:00 -0800 |
commit | 79dd31f73d8ca4432d6f83bef1221cc3e93e932c (patch) | |
tree | 2f335f997d596c620aa97f3f32ebb07588cf8a36 /CleanSpec.mk | |
parent | 371fd13c31b7e067fafc680948b907b6a0a621d7 (diff) | |
download | frameworks_base-79dd31f73d8ca4432d6f83bef1221cc3e93e932c.zip frameworks_base-79dd31f73d8ca4432d6f83bef1221cc3e93e932c.tar.gz frameworks_base-79dd31f73d8ca4432d6f83bef1221cc3e93e932c.tar.bz2 |
Don't fail unlinking death recipients on dead binders
It's legal to call unlinkToDeath() *after* receiving binderDied(),
as long as the recipient being unlinked was in fact linked
previously. Don't throw an exception in this case. (The
exception was going unhandled in the system process, bringing
down the runtime. That's bad.)
The change here is a bit subtle. In the new implementation, the
lifetime of a JavaDeathRecipient -- the fundamental bridge between
IBinder objects and the Dalvik/JNI world -- is tied to the
lifetime of the Dalvik-side BinderProxy object it's associated
with. That means it's inappropriate for the JavaDeathRecipient
to disappear [for purposes of being referenced from the Dalvik
side] just because the IBinder has sent out its obituaries, and
instead the JavaDeathRecipient objects are kept around until
the Dalvik-side client code actually drops its reference to the
BinderProxy.
This boils down to a one-line change: we no longer unpin the
JavaDeathRecipients and free them immediately in response to
binderDied().
The rest of the CL is #ifdefed-out debugging that is invaluable
when bugs crop up.
Bug 3513703
Change-Id: I743fa49669c9252f71dcabfd8dcf42ed729b70a5
Diffstat (limited to 'CleanSpec.mk')
0 files changed, 0 insertions, 0 deletions