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

Commit e4538e5d authored by Ying Hsu's avatar Ying Hsu Committed by Gerrit Code Review
Browse files

Merge "Floss: Avoid LE connection for classic devices"

parents 165b2ca7 f74b2284
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ use crate::bluetooth_media::{BluetoothMedia, MediaActions};
use crate::socket_manager::{BluetoothSocketManager, SocketActions};
use crate::suspend::Suspend;
use bt_topshim::{
    btif::BaseCallbacks,
    btif::{BaseCallbacks, BtDeviceType},
    profiles::{
        a2dp::A2dpCallbacks, avrcp::AvrcpCallbacks, gatt::GattAdvCallbacks,
        gatt::GattAdvInbandCallbacks, gatt::GattClientCallbacks, gatt::GattScannerCallbacks,
@@ -240,20 +240,26 @@ impl Stack {
                // update method triggered from here rather than needing a
                // reference to Bluetooth.
                Message::OnAclConnected(device) => {
                    let dev_type = bluetooth.lock().unwrap().get_remote_type(device.clone());
                    if dev_type == BtDeviceType::Ble {
                        battery_service
                            .lock()
                            .unwrap()
                            .handle_action(BatteryServiceActions::Connect(device));
                    }
                }

                // For battery service, use this to clean up internal handles. GATT connection is
                // already dropped if ACL disconnect has occurred.
                Message::OnAclDisconnected(device) => {
                    let dev_type = bluetooth.lock().unwrap().get_remote_type(device.clone());
                    if dev_type == BtDeviceType::Ble {
                        battery_service
                            .lock()
                            .unwrap()
                            .handle_action(BatteryServiceActions::Disconnect(device));
                    }
                }

                Message::SuspendCallbackRegistered(id) => {
                    suspend.lock().unwrap().callback_registered(id);