OSDN Git Service

Fix issue 2678048: binder death detection in AudioFlinger is broken.
authorEric Laurent <elaurent@google.com>
Wed, 12 May 2010 09:05:53 +0000 (02:05 -0700)
committerEric Laurent <elaurent@google.com>
Wed, 12 May 2010 13:29:16 +0000 (06:29 -0700)
commitd878cd8a79d9e296c3a3660941f2b0d3e1d16a35
tree4e37a50dd3b2fb12612df30149bcaa73c46ed788
parent1853b7d7904a78bff1728a9299b64275c1800885
Fix issue 2678048: binder death detection in AudioFlinger is broken.

There is a bug in the way notification client list is managed when the client binder
interface dies that makes that the dead client is not removed from the list: the week
reference passed by binderDied() cannot be promoted and compared to the strong
references in the list.

The fix consists in creating a new NotificationClient class that implements the
binder DeathRecipient and holds a strong reference to the IAudioFlingerClient interface.
A new instance of this class is created for each cient and a strong reference to this
object is added to the notification client list maintained by AudioFlinger.
When binderDied() is called on this object, it is removed from the list preventing
AudioFlinger to notify this client for further io changes.

Also added code to disable LifeVibes effects when the client that has enabled the
enhancements dies.

Change-Id: Icedc4af171759e9ae9a575d82d44784b4e8267e8
libs/audioflinger/AudioFlinger.cpp
libs/audioflinger/AudioFlinger.h