Fix : Bluetooth disabled event is sent twice
[Problem] Bluetooth disabled event is sent twice when it is turned off
by entering flight mode. It causes applications malfunction.
For example, normally disabled event is received by weconnd after all GATT
services have been removed. But in problem situation, the first
disabled event happens too early so bluetooth resources (GATT services)
remain at that time. It makes weconnd enter to strange condition (BT off but
there are some GATT services). And after bluetooth resources are
cleared, the second disabled event happens again. But this event is not
processed by weconnd because it is same state to previous one.
[Cause & Measure] The first event was sent in wrong context (at Powered
property change). This patch makes the event happen only when
bluetoothd is terminated. So that, only one disabled event is sent
after all bluetooth resources are cleared.
[Checking Method] Check disabled event when entering to flight mode.
This patch is tested under below situation also.
1. BT on / off
2. Flight mode on -> Flight mode off
3. Flight mode on -> BT on -> Flight mode off
4. Recovery (TxTimeout or Hardware error by sending dbus signal)
Change-Id: Ief9dff1b4074143e1cab41b688cc960f0c73760e