Skip to content

Android: failed service discovery throws on Binder thread and wedges command queue #491

Description

@qdot

src/droidplug/java/.../Peripheral.java discoverServices (~L296-301): the onServicesDiscovered command callback does

if (status != BluetoothGatt.GATT_SUCCESS) {
    throw new RuntimeException("Unable to discover services");
}

outside of asyncWithFuture, so the exception escapes to the Binder thread instead of completing the future.

Failure scenario: discovery returns 129/133 → discover_services() hangs forever and the peripheral's command queue is permanently wedged.

Fix direction: wrap in asyncWithFuture so the failure completes the future exceptionally and the queue advances.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidIssues related to the android corebugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions