+static gboolean __bt_hold_current_advertising_timeout_cb(gpointer user_data)
+{
+ GDBusProxy *proxy;
+ GError *error = NULL;
+ GVariant *ret;
+
+ BT_INFO("Restart advertising stopped by bt-service");
+
+ le_adv_slot[0].hold_timer_id = 0;
+
+ proxy = _bt_get_adapter_proxy();
+ retv_if(proxy == NULL, FALSE);
+
+ ret = g_dbus_proxy_call_sync(proxy, "SetAdvertising",
+ g_variant_new("(bi)", TRUE, 0),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ &error);
+
+ if (error) {
+ BT_ERR("SetAdvertising Fail: %s", error->message);
+ g_clear_error(&error);
+ return FALSE;
+ }
+
+ if (ret)
+ g_variant_unref(ret);
+
+ return FALSE;
+}
+
+int _bt_hold_current_advertising(void)
+{
+ GDBusProxy *proxy;
+ GError *error = NULL;
+ GVariant *ret;
+
+ if (le_adv_slot[0].sender && le_adv_slot[0].is_advertising == TRUE) {
+ BT_INFO("Stop current advertising by bt-service");
+
+ proxy = _bt_get_adapter_proxy();
+ retv_if(proxy == NULL, BLUETOOTH_ERROR_INTERNAL);
+
+ ret = g_dbus_proxy_call_sync(proxy, "SetAdvertising",
+ g_variant_new("(bi)", FALSE, 0),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ &error);
+
+ if (error) {
+ BT_ERR("SetAdvertising Fail: %s", error->message);
+ g_clear_error(&error);
+ return BLUETOOTH_ERROR_INTERNAL;
+ }
+
+ if (ret)
+ g_variant_unref(ret);
+
+ le_adv_slot[0].hold_timer_id = g_timeout_add(2000,
+ __bt_hold_current_advertising_timeout_cb, NULL);
+ } else {
+ BT_INFO("It's NOT advertising");
+ return BLUETOOTH_ERROR_NOT_IN_OPERATION;
+ }
+
+ return BLUETOOTH_ERROR_NONE;
+}
+