Week 4

Progress summary for Week 4 (June 15-21, 2026) of the AGL Bluetooth Integration project.

This week focused on completing the Bluetooth connection flow in ivi-homescreen, including paired-device management, discovery, pairing, connection switching, disconnection, and device removal.

Status#

  • Status: Completed
  • Timeline: June 15, 2026 to June 21, 2026

Progress#

1. Paired Bluetooth Devices#

Updated the main Bluetooth page to show paired devices only. Each disconnected device is displayed with a forget icon, while the currently connected device is highlighted and includes a Disconnect button. The connection logic limits the system to one active Bluetooth device at a time.

Bluetooth page showing paired Keychron B6 Pro and WH-CH520 devices with forget icons.
Paired devices shown on the main Bluetooth page.

2. Bluetooth Device Discovery#

Implemented the Scan for New Device flow. Starting a scan makes the host pairable and discoverable, starts Bluetooth discovery, and opens a dedicated page containing unpaired devices only. Devices with a resolved name show that name, while unnamed devices fall back to their Bluetooth MAC address.

Scan for New Device page showing an unpaired Pixel 9a, a Huawei watch, and unnamed devices represented by MAC addresses.
Unpaired devices discovered during a Bluetooth scan.

Selecting a result temporarily blocks further selection and highlights the row with a Connecting... status while BlueZ starts the connection and pairing process.

Scan page showing Pixel 9a highlighted with a Connecting status.
Selected device entering the connecting state.

3. Pairing Agent Flow#

Integrated the BlueZ pairing-agent request with the homescreen UI. When a device requires authentication, the app opens a Bluetooth Pairing Request dialog containing the device name, passkey or PIN, instructions, and Cancel and Confirm actions.

Bluetooth Pairing Request dialog for Pixel 9a showing passkey 061383 and Cancel and Confirm buttons.
BlueZ pairing request presented as a passkey confirmation dialog.

After confirmation, the device is paired, marked as trusted, connected, and added to the main Bluetooth page. The connected row is highlighted and exposes the disconnect action.

Bluetooth page showing Pixel 9a connected and highlighted with a Disconnect button.
Pixel 9a paired, trusted, and connected successfully.

4. Connection Switching#

Added handling for incoming pair or connection requests while another device is already connected. The Switch Bluetooth Device? dialog identifies the new device and warns which active device will be disconnected.

Switch Bluetooth Device dialog explaining that connecting POCO F6 Pro will disconnect Pixel 9a.
Confirmation dialog shown before switching the active Bluetooth device.

Choosing Switch disconnects the current device, accepts the incoming request, pairs and trusts the new device when required, and then connects it. Choosing Cancel rejects the request and keeps the current device connected.

Bluetooth page showing POCO F6 Pro as the connected device while Pixel 9a remains paired.
POCO F6 Pro connected after switching from Pixel 9a.

5. Disconnecting a Device#

The Disconnect button appears only on the active device row. Disconnecting keeps the device paired and returns its row to the normal paired state, allowing it to be connected again later without repeating the pairing process.

Bluetooth page showing Pixel 9a retained as a paired device after disconnection.
Pixel 9a remains in the paired-device list after disconnection.

6. Forgetting a Paired Device#

Added a forget action to every paired-device row. Selecting the X icon opens a confirmation dialog before removing the device. Confirming the action first disconnects the device when necessary, removes it from BlueZ's paired devices, and removes its row from the Bluetooth page. Cancelling leaves the device and its current connection unchanged.


Next Week's Plan#

  • Code Cleanup and Merge Preparation:
    • Refactor and document the homescreen Bluetooth UI views and pairing agent classes.
    • Clean up the bluez_media_native plugin codebase and prepare the merge requests for the upstream repository.
  • Hardware Validation on Raspberry Pi 5:
    • Deploy the updated ivi-homescreen application onto the Raspberry Pi 5 AGL target image.
    • Capture and verify D-Bus, BlueZ, and PipeWire logs during the pairing, connection, and switching sequences to ensure system stability.