pilot-drive icon indicating copy to clipboard operation
pilot-drive copied to clipboard

Bluetooth needs refactoring

Open lamemakes opened this issue 1 year ago • 1 comments

Putting this here to keep track and outline the issue in case anyone was feeling up the the task.

Basically Bluetooth will need a refactor. As it stands, the Bluetooth service does not run on it's own Process. It is leveraged by other services (ie. media & phone/ANCS) to easily get BluezMediaPlayer and BluezDevice objects. This approach currently requires the service using Bluetooth to keep track of devices and make appropriate bluetooth state pushes to the UI.

This is icky and adds a lot of complexity & room for error to the overall program, along with making it hard to leverage the Bluetooth service for any service down the line.

The ideal solution here would be to make the Bluetooth service more self-contained, less reliant on external services, and easier to access APIs. This was my initial approach as can be seen here, but this seemed to put a lot of strain on DBus as accessing Bluetooth properties for the latest info/states required accessing of the dasbus proxy every time. Can be it's own process, but I'm trying to avoid process creation unless absolutely needed.

Rage on 🫡

lamemakes avatar May 05 '23 20:05 lamemakes