fix destroy bonding device use case 33/31833/2 submit/tizen/20141215.095932 submit/tizen_ivi/20141215.151515
authorCorentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
Wed, 10 Dec 2014 17:15:47 +0000 (18:15 +0100)
committerCorentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
Mon, 15 Dec 2014 09:53:14 +0000 (10:53 +0100)
commit30072626e47737052e39bde9744cbd41fafd8e70
tree03198e471cec43d37f1930cb972fdadb21477969
parentd9e4d872d99b9876a89233fde514e7fbad4b217d
fix destroy bonding device use case

9319c8 "add device disappear event" commit brings a regression.
It added a logic of storing paired device in glist which is not good and check
paired device in glist before sending a 'destroy bond' or 'disappear device' events.

It results that if a device was already paired before starting bt-service daemon,
the paired device was not listed in the glist and so 'destroy bond' event
was never triggered in case of unbonding request.

To fix it, let's consider that if device is present in glist, we trig 'disappear device'
event and otherwise we trig 'destroy bond' event.

Change-Id: I202cdeea48af7e3168c089c4164c7d7ef4711b2c
Signed-off-by: Corentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
bt-service/bt-service-event-receiver.c