Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp418699pxa; Fri, 21 Aug 2020 10:33:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzjLKdc0nYHTb7pXn9FbDc8XvRmXdvmuWGWwLVzajt540D79UnzYej8i8oeUHZUgFj1hR3 X-Received: by 2002:a17:906:3449:: with SMTP id d9mr4018524ejb.460.1598031231168; Fri, 21 Aug 2020 10:33:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598031231; cv=none; d=google.com; s=arc-20160816; b=D8vMzWx1OmwJVizkaSB/K2TLp6OzlWz/A8dSespf92YBefTRne5RgsilepXjXr5vYQ UpB4nNjzkTxxndskLj7zVyVHE5/A57GuRU8gFGsauw06vfagV4pCtAbpjBgIXrUCvRLx MiqJwuM3TTGAUMjLj6wOJefAesGT0H5vOyCn+tKIb+fJKlDIctmpWXxBqtMrz55XPNlw dZLOA5hHm5ljr8k4fealOVk/YuRiCgGdcR+x96Ef0DPOZdJGA4F9LK1mqy2W2kBla1O4 6VP2/0whBfOTZAwPKLjOr7yoVeAbV/T+3gUbQIdOuy0W0aKgIBOEH9HAF5vnR+zu+iNo VxKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wQS2uBDhUd3sZz5wY/MnOMF8c1/iiCazEEEhF1oWRBg=; b=tzXkn6dbC5yjwA+V5zwVXBb+WEFaiHUWP/6JSSF5Bzkl9P9mVwzP8BLGthgOwE/Zsh SOvQi8afsPIdAO+wJxrPS9Ja2kWJm6zG7bCL36PbWF9JDgAcg93dJzmZEIe+KHV+HR+u JhIS32+xmypJAOOH0HpFqMtP0qVQzvNEi9JQnhYzZ8Q0peEHk0UbhN/5452MEEomYEUy oC1gO80+7vNIuay/6xFR3HMZSjfhKd3gL4EUyR4yMzTvgF7NhOdGon4BhT3AVTCaUfUr jWj/KceuVib3pLlhOiJHLXXax2ijpDDPkEie/zNHdYzjdUJUZ+0c0YrxwKRZaj+eo8yj 2kyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VtLle+O+; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v24si1708670edl.35.2020.08.21.10.33.23; Fri, 21 Aug 2020 10:33:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VtLle+O+; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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 S1726057AbgHURdS (ORCPT + 99 others); Fri, 21 Aug 2020 13:33:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725976AbgHURdQ (ORCPT ); Fri, 21 Aug 2020 13:33:16 -0400 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C81F9C061573 for ; Fri, 21 Aug 2020 10:33:15 -0700 (PDT) Received: by mail-oi1-x242.google.com with SMTP id e6so2179118oii.4 for ; Fri, 21 Aug 2020 10:33:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wQS2uBDhUd3sZz5wY/MnOMF8c1/iiCazEEEhF1oWRBg=; b=VtLle+O+/1zggmOAlP7NhC2a7boxj7Ode0jyk+SXNCH6hMoDPR7dtiS+qsYgXvm6zO 2w1NgfPi1//FzObN0LsHqcLdgwy0zi/2nqahU7iSCK+31Oa3ca/a5cj/lcm2f2U+Lxqn H7g8m250LwRjYbjQJbwhuwg+dKOzHPoq9dzHpH6zvEpNUK6mPSN/KaI+UVEd8wYZB13w w+DLzmDjMYKpY0i4cyx7qofBbDPkbEsKieBXoVNgH1QuGUjja9wKGc1ajCGzqKN3wXm3 rL/a/HaL9//h/aRo+gGZ1BJxNbH5R8eqHxJyMa8G3qeHhVSKK2YXVB0+ZB92FXkc/LQ2 mzdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wQS2uBDhUd3sZz5wY/MnOMF8c1/iiCazEEEhF1oWRBg=; b=gmT1fy3WeP9eEmVA9kSWDBIvfUmRJjDPaMKobskdp2GTQ/tGIpzZaoYIShERqOR+X/ uxB/cUTqsaFVAKb7qUPm2PhEiMun2tPCJ6JgQJyQXgtoq8jq7L5ELvU/vIYAwExCXH8x sKJj4HzkuLlOIHD5IK4VbaT1Pkh5IcInocNGbs1OyTAsc55fB7G7K6QgFX/FdXQvO+YO 86wX+RAoie8XuLIj3+hKPZQAGMLwSkMLWWzR2iGMbyL5JUkLFomnd6WoXDuHuW9i6jfp 5zVaRgv/mmiqcFlemo150mbnyKHxwq9ul2UiuwuCdiwsuYvc/bp2etoduKAzdoOBI8FC WL9A== X-Gm-Message-State: AOAM532IeEI8JesKiq0iapHv1TYt1yOmobe1/xHTxvak/pIBF5FDHUqh 5fNLC33DeOKJ2sXtKk9cdnKZCECU3Y1qQebq1ZM= X-Received: by 2002:aca:cc50:: with SMTP id c77mr2353779oig.152.1598031195003; Fri, 21 Aug 2020 10:33:15 -0700 (PDT) MIME-Version: 1.0 References: <20200821070409.18037-1-sonnysasaka@chromium.org> In-Reply-To: <20200821070409.18037-1-sonnysasaka@chromium.org> From: Luiz Augusto von Dentz Date: Fri, 21 Aug 2020 10:33:04 -0700 Message-ID: Subject: Re: [PATCH BlueZ] gap: Enable the external flag To: Sonny Sasaka Cc: "linux-bluetooth@vger.kernel.org" , Joseph Hwang Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Sonny, On Fri, Aug 21, 2020 at 12:08 AM Sonny Sasaka wrote: > > From: Joseph Hwang > > This patch enables the external flag for gap so that the gap service can > be exported over D-Bus. > > Tested on Chrome OS that this fixes https://crbug.com/722987 so that GAP > API can be propagated to Android apps. > > Test Method 1: > - Connect to a peripheral. > - Use dbus methods to query the org.bluez.GattService1 > interface in managed objects. > - Confirm that the gap 0x1800 profile was exported like: > GattService1 path: /org/bluez/hci0/dev_xx/service0001 > service_props: dbus.String(u'UUID'): > dbus.String(u'00001800-0000-1000-8000-00805f9b34fb' > > Test Method 2: > - Install BleManager APK attached in C#0 of https://crbug.com/722987 > to ARC++ in a chromebook. > - Launch the application. > - Connect to a Dash robot. Confirm that there are 3 services > instead of 2. > > Reviewed-by: Sonny Sasaka > > --- > profiles/gap/gas.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/profiles/gap/gas.c b/profiles/gap/gas.c > index dffa31314..abe5341c0 100644 > --- a/profiles/gap/gas.c > +++ b/profiles/gap/gas.c > @@ -310,6 +310,7 @@ static int gap_disconnect(struct btd_service *service) > static struct btd_profile gap_profile = { > .name = "gap-profile", > .remote_uuid = GAP_UUID, > + .external = true, > .device_probe = gap_probe, > .device_remove = gap_remove, > .accept = gap_accept, > -- > 2.26.2 I guess you will end up exporting every single service at the end, so perhaps we should just have an entry to main.conf (ExportClaimedServices) where the system can define if services claimed by plugins are allowed to be accessed over D-Bus, and we should probably add a comment that when doing so it may cause conflicts between the daemon and applications (especially GAP/GATT service can be very sensitive). -- Luiz Augusto von Dentz