Loading android/app/src/com/android/bluetooth/btservice/AdapterProperties.java +1 −2 Original line number Diff line number Diff line Loading @@ -950,8 +950,7 @@ class AdapterProperties { case AbstractionLayer.BT_PROPERTY_LOCAL_LE_FEATURES: updateFeatureSupport(val); mService.updateLeAudioProfileServiceState( mIsLeConnectedIsochronousStreamCentralSupported); mService.updateLeAudioProfileServiceState(); break; case AbstractionLayer.BT_PROPERTY_DYNAMIC_AUDIO_BUFFER: Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +31 −12 Original line number Diff line number Diff line Loading @@ -745,22 +745,30 @@ public class AdapterService extends Service { } */ void updateLeAudioProfileServiceState(boolean isCisCentralSupported) { if (isCisCentralSupported) { return; void updateLeAudioProfileServiceState() { HashSet<Class> nonSupportedProfiles = new HashSet<>(); if (!isLeConnectedIsochronousStreamCentralSupported()) { nonSupportedProfiles.addAll(Config.geLeAudioUnicastProfiles()); } if (!isLeAudioBroadcastAssistantSupported()) { nonSupportedProfiles.add(BassClientService.class); } // Remove the Le audio unicast profiles from the supported list if (!nonSupportedProfiles.isEmpty()) { // Remove non-supported profiles from the supported list // since the controller doesn't support Config.removeLeAudioUnicastProfilesFromSupportedList(); HashSet<Class> leAudioUnicastProfiles = Config.geLeAudioUnicastProfiles(); Config.removeProfileFromSupportedList(nonSupportedProfiles); for (Class profileService : leAudioUnicastProfiles) { // Disable the non-supported profiles service for (Class profileService : nonSupportedProfiles) { if (isStartedProfile(profileService.getSimpleName())) { setProfileServiceState(profileService, BluetoothAdapter.STATE_OFF); } } } } void updateAdapterState(int prevState, int newState) { mAdapterProperties.setState(newState); Loading Loading @@ -3418,7 +3426,10 @@ public class AdapterService extends Service { return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED; } if (service.isLeAudioBroadcastAssistantSupported()) { HashSet<Class> supportedProfileServices = new HashSet<Class>(Arrays.asList(Config.getSupportedProfiles())); if (supportedProfileServices.contains(BassClientService.class)) { return BluetoothStatusCodes.FEATURE_SUPPORTED; } Loading Loading @@ -4603,13 +4614,21 @@ public class AdapterService extends Service { * @return true, if the LE audio broadcast assistant is supported */ public boolean isLeAudioBroadcastAssistantSupported() { //TODO: check the profile support status as well after we have the implementation return mAdapterProperties.isLePeriodicAdvertisingSupported() && mAdapterProperties.isLeExtendedAdvertisingSupported() && (mAdapterProperties.isLePeriodicAdvertisingSyncTransferSenderSupported() || mAdapterProperties.isLePeriodicAdvertisingSyncTransferRecipientSupported()); } /** * Check if the LE audio CIS central feature is supported. * * @return true, if the LE audio CIS central is supported */ public boolean isLeConnectedIsochronousStreamCentralSupported() { return mAdapterProperties.isLeConnectedIsochronousStreamCentralSupported(); } public int getLeMaximumAdvertisingDataLength() { return mAdapterProperties.getLeMaximumAdvertisingDataLength(); } Loading android/app/src/com/android/bluetooth/btservice/Config.java +3 −3 Original line number Diff line number Diff line Loading @@ -199,16 +199,16 @@ public class Config { } /** * Remove LE audio unicast related profiles from the supported list. * Remove the input profiles from the supported list. */ static void removeLeAudioUnicastProfilesFromSupportedList() { static void removeProfileFromSupportedList(HashSet<Class> nonSupportedProfiles) { ArrayList<Class> profilesList = new ArrayList<Class>(Arrays.asList(sSupportedProfiles)); Iterator<Class> iter = profilesList.iterator(); while (iter.hasNext()) { Class profileClass = iter.next(); if (mLeAudioUnicastProfiles.contains(profileClass)) { if (nonSupportedProfiles.contains(profileClass)) { iter.remove(); Log.v(TAG, "Remove " + profileClass.getSimpleName() + " from supported list."); } Loading Loading
android/app/src/com/android/bluetooth/btservice/AdapterProperties.java +1 −2 Original line number Diff line number Diff line Loading @@ -950,8 +950,7 @@ class AdapterProperties { case AbstractionLayer.BT_PROPERTY_LOCAL_LE_FEATURES: updateFeatureSupport(val); mService.updateLeAudioProfileServiceState( mIsLeConnectedIsochronousStreamCentralSupported); mService.updateLeAudioProfileServiceState(); break; case AbstractionLayer.BT_PROPERTY_DYNAMIC_AUDIO_BUFFER: Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +31 −12 Original line number Diff line number Diff line Loading @@ -745,22 +745,30 @@ public class AdapterService extends Service { } */ void updateLeAudioProfileServiceState(boolean isCisCentralSupported) { if (isCisCentralSupported) { return; void updateLeAudioProfileServiceState() { HashSet<Class> nonSupportedProfiles = new HashSet<>(); if (!isLeConnectedIsochronousStreamCentralSupported()) { nonSupportedProfiles.addAll(Config.geLeAudioUnicastProfiles()); } if (!isLeAudioBroadcastAssistantSupported()) { nonSupportedProfiles.add(BassClientService.class); } // Remove the Le audio unicast profiles from the supported list if (!nonSupportedProfiles.isEmpty()) { // Remove non-supported profiles from the supported list // since the controller doesn't support Config.removeLeAudioUnicastProfilesFromSupportedList(); HashSet<Class> leAudioUnicastProfiles = Config.geLeAudioUnicastProfiles(); Config.removeProfileFromSupportedList(nonSupportedProfiles); for (Class profileService : leAudioUnicastProfiles) { // Disable the non-supported profiles service for (Class profileService : nonSupportedProfiles) { if (isStartedProfile(profileService.getSimpleName())) { setProfileServiceState(profileService, BluetoothAdapter.STATE_OFF); } } } } void updateAdapterState(int prevState, int newState) { mAdapterProperties.setState(newState); Loading Loading @@ -3418,7 +3426,10 @@ public class AdapterService extends Service { return BluetoothStatusCodes.ERROR_BLUETOOTH_NOT_ENABLED; } if (service.isLeAudioBroadcastAssistantSupported()) { HashSet<Class> supportedProfileServices = new HashSet<Class>(Arrays.asList(Config.getSupportedProfiles())); if (supportedProfileServices.contains(BassClientService.class)) { return BluetoothStatusCodes.FEATURE_SUPPORTED; } Loading Loading @@ -4603,13 +4614,21 @@ public class AdapterService extends Service { * @return true, if the LE audio broadcast assistant is supported */ public boolean isLeAudioBroadcastAssistantSupported() { //TODO: check the profile support status as well after we have the implementation return mAdapterProperties.isLePeriodicAdvertisingSupported() && mAdapterProperties.isLeExtendedAdvertisingSupported() && (mAdapterProperties.isLePeriodicAdvertisingSyncTransferSenderSupported() || mAdapterProperties.isLePeriodicAdvertisingSyncTransferRecipientSupported()); } /** * Check if the LE audio CIS central feature is supported. * * @return true, if the LE audio CIS central is supported */ public boolean isLeConnectedIsochronousStreamCentralSupported() { return mAdapterProperties.isLeConnectedIsochronousStreamCentralSupported(); } public int getLeMaximumAdvertisingDataLength() { return mAdapterProperties.getLeMaximumAdvertisingDataLength(); } Loading
android/app/src/com/android/bluetooth/btservice/Config.java +3 −3 Original line number Diff line number Diff line Loading @@ -199,16 +199,16 @@ public class Config { } /** * Remove LE audio unicast related profiles from the supported list. * Remove the input profiles from the supported list. */ static void removeLeAudioUnicastProfilesFromSupportedList() { static void removeProfileFromSupportedList(HashSet<Class> nonSupportedProfiles) { ArrayList<Class> profilesList = new ArrayList<Class>(Arrays.asList(sSupportedProfiles)); Iterator<Class> iter = profilesList.iterator(); while (iter.hasNext()) { Class profileClass = iter.next(); if (mLeAudioUnicastProfiles.contains(profileClass)) { if (nonSupportedProfiles.contains(profileClass)) { iter.remove(); Log.v(TAG, "Remove " + profileClass.getSimpleName() + " from supported list."); } Loading