Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2207890imn; Mon, 1 Aug 2022 15:27:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR6jhgOjF5NW7CyPQsr/LER5niwBu4cS4rDsW7tEQs7tYxwrRDciLqc4SJ3cZOpQkDmstMWi X-Received: by 2002:a05:6402:190b:b0:43d:d001:2cce with SMTP id e11-20020a056402190b00b0043dd0012ccemr3856334edz.326.1659392874101; Mon, 01 Aug 2022 15:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659392874; cv=none; d=google.com; s=arc-20160816; b=EaWAMtbtvN2BUaT43OtZBgvcRVNkWSJWbToyvbJKzt+t+wiyWS5IbbwtVTKzF/7nuH NBAdc6b2aXHNlfg/6pqJfCJLz+jCGItKFg9FyzUI38kpKu/pnsoJcHdFBzadIpMCnbKz 2zOD5nweG7Wzpi7OSzILeZ7aBAVTqHZxnD9NksoSdjTg2bKl8rgFh/fM3KtKwyNSIkSl oYKGhieXrHIRhCWuI04bOPzwmh8nNzJ76MyvqRPNUeBSo391sPuxK0YsW/vH+PxeYXjV 6xa7ZeHwvIecpDz6cUsl7BpRBsYBnQZl7/sCQKX5FL8pTIkkKvOeBTQ7MfaNX31BJvSw qB5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=SaUYLzBNL8ysLF5DpFSvdwrHS8jwzSZy/cq88W7EcZI=; b=0MqWhqVy7yfKDDvtvmz29GVlwa+48SvJ5wrAxZ0LUSRVFpyMVG/BZWK9+mf1oCGn4W VrDUClApDKfZJNxJSmmZYQ6c0NFF3lZSRueiIs7sFfZxNUXr06+D24sUzc+6KcQz+KaY XzCmdULQsZGmt202Lbib9bTKk14jAge0O6clP3EQF2doZleZizISgw0kpsvBpZCoys+W c9F9ErSgA7EppTwbaRaQ8j5iCA7s5kqZapIG31x9WGmOWuKsjTQrwGL2DlkGnDoQL9Nq JeJz9KDS9ZpTuFyvauYMBkJjYbwvVerEcX/uouZptQTNuv5OeGyam3PrripmRLv+tEpw VmZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Rb+HJDRU; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a05640250cd00b0043c8181a57fsi11395394edb.180.2022.08.01.15.27.23; Mon, 01 Aug 2022 15:27:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Rb+HJDRU; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235296AbiHAWVU (ORCPT + 99 others); Mon, 1 Aug 2022 18:21:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235057AbiHAWVR (ORCPT ); Mon, 1 Aug 2022 18:21:17 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E4D130565 for ; Mon, 1 Aug 2022 15:21:16 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id q22so3586343plr.9 for ; Mon, 01 Aug 2022 15:21:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=SaUYLzBNL8ysLF5DpFSvdwrHS8jwzSZy/cq88W7EcZI=; b=Rb+HJDRUkGuQunbOwhQqLjnIe9b34p/uoUW1mwYhuRRf79p5DhmI4jOLhWAcyY11Tt +LjnfRBwXWWg2Es0kmB3PKcnGUCdh+Rwj2LAbK6nx/DcEdzOINQJjgMZ+MYApiGE1W6J 6osyHooAVfp+AR4clWbEF+u4twaYHDHR6S5QVfPlVl9qFHjo74nHZWzHiM0SwHYJT0dm 6uZ4BhzPcpg2TXi+ZkzdKFwe2ekmOWEncucK4oSFKfGIit+YymioshrjgDIAzRI3AsF3 h4Z7LZPx4PFmOSLUDzvFhq9SHdCS+Fv3lFX7j0HH2nZALgZNmAGUXp72OzAsbIwEPIWx OArw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=SaUYLzBNL8ysLF5DpFSvdwrHS8jwzSZy/cq88W7EcZI=; b=mcDRc+gXuP6Jpoqsa0yWWVPrP6MB7fLcsM3PGd/udarAbQ0GmLc+3QYrwPQthYWZZA zYRzhQodj9yaQotVoTDX2XDz4GAwgJabdGuOy3hESefYqtBD+KMwV6oUJiW9F88PP+So GSxx0XUwCDTEGGoqPX8uyKAwzHfQiMeVm/HUYBhr96yHWr5/goGbz1f4urDT7Mj5zmUL b9krNrWtMOV8H6vXxxmXWrUfZA0Daw3zC7Auv6Vn59nDqjNq24jgnGp5YjwOWyQR4u8Z a5ehmu8Zvodq5TbuvMPvyhTvYkOk0vp1c/7knSFxalzyHQyCh4W9kOKX97p7/Lp8PrBG vgOA== X-Gm-Message-State: ACgBeo1ZgX4iLmDSll360DZiIrKUrL9vZcxRfBhKFYPbipVWQGjgvjuk qTXRJxvCx7HLJaNen/YF5YigbpLuvsUhKA== X-Received: by 2002:a17:902:8f92:b0:16c:e485:7cd2 with SMTP id z18-20020a1709028f9200b0016ce4857cd2mr18993901plo.50.1659392475454; Mon, 01 Aug 2022 15:21:15 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id bg1-20020a056a02010100b00419a6f3c8f5sm7879263pgb.19.2022.08.01.15.21.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Aug 2022 15:21:14 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ] device: Fix not auto-connecting profile Date: Mon, 1 Aug 2022 15:21:13 -0700 Message-Id: <20220801222113.2269509-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz If the profile is registered and marked to auto-connect it shall automatically be connected whenever a device is already connected. Fixes: https://github.com/bluez/bluez/issues/370 --- src/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index 9a4f2ce45..775003796 100644 --- a/src/device.c +++ b/src/device.c @@ -4574,7 +4574,8 @@ void device_probe_profile(gpointer a, gpointer b) device->services = g_slist_append(device->services, service); - if (!profile->auto_connect || !device->general_connect) + if (!profile->auto_connect || (!btd_device_is_connected(device) && + !device->general_connect)) return; device->pending = g_slist_append(device->pending, service); -- 2.37.1