Loading system/gd/rust/linux/stack/src/bluetooth.rs +1 −1 Original line number Diff line number Diff line Loading @@ -649,7 +649,7 @@ impl Bluetooth { } pub fn toggle_enabled_profiles(&mut self, allowed_services: &Vec<Uuid128Bit>) { for profile in UuidHelper::get_supported_profiles().clone() { for profile in UuidHelper::get_ordered_supported_profiles().clone() { // Only toggle initializable profiles. if let Some(enabled) = self.is_profile_enabled(&profile) { let allowed = allowed_services.len() == 0 Loading system/gd/rust/linux/stack/src/uuid.rs +16 −5 Original line number Diff line number Diff line Loading @@ -109,7 +109,10 @@ impl<'a> Display for KnownUuidWrapper<'a> { pub struct UuidHelper {} lazy_static! { static ref SUPPORTED_PROFILES: HashSet<Profile> = [ // AVRCP fights with A2DP when initializing, so let's initiate profiles in a known good order. // Specifically, A2DP must be initialized before AVRCP. // TODO (b/286991526): remove after issue is resolved static ref ORDERED_SUPPORTED_PROFILES: Vec<Profile> = vec![ Profile::A2dpSink, Profile::A2dpSource, Profile::AvrcpController, Loading @@ -125,10 +128,12 @@ lazy_static! { Profile::HearingAid, Profile::VolumeControl, Profile::CoordinatedSet, ] .iter() .cloned() .collect(); ]; } lazy_static! { static ref SUPPORTED_PROFILES: HashSet<Profile> = ORDERED_SUPPORTED_PROFILES.iter().cloned().collect(); } lazy_static! { Loading Loading @@ -185,6 +190,12 @@ impl UuidHelper { PROFILES.get(uuid).cloned() } // AVRCP fights with A2DP when initializing, so let's initiate profiles in a known good order. // TODO (b/286991526): remove after issue is resolved pub fn get_ordered_supported_profiles() -> Vec<Profile> { ORDERED_SUPPORTED_PROFILES.clone() } pub fn get_supported_profiles() -> HashSet<Profile> { SUPPORTED_PROFILES.clone() } Loading Loading
system/gd/rust/linux/stack/src/bluetooth.rs +1 −1 Original line number Diff line number Diff line Loading @@ -649,7 +649,7 @@ impl Bluetooth { } pub fn toggle_enabled_profiles(&mut self, allowed_services: &Vec<Uuid128Bit>) { for profile in UuidHelper::get_supported_profiles().clone() { for profile in UuidHelper::get_ordered_supported_profiles().clone() { // Only toggle initializable profiles. if let Some(enabled) = self.is_profile_enabled(&profile) { let allowed = allowed_services.len() == 0 Loading
system/gd/rust/linux/stack/src/uuid.rs +16 −5 Original line number Diff line number Diff line Loading @@ -109,7 +109,10 @@ impl<'a> Display for KnownUuidWrapper<'a> { pub struct UuidHelper {} lazy_static! { static ref SUPPORTED_PROFILES: HashSet<Profile> = [ // AVRCP fights with A2DP when initializing, so let's initiate profiles in a known good order. // Specifically, A2DP must be initialized before AVRCP. // TODO (b/286991526): remove after issue is resolved static ref ORDERED_SUPPORTED_PROFILES: Vec<Profile> = vec![ Profile::A2dpSink, Profile::A2dpSource, Profile::AvrcpController, Loading @@ -125,10 +128,12 @@ lazy_static! { Profile::HearingAid, Profile::VolumeControl, Profile::CoordinatedSet, ] .iter() .cloned() .collect(); ]; } lazy_static! { static ref SUPPORTED_PROFILES: HashSet<Profile> = ORDERED_SUPPORTED_PROFILES.iter().cloned().collect(); } lazy_static! { Loading Loading @@ -185,6 +190,12 @@ impl UuidHelper { PROFILES.get(uuid).cloned() } // AVRCP fights with A2DP when initializing, so let's initiate profiles in a known good order. // TODO (b/286991526): remove after issue is resolved pub fn get_ordered_supported_profiles() -> Vec<Profile> { ORDERED_SUPPORTED_PROFILES.clone() } pub fn get_supported_profiles() -> HashSet<Profile> { SUPPORTED_PROFILES.clone() } Loading