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

Commit 86d08619 authored by Jeremy Wu's avatar Jeremy Wu Committed by Gerrit Code Review
Browse files

Merge "Floss: dedup media connect actions"

parents 67cd26af 7e96b758
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -1862,6 +1862,7 @@ impl IBluetooth for Bluetooth {

        // Check all remote uuids to see if they match enabled profiles and connect them.
        let mut has_enabled_uuids = false;
        let mut has_media_profile = false;
        let uuids = self.get_remote_uuids(device.clone());
        for uuid in uuids.iter() {
            match UuidHelper::is_known_profile(uuid) {
@@ -1887,10 +1888,10 @@ impl IBluetooth for Bluetooth {
                                }
                            }

                            Profile::A2dpSink
                            | Profile::A2dpSource
                            | Profile::Hfp
                            | Profile::AvrcpController => {
                            Profile::A2dpSink | Profile::A2dpSource | Profile::Hfp
                                if !has_media_profile =>
                            {
                                has_media_profile = true;
                                let txl = self.tx.clone();
                                let address = device.address.clone();
                                topstack::get_runtime().spawn(async move {
@@ -1969,6 +1970,7 @@ impl IBluetooth for Bluetooth {
        }

        let uuids = self.get_remote_uuids(device.clone());
        let mut has_media_profile = false;
        for uuid in uuids.iter() {
            match UuidHelper::is_known_profile(uuid) {
                Some(p) => {
@@ -1981,7 +1983,10 @@ impl IBluetooth for Bluetooth {
                            Profile::A2dpSink
                            | Profile::A2dpSource
                            | Profile::Hfp
                            | Profile::AvrcpController => {
                            | Profile::AvrcpController
                                if !has_media_profile =>
                            {
                                has_media_profile = true;
                                let txl = self.tx.clone();
                                let address = device.address.clone();
                                topstack::get_runtime().spawn(async move {
+1 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ lazy_static! {
    static ref SUPPORTED_PROFILES: HashSet<Profile> = [
        Profile::A2dpSink,
        Profile::A2dpSource,
        Profile::AvrcpController,
        Profile::Bas,
        Profile::Hsp,
        Profile::Hfp,