Fix: Make AuthorizeService async to handle D-Bus rejections; correct CAPABILITY

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2025-12-30 22:00:46 +00:00
parent f8c09124a4
commit d0bd68bc6b

View File

@@ -28,7 +28,6 @@ AGENT_IFACE = 'org.bluez.Agent1'
AGENT_MANAGER_IFACE = 'org.bluez.AgentManager1'
AGENT_PATH = '/io/bluetooth_speaker/agent'
CAPABILITY = 'DisplayYesNo'
CAPABILITY = 'NoInputNoOutput'
CALLS_SERVICE_UUID = '0000111e-0000-1000-8000-00805f9b34fb'
AUDIO_SERVICE_UUID = '0000110d-0000-1000-8000-00805f9b34fb'
@@ -72,7 +71,7 @@ class Agent(ServiceInterface):
asyncio.create_task(trust_and_connect_device(device))
@method()
def AuthorizeService(self, device: 'o', uuid: 's'):
async def AuthorizeService(self, device: 'o', uuid: 's'):
logging.info(f"AuthorizeService request for device {device} with UUID {uuid}")
if uuid.lower() == CALLS_SERVICE_UUID:
logging.warning("Rejecting Hands-Free Profile (HFP) connection.")