Set bt-core status to match IVI 46/14346/1 accepted/tizen/generic/20140114.103813 accepted/tizen/generic/20140117.092121 accepted/tizen/ivi/20140114.191349 accepted/tizen/ivi/20140116.230214 accepted/tizen/mobile/20140113.182117 accepted/tizen/mobile/20140117.163028 submit/tizen/20140113.064440 submit/tizen/20140116.221107
authorWu Zheng <wu.zheng@intel.com>
Fri, 3 Jan 2014 07:55:27 +0000 (02:55 -0500)
committerWu Zheng <wu.zheng@intel.com>
Fri, 3 Jan 2014 07:55:27 +0000 (02:55 -0500)
On IVI, bluetooth is enabled defaultly.

Therefore, bt-core doesn't know the BT status.
It results in that bt-core can't close BT.

The patch will fix the bug on IVI.

Change-Id: Ic16b0430fe0cb65856b84e0e2f9f903ecf800cbe

bt-core/bt_core.c

index 1cd9c27..d1c75a9 100644 (file)
@@ -141,6 +141,7 @@ static int __bt_disable_adapter(void)
 
        BT_DBG("");
 
+#ifdef __TIZEN_MOBILE__
        status = __bt_core_get_status();
        if (status == BT_ACTIVATING) {
                /* Forcely terminate */
@@ -153,15 +154,17 @@ static int __bt_disable_adapter(void)
                BT_DBG("Invalid state %d", status);
                return -1;
        }
-
+#endif
        __bt_core_set_status(BT_DEACTIVATING);
 
        if (system("/usr/etc/bluetooth/bt-stack-down.sh &") < 0) {
                        BT_DBG("running script failed");
-                       __bt_core_set_status( BT_ACTIVATED);
+                       __bt_core_set_status(BT_ACTIVATED);
                        return -1;
        }
-
+#ifndef __TIZEN_MOBILE__
+       __bt_core_terminate();
+#endif
        return 0;
 }