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

Commit 1289bfa2 authored by Joseph Hwang's avatar Joseph Hwang Committed by Automerger Merge Worker
Browse files

Merge changes from topic "wbs_cap" am: 304acfbc am: 30b648ac

parents 241a2075 30b648ac
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@
#include "osi/include/log.h"
#include "osi/include/osi.h"
#include "osi/include/wakelock.h"
#include "stack/btm/btm_sco_hfp_hal.h"
#include "stack/gatt/connection_manager.h"
#include "stack/include/avdt_api.h"
#include "stack/include/btm_api.h"
@@ -242,6 +243,11 @@ static int disable(void) {
static void cleanup(void) { stack_manager_get_interface()->clean_up_stack(); }

bool is_restricted_mode() { return restricted_mode; }

static bool get_wbs_supported() {
  return hfp_hal_interface::get_wbs_supported();
}

bool is_common_criteria_mode() {
  return is_bluetooth_uid() && common_criteria_mode;
}
@@ -779,7 +785,8 @@ EXPORT_SYMBOL bt_interface_t bluetoothInterface = {
    allow_wake_by_hid,
    restore_filter_accept_list,
    set_default_event_mask,
    set_event_filter_inquiry_result_all_devices};
    set_event_filter_inquiry_result_all_devices,
    get_wbs_supported};

// callback reporting helpers

+2 −0
Original line number Diff line number Diff line
@@ -333,6 +333,7 @@ impl CommandHandler {
                    let cod = adapter_dbus.get_bluetooth_class();
                    let multi_adv_supported = adapter_dbus.is_multi_advertisement_supported();
                    let le_ext_adv_supported = adapter_dbus.is_le_extended_advertising_supported();
                    let wbs_supported = adapter_dbus.is_wbs_supported();
                    let uuid_helper = UuidHelper::new();
                    let enabled_profiles = uuid_helper.get_enabled_profiles();
                    let connected_profiles: Vec<Profile> = enabled_profiles
@@ -350,6 +351,7 @@ impl CommandHandler {
                    print_info!("IsMultiAdvertisementSupported: {}", multi_adv_supported);
                    print_info!("IsLeExtendedAdvertisingSupported: {}", le_ext_adv_supported);
                    print_info!("Connected profiles: {:?}", connected_profiles);
                    print_info!("IsWbsSupported: {}", wbs_supported);
                    print_info!(
                        "Uuids: {}",
                        DisplayList(
+5 −0
Original line number Diff line number Diff line
@@ -577,6 +577,11 @@ impl IBluetooth for BluetoothDBus {
    fn disconnect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool {
        dbus_generated!()
    }

    #[dbus_method("IsWbsSupported")]
    fn is_wbs_supported(&self) -> bool {
        dbus_generated!()
    }
}

pub(crate) struct BluetoothQADBus {
+5 −0
Original line number Diff line number Diff line
@@ -360,6 +360,11 @@ impl IBluetooth for IBluetoothDBus {
    fn disconnect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool {
        dbus_generated!()
    }

    #[dbus_method("IsWbsSupported")]
    fn is_wbs_supported(&self) -> bool {
        dbus_generated!()
    }
}

impl_dbus_arg_enum!(SocketType);
+7 −0
Original line number Diff line number Diff line
@@ -183,6 +183,9 @@ pub trait IBluetooth {

    /// Disconnect all profiles supported by device and enabled on adapter.
    fn disconnect_all_enabled_profiles(&mut self, device: BluetoothDevice) -> bool;

    /// Returns whether WBS is supported.
    fn is_wbs_supported(&self) -> bool;
}

/// Adapter API for Bluetooth qualification and verification.
@@ -1600,6 +1603,10 @@ impl IBluetooth for Bluetooth {

        return true;
    }

    fn is_wbs_supported(&self) -> bool {
        self.intf.lock().unwrap().get_wbs_supported()
    }
}

impl BtifSdpCallbacks for Bluetooth {
Loading