Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af6ec99b authored by Alice Kuo's avatar Alice Kuo
Browse files

Extend interface to support getting remote services with the specific transport

Bt stack only gets remote service with TRANSPORT_AUTO mode currently. As
the dual mode device, it may also do sdp service only. Expose the
capability to assign the specific transport.

Bug: 194447999
Test: Take two headphone to test the dual mode behavior
Change-Id: Idce8b0cc3c4f0a35d38dbab06d906dfca99ce93a
Merged-In: Idce8b0cc3c4f0a35d38dbab06d906dfca99ce93a
parent 37c51981
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ interface IBluetooth
    int getRemoteClass(in BluetoothDevice device);
    ParcelUuid[] getRemoteUuids(in BluetoothDevice device);
    @UnsupportedAppUsage
    boolean fetchRemoteUuids(in BluetoothDevice device);
    boolean fetchRemoteUuids(in BluetoothDevice device, in int transport);
    boolean sdpSearch(in BluetoothDevice device, in ParcelUuid uuid);
    int getBatteryLevel(in BluetoothDevice device);
    int getMaxConnectedAudioDevices();
+2 −2
Original line number Diff line number Diff line
@@ -282,11 +282,11 @@ int set_remote_device_property(RawAddress* remote_addr,
  return BT_STATUS_SUCCESS;
}

int get_remote_services(RawAddress* remote_addr) {
int get_remote_services(RawAddress* remote_addr, int transport) {
  if (!interface_ready()) return BT_STATUS_NOT_READY;

  do_in_main_thread(FROM_HERE, base::BindOnce(btif_dm_get_remote_services,
                                              *remote_addr, BT_TRANSPORT_AUTO));
                                              *remote_addr, transport));
  return BT_STATUS_SUCCESS;
}

+2 −2
Original line number Diff line number Diff line
@@ -600,8 +600,8 @@ typedef struct {
  int (*get_remote_service_record)(const RawAddress& remote_addr,
                                   const bluetooth::Uuid& uuid);

  /** Start SDP to get remote services */
  int (*get_remote_services)(RawAddress* remote_addr);
  /** Start service discovery with tranport to get remote services */
  int (*get_remote_services)(RawAddress* remote_addr, int transport);

  /** Start Discovery */
  int (*start_discovery)(void);