Updated connman to version 1.35
[platform/upstream/connman.git] / plugins / bluetooth.c
old mode 100644 (file)
new mode 100755 (executable)
index f759a90..f89edfa
@@ -192,8 +192,14 @@ static bool pan_connect(struct bluetooth_pan *pan,
                return false;
        }
 
+#if defined TIZEN_EXT
+       if (pan->network) {
+#endif
        connman_network_set_index(pan->network, index);
        connman_network_set_connected(pan->network, true);
+#if defined TIZEN_EXT
+       }
+#endif
 
        return true;
 }
@@ -211,6 +217,18 @@ static void pan_connect_cb(DBusMessage *message, void *user_data)
                return;
        }
 
+#ifdef TIZEN_EXT
+       /*
+        * Network could be removed because of BT adapter power off
+        * This is to handle the scenario where network is removed
+        * before the connect_cb is called
+        */
+       if (!pan->network) {
+               DBG("network already removed");
+               return;
+       }
+#endif
+
        if (dbus_message_get_type(message) == DBUS_MESSAGE_TYPE_ERROR) {
                const char *dbus_error = dbus_message_get_error_name(message);
 
@@ -262,6 +280,9 @@ static int bluetooth_pan_connect(struct connman_network *network)
                        g_strdup(path), g_free))
                return -EIO;
 
+#if defined TIZEN_EXT
+       if (pan->network)
+#endif
        connman_network_set_associating(pan->network, true);
 
        return -EINPROGRESS;
@@ -286,6 +307,9 @@ static void pan_disconnect_cb(DBusMessage *message, void *user_data)
 
        DBG("network %p", pan->network);
 
+#if defined TIZEN_EXT
+       if (pan->network)
+#endif
        connman_network_set_connected(pan->network, false);
 }
 
@@ -299,6 +323,11 @@ static int bluetooth_pan_disconnect(struct connman_network *network)
        if (!pan)
                return -EINVAL;
 
+#if defined TIZEN_EXT
+       if (connman_network_get_associating(network) == TRUE)
+               connman_network_clear_associating(network);
+#endif
+
        path = g_dbus_proxy_get_path(pan->btnetwork_proxy);
 
        if (!g_dbus_proxy_method_call(pan->btnetwork_proxy, "Disconnect",
@@ -524,7 +553,10 @@ static void device_enable_cb(const DBusError *error, void *user_data)
                goto out;
        }
 
+#if !defined TIZEN_EXT
        enable_device(device, path);
+#endif
+
 out:
        g_free(path);
 }
@@ -591,7 +623,9 @@ static void device_disable_cb(const DBusError *error, void *user_data)
                goto out;
        }
 
+#if !defined TIZEN_EXT
        disable_device(device, path);
+#endif
 
 out:
        g_free(path);
@@ -883,7 +917,7 @@ static void bluetooth_tech_remove(struct connman_technology *technology)
 
 static int bluetooth_tech_set_tethering(struct connman_technology *technology,
                const char *identifier, const char *passphrase,
-               const char *bridge, bool enabled)
+               const char *bridge, bool enabled, bool hidden)
 {
        GHashTableIter hash_iter;
        gpointer key, value;