mbox series

[Bluez,0/8] Hi Linux-bluetooth,

Message ID 20210401102447.3958224-1-howardchung@google.com
Headers show
Series Hi Linux-bluetooth, | expand

Message

Yun-hao Chung April 1, 2021, 10:24 a.m. UTC
From: Yun-Hao Chung <howardchung@chromium.org>


This series is to add a new method |SetServiceAllowList| in D-Bus API to
control what services can be connected by specifying UUID allow list.
Users can query a device property |IsBlockedByPolicy| to tell if some
of the services are currently restricted. Since we plan to add more
methods to limit different bluetooth functionalities, we also introduce
a new interface for this purpose. This series has been tested via sending
commands with dbus-send manually on chromebook octopus and eve.

Thanks,
Howard


Howard Chung (7):
  doc: add description of SetServiceAllowList
  lib: add hash functions for bt_uuid_t
  core: add AdminPolicy Interface
  input/hog: block connection by policy
  audio: Remove Media1 interface when a2dp source disallowed
  core: add properties IsBlockedByPolicy and ServiceAllowList
  core: store ServiceAllowList into settings

Sonny Sasaka (1):
  core: Initialize uuid_str_arr to NULL

 Makefile.am              |   3 +-
 doc/admin_policy-api.txt |  34 +++++
 doc/device-api.txt       |   7 +
 lib/uuid.c               |  21 +++
 lib/uuid.h               |   3 +
 profiles/audio/a2dp.c    |   2 +
 profiles/audio/avrcp.c   |   3 +
 profiles/input/hog.c     |  22 +++
 src/adapter.c            | 148 +++++++++++++++++++-
 src/adapter.h            |   5 +
 src/admin_policy.c       | 292 +++++++++++++++++++++++++++++++++++++++
 src/admin_policy.h       |  23 +++
 src/device.c             |  79 ++++++++++-
 src/device.h             |   2 +
 src/profile.c            |  39 ++++++
 src/profile.h            |   5 +
 src/service.c            |  21 +++
 src/service.h            |   1 +
 18 files changed, 705 insertions(+), 5 deletions(-)
 create mode 100644 doc/admin_policy-api.txt
 create mode 100644 src/admin_policy.c
 create mode 100644 src/admin_policy.h

Comments

Luiz Augusto von Dentz April 1, 2021, 5:08 p.m. UTC | #1
Hi Howard,

On Thu, Apr 1, 2021 at 3:25 AM Howard Chung <howardchung@google.com> wrote:
>
> From: Yun-Hao Chung <howardchung@chromium.org>
>
>
> This series is to add a new method |SetServiceAllowList| in D-Bus API to
> control what services can be connected by specifying UUID allow list.
> Users can query a device property |IsBlockedByPolicy| to tell if some
> of the services are currently restricted. Since we plan to add more
> methods to limit different bluetooth functionalities, we also introduce
> a new interface for this purpose. This series has been tested via sending
> commands with dbus-send manually on chromebook octopus and eve.
>
> Thanks,
> Howard
>
>
> Howard Chung (7):
>   doc: add description of SetServiceAllowList
>   lib: add hash functions for bt_uuid_t
>   core: add AdminPolicy Interface
>   input/hog: block connection by policy
>   audio: Remove Media1 interface when a2dp source disallowed
>   core: add properties IsBlockedByPolicy and ServiceAllowList
>   core: store ServiceAllowList into settings
>
> Sonny Sasaka (1):
>   core: Initialize uuid_str_arr to NULL
>
>  Makefile.am              |   3 +-
>  doc/admin_policy-api.txt |  34 +++++
>  doc/device-api.txt       |   7 +
>  lib/uuid.c               |  21 +++
>  lib/uuid.h               |   3 +
>  profiles/audio/a2dp.c    |   2 +
>  profiles/audio/avrcp.c   |   3 +
>  profiles/input/hog.c     |  22 +++
>  src/adapter.c            | 148 +++++++++++++++++++-
>  src/adapter.h            |   5 +
>  src/admin_policy.c       | 292 +++++++++++++++++++++++++++++++++++++++
>  src/admin_policy.h       |  23 +++
>  src/device.c             |  79 ++++++++++-
>  src/device.h             |   2 +
>  src/profile.c            |  39 ++++++
>  src/profile.h            |   5 +
>  src/service.c            |  21 +++
>  src/service.h            |   1 +
>  18 files changed, 705 insertions(+), 5 deletions(-)
>  create mode 100644 doc/admin_policy-api.txt
>  create mode 100644 src/admin_policy.c
>  create mode 100644 src/admin_policy.h
>
> --
> 2.31.0.291.g576ba9dcdaf-goog

I think I mentioned to one of you guys before so sorry I will be
repeating myself, we did in the past have control over
blocking/connection on a per service level using a plugin:

https://github.com/Vudentz/BlueZ/commits/service_api
https://github.com/Vudentz/BlueZ/blob/service_api/plugins/service.c

It probably need some rebasing to be applied on top but it already
gives upper layer control over things like auto-connect and blocked
properties, I've didn't add support for persisting the setting on
storage though since this use case was limited to car industry but if
we go into this direction I rather have this plugin instead.